Class OAuth1SecurityContext
- java.lang.Object
-
- org.glassfish.jersey.server.oauth1.OAuth1SecurityContext
-
- All Implemented Interfaces:
javax.ws.rs.core.SecurityContext
class OAuth1SecurityContext extends java.lang.Object implements javax.ws.rs.core.SecurityContextSecurity request that gets injected into the context by the OAuth filter based on the access token attached to the request.
-
-
Field Summary
Fields Modifier and Type Field Description private OAuth1Consumerconsumerprivate booleanisSecureprivate OAuth1Tokentoken
-
Constructor Summary
Constructors Constructor Description OAuth1SecurityContext(OAuth1Consumer consumer, boolean isSecure)Create a new OAuth security context fromconsumer.OAuth1SecurityContext(OAuth1Token token, boolean isSecure)Create a new OAuth security context fromAccess Token.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetAuthenticationScheme()java.security.PrincipalgetUserPrincipal()booleanisSecure()booleanisUserInRole(java.lang.String string)
-
-
-
Field Detail
-
consumer
private final OAuth1Consumer consumer
-
token
private final OAuth1Token token
-
isSecure
private final boolean isSecure
-
-
Constructor Detail
-
OAuth1SecurityContext
public OAuth1SecurityContext(OAuth1Consumer consumer, boolean isSecure)
Create a new OAuth security context fromconsumer.- Parameters:
consumer- OAuth consumer for which the context will be created.isSecure-trueif the request is secured over SSL (HTTPS).
-
OAuth1SecurityContext
public OAuth1SecurityContext(OAuth1Token token, boolean isSecure)
Create a new OAuth security context fromAccess Token.- Parameters:
token- Access Token.isSecure-trueif the request is secured over SSL (HTTPS).
-
-
Method Detail
-
getUserPrincipal
public java.security.Principal getUserPrincipal()
- Specified by:
getUserPrincipalin interfacejavax.ws.rs.core.SecurityContext
-
isUserInRole
public boolean isUserInRole(java.lang.String string)
- Specified by:
isUserInRolein interfacejavax.ws.rs.core.SecurityContext
-
isSecure
public boolean isSecure()
- Specified by:
isSecurein interfacejavax.ws.rs.core.SecurityContext
-
getAuthenticationScheme
public java.lang.String getAuthenticationScheme()
- Specified by:
getAuthenticationSchemein interfacejavax.ws.rs.core.SecurityContext
-
-