Contact Us 1-800-596-4880

Troubleshooting OAuth2 Provider Module - Mule 4

To troubleshoot OAuth2 Provider module, become familiar with the information about enabling verbose logging and interpreting commonly throw messages.

Enable Verbose Logging

To get a better understanding of why an application’s interaction with OAuth2 Provider module is failing, temporarily enable verbose logging for the module.

Remember to always disable the enhanced verbosity after troubleshooting, because it affects your Mule application performance.

To enable verbose logging in the configuration file:

  1. Access Anypoint Studio and navigate to the Package Explorer view.

  2. Open your application’s project name.

  3. Open the src/main/resources path folder.

  4. Open the log4j2.xml file inside the folder.

  5. Add an <AsyncLogger> tag inside the <Loggers> tag:

    			<Loggers>
    				...
    				<AsyncLogger name="org.mule.extension.oauth2" level="DEBUG"/>
    				...
    			</Loggers>
  6. Save your application changes.

  7. Click the project name in Package Explorer and then click Run > Run As > Mule Application.

Understand Common Throws

Here is a list of common thrown messages and how to interpret them:

  • OAUTH2-PROVIDER:CLIENT_ALREADY_EXISTS

    A client already exists with the same client ID, and the *Fail If Present* field is set to `true`.
  • OAUTH2-PROVIDER:INVALID_CONFIGURATION

    The provided parameters are invalid, for example, the *Authorized Grant Types* field of `AUTHORIZATION_CODE` does not have a redirect URI.
  • OAUTH2-PROVIDER:NO_SUCH_CLIENT

    The client to delete does not exist.
  • OAUTH2-PROVIDER:INVALID_TOKEN

    The token to revoke is invalid.
  • OAUTH2-PROVIDER:TOKEN_UNAUTHORIZED

    The token is invalid or there are missing or wrong fields set in the validation.
  • OAUTH2-PROVIDER:OAUTH_SERVER_SECURITY

    OAuth2 Provider module throws this error when is unable to identify its reason.
View on GitHub