<Loggers>
...
<AsyncLogger name="org.mule.extension.oauth2" level="DEBUG"/>
...
</Loggers>
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:
-
Access Anypoint Studio and navigate to the Package Explorer view.
-
Open your application’s project name.
-
Open the
src/main/resources
path folder. -
Open the
log4j2.xml
file inside the folder. -
Add an
<AsyncLogger>
tag inside the<Loggers>
tag: -
Save your application changes.
-
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.