be.looorent.micronaut.security.DefaultSecurityContextFactory Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of keycloak-micronaut-adapter Show documentation
Show all versions of keycloak-micronaut-adapter Show documentation
Create API middleware to check Authorization headers against Keycloak
package be.looorent.micronaut.security;
import io.jsonwebtoken.Claims;
import javax.inject.Singleton;
/**
* Default implementation to create an empty {@link SecurityContext}.
* To override this implementation, @{@link io.micronaut.context.annotation.Replaces} must be set on
* the replacement implementation.
* @author Lorent Lempereur - [email protected]
*/
@Singleton
public class DefaultSecurityContextFactory implements SecurityContextFactory {
@Override
public SecurityContext createSecurityContext(Claims tokenContent) {
return new SecurityContext() {};
}
}