use of org.wildfly.security.auth.callback.AnonymousAuthorizationCallback in project keycloak by keycloak.
the class ElytronHttpFacade method authenticationCompleteAnonymous.
void authenticationCompleteAnonymous() {
try {
AnonymousAuthorizationCallback anonymousAuthorizationCallback = new AnonymousAuthorizationCallback(null);
callbackHandler.handle(new Callback[] { anonymousAuthorizationCallback });
if (anonymousAuthorizationCallback.isAuthorized()) {
callbackHandler.handle(new Callback[] { AuthenticationCompleteCallback.SUCCEEDED, new SecurityIdentityCallback() });
request.authenticationComplete(response -> response.forward(getRequest().getRelativePath()));
} else {
request.noAuthenticationInProgress(response -> response.forward(getRequest().getRelativePath()));
}
} catch (Exception e) {
throw new RuntimeException("Unexpected error processing callbacks during logout.", e);
}
}
Aggregations