(clientID, clientSecret, audience, organization string)
| 47 | } |
| 48 | |
| 49 | func BuildOauthTokenParams(clientID, clientSecret, audience, organization string) url.Values { |
| 50 | q := url.Values{ |
| 51 | "audience": {audience}, |
| 52 | "client_id": {clientID}, |
| 53 | "client_secret": {clientSecret}, |
| 54 | "grant_type": {"client_credentials"}, |
| 55 | } |
| 56 | if organization != "" { |
| 57 | q.Set("organization", organization) |
| 58 | } |
| 59 | return q |
| 60 | } |
| 61 | |
| 62 | // runClientCredentialsFlow runs an M2M client |
| 63 | // credentials flow without opening a browser. |
no outgoing calls