Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve Exception Handling and Add Unit Tests for API based Authentication #159

Merged
merged 2 commits into from
Nov 6, 2023

Conversation

dhaura
Copy link
Contributor

@dhaura dhaura commented Nov 3, 2023

Proposed changes in this pull request

  • Exceptions thrown by validateJWTToken() method are differentiated whether they are client or server exceptions and handheld accordingly.
  • Avoid possible null pointer exception by swapping the values used in equal check inside isTrustedTokenIssuer() method.
  • Add more unit tests into OpenIDConnectAuthenticatorTest and OIDCTokenValidationUtilTest classes in order to verify API based authentication functionality of the OIDC authenticator.
  • Bump framework version.

ErrorMessages.INVALID_JWT_TOKEN.getMessage());
} catch (IdentityOAuth2Exception e) {
throw new AuthenticationFailedException(ErrorMessages.JWT_TOKEN_VALIDATION_FAILED.getCode(),
ErrorMessages.JWT_TOKEN_VALIDATION_FAILED.getMessage(), e);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems the message's alias placeholder (%s) is not getting replaced

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This error message (JWT_TOKEN_VALIDATION_FAILED) refers to the string "JWT token validation Failed." which does not contain a place holder.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants