You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/active-directory/develop/reference-aadsts-error-codes.md
+43Lines changed: 43 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -24,6 +24,49 @@ Looking for info about the AADSTS error codes that are returned from the Azure A
24
24
>
25
25
> This documentation is provided for developer and admin guidance, but should never be used by the client itself. Error codes are subject to change at any time in order to provide more granular error messages that are intended to help the developer while building their application. Apps that take a dependency on text or error code numbers will be broken over time.
26
26
27
+
## Handling error codes in your application
28
+
29
+
The [OAuth2.0 spec](https://tools.ietf.org/html/rfc6749#section-5.2) provides guidance on how to handle errors during authentication using the `error` portion of the error response.
30
+
31
+
Here is a sample error response:
32
+
33
+
```json
34
+
{
35
+
"error": "invalid_scope",
36
+
"error_description": "AADSTS70011: The provided value for the input parameter 'scope' is not valid. The scope https://example.contoso.com/activity.read is not valid.\r\nTrace ID: 255d1aef-8c98-452f-ac51-23d051240864\r\nCorrelation ID: fb3d2015-bc17-4bb9-bb85-30c5cf1aaaa7\r\nTimestamp: 2016-01-09 02:02:12Z",
|`error`| An error code string that can be used to classify types of errors that occur, and should be used to react to errors. |
50
+
|`error_description`| A specific error message that can help a developer identify the root cause of an authentication error. Never use this field to react to an error in your code. |
51
+
|`error_codes`| A list of STS-specific error codes that can help in diagnostics. |
52
+
|`timestamp`| The time at which the error occurred. |
53
+
|`trace_id`| A unique identifier for the request that can help in diagnostics. |
54
+
|`correlation_id`| A unique identifier for the request that can help in diagnostics across components. |
55
+
|`error_uri`| A link to the error lookup page with additional information about the error. This is for developer usage only, do not present it to users. Only present when the error lookup system has additional information about the error - not all error have additional information provided.|
56
+
57
+
The `error` field has several possible values - review the protocol documentation links and OAuth 2.0 specs to learn more about specific errors (for example, `authorization_pending` in the [device code flow](v2-oauth2-device-code.md)) and how to react to them. Some common ones are listed here:
|`invalid_request`| Protocol error, such as a missing required parameter. | Fix and resubmit the request.|
62
+
|`invalid_grant`| Some of the authentication material (auth code, refresh token, access token, PKCE challenge) was invalid, unparseable, missing, or otherwise unuseable | Try a new request to the `/authorize` endpoint to get a new authorization code. Consider reviewing and validating that app's use of the protocols. |
63
+
|`unauthorized_client`| The authenticated client isn't authorized to use this authorization grant type. | This usually occurs when the client application isn't registered in Azure AD or isn't added to the user's Azure AD tenant. The application can prompt the user with instruction for installing the application and adding it to Azure AD. |
64
+
|`invalid_client`| Client authentication failed. | The client credentials aren't valid. To fix, the application administrator updates the credentials. |
65
+
|`unsupported_grant_type`| The authorization server does not support the authorization grant type. | Change the grant type in the request. This type of error should occur only during development and be detected during initial testing. |
66
+
|`invalid_resource`| The target resource is invalid because it does not exist, Azure AD can't find it, or it's not correctly configured. | This indicates the resource, if it exists, has not been configured in the tenant. The application can prompt the user with instruction for installing the application and adding it to Azure AD. During development, this usually indicates an incorrectly setup test tenant or a typo in the name of the scope being requested. |
67
+
|`interaction_required`| The request requires user interaction. For example, an additional authentication step is required. | Retry the request with the same resource, interactievly, so that the user can complete any challenges required. |
68
+
|`temporarily_unavailable`| The server is temporarily too busy to handle the request. | Retry the request. The client application might explain to the user that its response is delayed because of a temporary condition. |
69
+
27
70
## Lookup current error code information
28
71
Error codes and messages are subject to change. For the most current info, take a look at the `https://login.microsoftonline.com/error` page to find AADSTS error descriptions, fixes, and some suggested workarounds.
0 commit comments