|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.glassfish.jersey.internal.inject.SecurityContextInjectee
public class SecurityContextInjectee
Proxiable wrapper for request scoped 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.
| Field Summary |
|---|
| Fields inherited from interface javax.ws.rs.core.SecurityContext |
|---|
BASIC_AUTH, CLIENT_CERT_AUTH, DIGEST_AUTH, FORM_AUTH |
| Constructor Summary | |
|---|---|
SecurityContextInjectee(ContainerRequestContext requestContext)
|
|
| Method Summary | |
|---|---|
boolean |
equals(Object that)
|
String |
getAuthenticationScheme()
Returns the string value of the authentication scheme used to protect the resource. |
Principal |
getUserPrincipal()
Returns a java.security.Principal object containing the
name of the current authenticated user. |
int |
hashCode()
|
boolean |
isSecure()
Returns a boolean indicating whether this request was made using a secure channel, such as HTTPS. |
boolean |
isUserInRole(String role)
Returns a boolean indicating whether the authenticated user is included in the specified logical "role". |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
@Inject public SecurityContextInjectee(ContainerRequestContext requestContext)
| Method Detail |
|---|
public Principal getUserPrincipal()
SecurityContextjava.security.Principal object containing the
name of the current authenticated user. If the user
has not been authenticated, the method returns null.
getUserPrincipal in interface SecurityContextjava.security.Principal containing the name
of the user making this request; null if the user has not been
authenticatedpublic boolean isUserInRole(String role)
SecurityContextfalse.
isUserInRole in interface SecurityContextrole - a String specifying the name of the role
boolean indicating whether the user making
the request belongs to a given role; false if the user
has not been authenticatedpublic boolean isSecure()
SecurityContext
isSecure in interface SecurityContexttrue if the request was made using a secure
channel, false otherwisepublic String getAuthenticationScheme()
SecurityContext
getAuthenticationScheme in interface SecurityContextpublic int hashCode()
hashCode in class Objectpublic boolean equals(Object that)
equals in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||