Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 1 | <html><body> |
| 2 | <style> |
| 3 | |
| 4 | body, h1, h2, h3, div, span, p, pre, a { |
| 5 | margin: 0; |
| 6 | padding: 0; |
| 7 | border: 0; |
| 8 | font-weight: inherit; |
| 9 | font-style: inherit; |
| 10 | font-size: 100%; |
| 11 | font-family: inherit; |
| 12 | vertical-align: baseline; |
| 13 | } |
| 14 | |
| 15 | body { |
| 16 | font-size: 13px; |
| 17 | padding: 1em; |
| 18 | } |
| 19 | |
| 20 | h1 { |
| 21 | font-size: 26px; |
| 22 | margin-bottom: 1em; |
| 23 | } |
| 24 | |
| 25 | h2 { |
| 26 | font-size: 24px; |
| 27 | margin-bottom: 1em; |
| 28 | } |
| 29 | |
| 30 | h3 { |
| 31 | font-size: 20px; |
| 32 | margin-bottom: 1em; |
| 33 | margin-top: 1em; |
| 34 | } |
| 35 | |
| 36 | pre, code { |
| 37 | line-height: 1.5; |
| 38 | font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace; |
| 39 | } |
| 40 | |
| 41 | pre { |
| 42 | margin-top: 0.5em; |
| 43 | } |
| 44 | |
| 45 | h1, h2, h3, p { |
| 46 | font-family: Arial, sans serif; |
| 47 | } |
| 48 | |
| 49 | h1, h2, h3 { |
| 50 | border-bottom: solid #CCC 1px; |
| 51 | } |
| 52 | |
| 53 | .toc_element { |
| 54 | margin-top: 0.5em; |
| 55 | } |
| 56 | |
| 57 | .firstline { |
| 58 | margin-left: 2 em; |
| 59 | } |
| 60 | |
| 61 | .method { |
| 62 | margin-top: 1em; |
| 63 | border: solid 1px #CCC; |
| 64 | padding: 1em; |
| 65 | background: #EEE; |
| 66 | } |
| 67 | |
| 68 | .details { |
| 69 | font-weight: bold; |
| 70 | font-size: 14px; |
| 71 | } |
| 72 | |
| 73 | </style> |
| 74 | |
| 75 | <h1><a href="iamcredentials_v1.html">IAM Service Account Credentials API</a> . <a href="iamcredentials_v1.projects.html">projects</a> . <a href="iamcredentials_v1.projects.serviceAccounts.html">serviceAccounts</a></h1> |
| 76 | <h2>Instance Methods</h2> |
| 77 | <p class="toc_element"> |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame^] | 78 | <code><a href="#generateAccessToken">generateAccessToken(name, body=None, x__xgafv=None)</a></code></p> |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 79 | <p class="firstline">Generates an OAuth 2.0 access token for a service account.</p> |
| 80 | <p class="toc_element"> |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame^] | 81 | <code><a href="#generateIdToken">generateIdToken(name, body=None, x__xgafv=None)</a></code></p> |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 82 | <p class="firstline">Generates an OpenID Connect ID token for a service account.</p> |
| 83 | <p class="toc_element"> |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame^] | 84 | <code><a href="#signBlob">signBlob(name, body=None, x__xgafv=None)</a></code></p> |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 85 | <p class="firstline">Signs a blob using a service account's system-managed private key.</p> |
| 86 | <p class="toc_element"> |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame^] | 87 | <code><a href="#signJwt">signJwt(name, body=None, x__xgafv=None)</a></code></p> |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 88 | <p class="firstline">Signs a JWT using a service account's system-managed private key.</p> |
| 89 | <h3>Method Details</h3> |
| 90 | <div class="method"> |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame^] | 91 | <code class="details" id="generateAccessToken">generateAccessToken(name, body=None, x__xgafv=None)</code> |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 92 | <pre>Generates an OAuth 2.0 access token for a service account. |
| 93 | |
| 94 | Args: |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame^] | 95 | name: string, Required. The resource name of the service account for which the credentials |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 96 | are requested, in the following format: |
| 97 | `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`. The `-` wildcard |
| 98 | character is required; replacing it with a project ID is invalid. (required) |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame^] | 99 | body: object, The request body. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 100 | The object takes the form of: |
| 101 | |
| 102 | { |
| 103 | "lifetime": "A String", # The desired lifetime duration of the access token in seconds. |
| 104 | # Must be set to a value less than or equal to 3600 (1 hour). If a value is |
| 105 | # not specified, the token's lifetime will be set to a default value of one |
| 106 | # hour. |
| 107 | "delegates": [ # The sequence of service accounts in a delegation chain. Each service |
| 108 | # account must be granted the `roles/iam.serviceAccountTokenCreator` role |
| 109 | # on its next service account in the chain. The last service account in the |
| 110 | # chain must be granted the `roles/iam.serviceAccountTokenCreator` role |
| 111 | # on the service account that is specified in the `name` field of the |
| 112 | # request. |
| 113 | # |
| 114 | # The delegates must have the following format: |
| 115 | # `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`. The `-` wildcard |
| 116 | # character is required; replacing it with a project ID is invalid. |
| 117 | "A String", |
| 118 | ], |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame^] | 119 | "scope": [ # Required. Code to identify the scopes to be included in the OAuth 2.0 access token. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 120 | # See https://developers.google.com/identity/protocols/googlescopes for more |
| 121 | # information. |
| 122 | # At least one value required. |
| 123 | "A String", |
| 124 | ], |
| 125 | } |
| 126 | |
| 127 | x__xgafv: string, V1 error format. |
| 128 | Allowed values |
| 129 | 1 - v1 error format |
| 130 | 2 - v2 error format |
| 131 | |
| 132 | Returns: |
| 133 | An object of the form: |
| 134 | |
| 135 | { |
| 136 | "expireTime": "A String", # Token expiration time. |
| 137 | # The expiration time is always set. |
| 138 | "accessToken": "A String", # The OAuth 2.0 access token. |
| 139 | }</pre> |
| 140 | </div> |
| 141 | |
| 142 | <div class="method"> |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame^] | 143 | <code class="details" id="generateIdToken">generateIdToken(name, body=None, x__xgafv=None)</code> |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 144 | <pre>Generates an OpenID Connect ID token for a service account. |
| 145 | |
| 146 | Args: |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame^] | 147 | name: string, Required. The resource name of the service account for which the credentials |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 148 | are requested, in the following format: |
| 149 | `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`. The `-` wildcard |
| 150 | character is required; replacing it with a project ID is invalid. (required) |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame^] | 151 | body: object, The request body. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 152 | The object takes the form of: |
| 153 | |
| 154 | { |
| 155 | "includeEmail": True or False, # Include the service account email in the token. If set to `true`, the |
| 156 | # token will contain `email` and `email_verified` claims. |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame^] | 157 | "audience": "A String", # Required. The audience for the token, such as the API or account that this token |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 158 | # grants access to. |
| 159 | "delegates": [ # The sequence of service accounts in a delegation chain. Each service |
| 160 | # account must be granted the `roles/iam.serviceAccountTokenCreator` role |
| 161 | # on its next service account in the chain. The last service account in the |
| 162 | # chain must be granted the `roles/iam.serviceAccountTokenCreator` role |
| 163 | # on the service account that is specified in the `name` field of the |
| 164 | # request. |
| 165 | # |
| 166 | # The delegates must have the following format: |
| 167 | # `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`. The `-` wildcard |
| 168 | # character is required; replacing it with a project ID is invalid. |
| 169 | "A String", |
| 170 | ], |
| 171 | } |
| 172 | |
| 173 | x__xgafv: string, V1 error format. |
| 174 | Allowed values |
| 175 | 1 - v1 error format |
| 176 | 2 - v2 error format |
| 177 | |
| 178 | Returns: |
| 179 | An object of the form: |
| 180 | |
| 181 | { |
| 182 | "token": "A String", # The OpenId Connect ID token. |
| 183 | }</pre> |
| 184 | </div> |
| 185 | |
| 186 | <div class="method"> |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame^] | 187 | <code class="details" id="signBlob">signBlob(name, body=None, x__xgafv=None)</code> |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 188 | <pre>Signs a blob using a service account's system-managed private key. |
| 189 | |
| 190 | Args: |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame^] | 191 | name: string, Required. The resource name of the service account for which the credentials |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 192 | are requested, in the following format: |
| 193 | `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`. The `-` wildcard |
| 194 | character is required; replacing it with a project ID is invalid. (required) |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame^] | 195 | body: object, The request body. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 196 | The object takes the form of: |
| 197 | |
| 198 | { |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame^] | 199 | "payload": "A String", # Required. The bytes to sign. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 200 | "delegates": [ # The sequence of service accounts in a delegation chain. Each service |
| 201 | # account must be granted the `roles/iam.serviceAccountTokenCreator` role |
| 202 | # on its next service account in the chain. The last service account in the |
| 203 | # chain must be granted the `roles/iam.serviceAccountTokenCreator` role |
| 204 | # on the service account that is specified in the `name` field of the |
| 205 | # request. |
| 206 | # |
| 207 | # The delegates must have the following format: |
| 208 | # `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`. The `-` wildcard |
| 209 | # character is required; replacing it with a project ID is invalid. |
| 210 | "A String", |
| 211 | ], |
| 212 | } |
| 213 | |
| 214 | x__xgafv: string, V1 error format. |
| 215 | Allowed values |
| 216 | 1 - v1 error format |
| 217 | 2 - v2 error format |
| 218 | |
| 219 | Returns: |
| 220 | An object of the form: |
| 221 | |
| 222 | { |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame^] | 223 | "signedBlob": "A String", # The signature for the blob. Does not include the original blob. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 224 | "keyId": "A String", # The ID of the key used to sign the blob. |
| 225 | }</pre> |
| 226 | </div> |
| 227 | |
| 228 | <div class="method"> |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame^] | 229 | <code class="details" id="signJwt">signJwt(name, body=None, x__xgafv=None)</code> |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 230 | <pre>Signs a JWT using a service account's system-managed private key. |
| 231 | |
| 232 | Args: |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame^] | 233 | name: string, Required. The resource name of the service account for which the credentials |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 234 | are requested, in the following format: |
| 235 | `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`. The `-` wildcard |
| 236 | character is required; replacing it with a project ID is invalid. (required) |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame^] | 237 | body: object, The request body. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 238 | The object takes the form of: |
| 239 | |
| 240 | { |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame^] | 241 | "payload": "A String", # Required. The JWT payload to sign. Must be a serialized JSON object that contains a |
| 242 | # JWT Claim Set. For example: `{"sub": "user@example.com", "iat": 313435}` |
| 243 | # |
| 244 | # If the claim set contains an `exp` claim, it must be an integer timestamp |
| 245 | # that is not in the past and at most 12 hours in the future. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 246 | "delegates": [ # The sequence of service accounts in a delegation chain. Each service |
| 247 | # account must be granted the `roles/iam.serviceAccountTokenCreator` role |
| 248 | # on its next service account in the chain. The last service account in the |
| 249 | # chain must be granted the `roles/iam.serviceAccountTokenCreator` role |
| 250 | # on the service account that is specified in the `name` field of the |
| 251 | # request. |
| 252 | # |
| 253 | # The delegates must have the following format: |
| 254 | # `projects/-/serviceAccounts/{ACCOUNT_EMAIL_OR_UNIQUEID}`. The `-` wildcard |
| 255 | # character is required; replacing it with a project ID is invalid. |
| 256 | "A String", |
| 257 | ], |
| 258 | } |
| 259 | |
| 260 | x__xgafv: string, V1 error format. |
| 261 | Allowed values |
| 262 | 1 - v1 error format |
| 263 | 2 - v2 error format |
| 264 | |
| 265 | Returns: |
| 266 | An object of the form: |
| 267 | |
| 268 | { |
| 269 | "keyId": "A String", # The ID of the key used to sign the JWT. |
Dan O'Meara | dd49464 | 2020-05-01 07:42:23 -0700 | [diff] [blame^] | 270 | "signedJwt": "A String", # The signed JWT. Contains the automatically generated header; the |
| 271 | # client-supplied payload; and the signature, which is generated using the |
| 272 | # key referenced by the `kid` field in the header. |
Bu Sun Kim | 715bd7f | 2019-06-14 16:50:42 -0700 | [diff] [blame] | 273 | }</pre> |
| 274 | </div> |
| 275 | |
| 276 | </body></html> |