Package org.trellisldp.jwt
Class WebIdSecurityContext
- java.lang.Object
-
- org.trellisldp.jwt.WebIdSecurityContext
-
- All Implemented Interfaces:
SecurityContext
public class WebIdSecurityContext extends Object implements SecurityContext
A WebId-enabled SecurityContext implementation.
-
-
Field Summary
-
Fields inherited from interface javax.ws.rs.core.SecurityContext
BASIC_AUTH, CLIENT_CERT_AUTH, DIGEST_AUTH, FORM_AUTH
-
-
Constructor Summary
Constructors Constructor Description WebIdSecurityContext(SecurityContext delegate, org.eclipse.microprofile.jwt.JsonWebToken principal, Set<String> admins)
Create a WebID-based security context.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getAuthenticationScheme()
Principal
getUserPrincipal()
boolean
isSecure()
boolean
isUserInRole(String role)
-
-
-
Constructor Detail
-
WebIdSecurityContext
public WebIdSecurityContext(SecurityContext delegate, org.eclipse.microprofile.jwt.JsonWebToken principal, Set<String> admins)
Create a WebID-based security context.- Parameters:
delegate
- the security context delegateprincipal
- the principaladmins
- a list of admin users
-
-
Method Detail
-
getUserPrincipal
public Principal getUserPrincipal()
- Specified by:
getUserPrincipal
in interfaceSecurityContext
-
isSecure
public boolean isSecure()
- Specified by:
isSecure
in interfaceSecurityContext
-
getAuthenticationScheme
public String getAuthenticationScheme()
- Specified by:
getAuthenticationScheme
in interfaceSecurityContext
-
isUserInRole
public boolean isUserInRole(String role)
- Specified by:
isUserInRole
in interfaceSecurityContext
-
-