Package org.apache.shiro.web.jaxrs
Class ShiroSecurityContext
- java.lang.Object
-
- org.apache.shiro.web.jaxrs.ShiroSecurityContext
-
- All Implemented Interfaces:
javax.ws.rs.core.SecurityContext
public class ShiroSecurityContext extends Object implements javax.ws.rs.core.SecurityContext
A Shiro basedSecurityContext
that exposes the current ShiroSubject
as aPrincipal
. TheisUserInRole(String)
method returns the result ofSubject.hasRole(String)
.- Since:
- 1.4
-
-
Constructor Summary
Constructors Constructor Description ShiroSecurityContext(javax.ws.rs.container.ContainerRequestContext containerRequestContext)
-
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
-
ShiroSecurityContext
public ShiroSecurityContext(javax.ws.rs.container.ContainerRequestContext containerRequestContext)
-
-
Method Detail
-
getUserPrincipal
public Principal getUserPrincipal()
- Specified by:
getUserPrincipal
in interfacejavax.ws.rs.core.SecurityContext
-
isUserInRole
public boolean isUserInRole(String role)
- Specified by:
isUserInRole
in interfacejavax.ws.rs.core.SecurityContext
-
isSecure
public boolean isSecure()
- Specified by:
isSecure
in interfacejavax.ws.rs.core.SecurityContext
-
getAuthenticationScheme
public String getAuthenticationScheme()
- Specified by:
getAuthenticationScheme
in interfacejavax.ws.rs.core.SecurityContext
-
-