Skip to content

Commit

Permalink
refactor back
Browse files Browse the repository at this point in the history
  • Loading branch information
strehle committed Aug 9, 2023
1 parent e35ac38 commit 45a6c41
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,12 @@ public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain)
if (clientAuth.isAuthenticated()) {
// Ensure the OAuth2Authentication is authenticated
authorizationRequest.setApproved(true);
String clientAuthentication = UaaSecurityContextUtils.getClientAuthenticationMethod(clientAuth);
String clientAuthentication = null;
if (clientAuth instanceof OAuth2Authentication) {
clientAuthentication = UaaSecurityContextUtils.getClientAuthenticationMethod(clientAuth);
} else if (clientAuth.getDetails() instanceof UaaAuthenticationDetails) {
clientAuthentication = ((UaaAuthenticationDetails) clientAuth.getDetails()).getAuthenticationMethod();
}
if (clientAuthentication != null) {
authorizationRequest.getExtensions().put(ClaimConstants.CLIENT_AUTH_METHOD, clientAuthentication);
}
Expand Down

0 comments on commit 45a6c41

Please sign in to comment.