public class SecurityContextInjectee extends Object implements javax.ws.rs.core.SecurityContext
SecurityContext instance.
This wrapper must be used and cannot be replaced by ReferencingFactory.
The reason is that security context can be set
many times during the request processing. However, the HK2 proxy caches
the first value that is injected. So, if for example any filter injects
security context, then this security context will be cached and it will
never be replaced for the same request. On the other hand, HK2 should
probably cache the first value returned in the request scope to prevent
that two subsequent calls done on the proxy will be forwarded to different
object if the the object changes in the meantime.
| Constructor and Description |
|---|
SecurityContextInjectee(javax.ws.rs.container.ContainerRequestContext requestContext) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object that) |
String |
getAuthenticationScheme() |
Principal |
getUserPrincipal() |
int |
hashCode() |
boolean |
isSecure() |
boolean |
isUserInRole(String role) |
@Inject public SecurityContextInjectee(javax.ws.rs.container.ContainerRequestContext requestContext)
public Principal getUserPrincipal()
getUserPrincipal in interface javax.ws.rs.core.SecurityContextpublic boolean isUserInRole(String role)
isUserInRole in interface javax.ws.rs.core.SecurityContextpublic boolean isSecure()
isSecure in interface javax.ws.rs.core.SecurityContextpublic String getAuthenticationScheme()
getAuthenticationScheme in interface javax.ws.rs.core.SecurityContextCopyright © 2007-2014, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.