Class BasicAuthSecurityContext
java.lang.Object
io.servicetalk.http.security.auth.basic.jersey.BasicAuthSecurityContext
- All Implemented Interfaces:
javax.ws.rs.core.SecurityContext
public final class BasicAuthSecurityContext
extends Object
implements javax.ws.rs.core.SecurityContext
A generic
SecurityContext
that wraps a user provided Principal
,
and which is designed for the SecurityContext.BASIC_AUTH
authentication scheme.-
Field Summary
Fields inherited from interface javax.ws.rs.core.SecurityContext
BASIC_AUTH, CLIENT_CERT_AUTH, DIGEST_AUTH, FORM_AUTH
-
Constructor Summary
ConstructorsConstructorDescriptionBasicAuthSecurityContext
(Principal principal, boolean secure) Creates a new instance, which has no support for roles.BasicAuthSecurityContext
(Principal principal, boolean secure, Predicate<String> userInRolePredicate) Creates a new instance. -
Method Summary
-
Constructor Details
-
BasicAuthSecurityContext
Creates a new instance, which has no support for roles.- Parameters:
principal
- the wrappedPrincipal
secure
-true
if the request was received over a secure channel- See Also:
-
SecurityContext.isSecure()
-
BasicAuthSecurityContext
public BasicAuthSecurityContext(Principal principal, boolean secure, @Nullable Predicate<String> userInRolePredicate) Creates a new instance.
-
-
Method Details
-
getUserPrincipal
- Specified by:
getUserPrincipal
in interfacejavax.ws.rs.core.SecurityContext
-
isUserInRole
- Specified by:
isUserInRole
in interfacejavax.ws.rs.core.SecurityContext
-
isSecure
public boolean isSecure()- Specified by:
isSecure
in interfacejavax.ws.rs.core.SecurityContext
-
getAuthenticationScheme
- Specified by:
getAuthenticationScheme
in interfacejavax.ws.rs.core.SecurityContext
-