Azure-docs: ADALError to MsalException ErrorCode documentation seems missing

Created on 17 Aug 2020  Â·  5Comments  Â·  Source: MicrosoftDocs/azure-docs

[Enter feedback here]


Document Details

⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.

Pri2 active-directorsvc assigned-to-author develosubsvc doc-bug triaged

All 5 comments

@samsil
Thanks for your feedback! We will investigate and update as appropriate.

@hamiltonha Haley, as @samsil calls out, it seems we have an empty ADALError to MsalException ErrorCode section in this doc - looks like it was missed on initial publish. Assigning over to you for investigation: #reassign:hamiltonha

Instead of filling out that section, though, what about adding an ADALError equivalent column to the table in the previous section? Not sure they translate one-to-one, however, so if completing the ADALError to MsalException ErrorCode section makes more sense, we should go that route.

Something like this:

Migrate to the new exceptions

In ADAL, there's one type of exception, AuthenticationException, which includes a method for retrieving the ADALError enum value. In MSAL, there's a hierarchy of exceptions, and each has its own set of associated error codes.

The following table shows a mapping between ADALErrors and their MsalException equivalents.

| MsalException | Description | ADALError equivalent |
|:-------------------------------------------------|:--------------------------------------------------------------------|:---------------------|
| MsalException | Default checked exception thrown by MSAL. | {ADALError here} |
| MsalClientException | Thrown if the error is client side. | {ADALError here} |
| MsalArgumentException | Thrown if one or more inputs arguments are invalid. | {ADALError here} |
| MsalClientException | Thrown if the error is client side. | {ADALError here} |
| MsalServiceException | Thrown if the error is server side. | {ADALError here} |
| MsalUserCancelException | Thrown if the user canceled the authentication flow. | {ADALError here} |
| MsalUiRequiredException | Thrown if the token can't be refreshed silently. | {ADALError here} |
| MsalDeclinedScopeException | Thrown if one or more requested scopes were declined by the server. | {ADALError here} |
| MsalIntuneAppProtectionPolicyRequiredException | Thrown if the resource has MAMCA protection policy enabled. | {ADALError here} |

@hamiltonha Ping on this Haley, we still have an empty section on this doc.

image

If you can provide an MSAL-to-ADAL mapping for me for the errors in the table above that section, I can update the doc with the new column in the table as proposed in https://github.com/MicrosoftDocs/azure-docs/issues/61007#issuecomment-674972923.

@mmacy acked - will get to it shortly

@samsil This section has been populated and now appears as such:


ADALError to MsalException translation

| If you're catching these errors in ADAL... | ...catch these MSAL exceptions: |
|--------------------------------------------------|---------------------------------------------------------------------|
| No equivalent ADALError | MsalArgumentException |
|

  • ADALError.ANDROIDKEYSTORE_FAILED
  • ADALError.AUTH_FAILED_USER_MISMATCH
  • ADALError.DECRYPTION_FAILED
  • ADALError.DEVELOPER_AUTHORITY_CAN_NOT_BE_VALIDED
  • ADALError.EVELOPER_AUTHORITY_IS_NOT_VALID_INSTANCE
  • ADALError.DEVELOPER_AUTHORITY_IS_NOT_VALID_URL
  • ADALError.DEVICE_CONNECTION_IS_NOT_AVAILABLE
  • ADALError.DEVICE_NO_SUCH_ALGORITHM
  • ADALError.ENCODING_IS_NOT_SUPPORTED
  • ADALError.ENCRYPTION_ERROR
  • ADALError.IO_EXCEPTION
  • ADALError.JSON_PARSE_ERROR
  • ADALError.NO_NETWORK_CONNECTION_POWER_OPTIMIZATION
  • ADALError.SOCKET_TIMEOUT_EXCEPTION
| MsalClientException |
| No equivalent ADALError | MsalDeclinedScopeException |
|
  • ADALError.APP_PACKAGE_NAME_NOT_FOUND
  • ADALError.BROKER_APP_VERIFICATION_FAILED
  • ADALError.PACKAGE_NAME_NOT_FOUND
| MsalException |
| No equivalent ADALError | MsalIntuneAppProtectionPolicyRequiredException |
|
  • ADALError.SERVER_ERROR
  • ADALError.SERVER_INVALID_REQUEST
| MsalServiceException |
|
  • ADALError.AUTH_REFRESH_FAILED_PROMPT_NOT_ALLOWED | MsalUiRequiredException
|
| No equivalent ADALError | MsalUserCancelException |

reassign:mmacy

Was this page helpful?
0 / 5 - 0 ratings

Related issues

behnam89 picture behnam89  Â·  3Comments

varma31 picture varma31  Â·  3Comments

DeepPuddles picture DeepPuddles  Â·  3Comments

spottedmahn picture spottedmahn  Â·  3Comments

paulmarshall picture paulmarshall  Â·  3Comments