Access Tokens - Get From Login
Exchange Username, Password and Scope an ACR Access Token
GET {url}/oauth2/token?service={service}&scope={scope}
URI Parameters
Name | In | Required | Type | Description |
---|---|---|---|---|
url
|
path | True |
string |
Registry login URL |
scope
|
query | True |
string |
Expected to be a valid scope, and can be specified more than once for multiple scope requests. You can obtain this from the Www-Authenticate response header from the challenge. |
service
|
query | True |
string |
Indicates the name of your Azure container registry. |
Responses
Name | Type | Description |
---|---|---|
200 OK |
Access token acquired |
|
Other Status Codes |
ACR error response describing why the operation failed. |
Security
registry_auth
Type:
basic
Examples
Get Access Token with username and password
Sample Request
GET acrapi.azurecr-test.io/oauth2/token?service=someregistry.azurecr.io&scope=registry:catalog:*
Sample Response
{
"access_token": "eyJ0eXAiOiJKJhbGcigdCI6IkN0ZlFaOExlLTMejlnIiwidGlkIjoiNzbmOTgWItMmQ3Y2QwMTFkYjQ3Ii..."
}
Definitions
Name | Description |
---|---|
Access |
|
Acr |
Error information |
Acr |
Acr error response describing why the operation failed |
AccessToken
Name | Type | Description |
---|---|---|
access_token |
string |
The access token for performing authenticated requests |
AcrErrorInfo
Error information
Name | Type | Description |
---|---|---|
code |
string |
Error code |
detail |
object |
Error details |
message |
string |
Error message |
AcrErrors
Acr error response describing why the operation failed
Name | Type | Description |
---|---|---|
errors |
Array of detailed error |