![JAR search and dependency download from the Maven repository](/logo.png)
de.ahus1.keycloak.dropwizard.UserAuthorizer Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of keycloak-dropwizard Show documentation
Show all versions of keycloak-dropwizard Show documentation
Add this module to integrate your Dropwizard application with
JBoss Keycloak.
The newest version!
package de.ahus1.keycloak.dropwizard;
import io.dropwizard.auth.Authorizer;
import jakarta.ws.rs.ForbiddenException;
import jakarta.ws.rs.container.ContainerRequestContext;
import org.checkerframework.checker.nullness.qual.Nullable;
public class UserAuthorizer implements Authorizer {
@Override
public boolean authorize(User user, String role, @Nullable ContainerRequestContext requestContext) {
try {
user.checkUserInRole(role);
return true;
} catch (ForbiddenException e) {
return false;
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy