Class OAuth1ServerFilter
java.lang.Object
org.glassfish.jersey.server.oauth1.OAuth1ServerFilter
- All Implemented Interfaces:
javax.ws.rs.container.ContainerRequestFilter
@Priority(1000)
class OAuth1ServerFilter
extends Object
implements javax.ws.rs.container.ContainerRequestFilter
OAuth request filter that filters all requests indicating in the Authorization
header they use OAuth. Checks if the incoming requests are properly authenticated
and populates the security context with the corresponding user principal and roles.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Pattern
Regular expression pattern for path to ignore.private final NonceManager
Manages and validates incoming nonces.private OAuth1Signature
private final boolean
private OAuth1Provider
OAuth Serverprivate javax.inject.Provider
<ExtendedUriInfo> OAuth protocol versions that are supported.private final String
Value to return in www-authenticate header when 401 response returned. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
filter
(javax.ws.rs.container.ContainerRequestContext request) private OAuth1SecurityContext
getSecurityContext
(javax.ws.rs.container.ContainerRequestContext request) private static boolean
private static OAuth1Exception
private OAuth1Exception
private static Pattern
private static String
requiredOAuthParam
(String value) private static String
supportedOAuthParam
(String value, Set<String> set) private boolean
verifySignature
(OAuthServerRequest osr, OAuth1Parameters params, OAuth1Secrets secrets)
-
Field Details
-
provider
OAuth Server -
nonces
Manages and validates incoming nonces. -
wwwAuthenticateHeader
Value to return in www-authenticate header when 401 response returned. -
versions
OAuth protocol versions that are supported. -
ignorePathPattern
Regular expression pattern for path to ignore. -
oAuth1Signature
-
uriInfo
-
optional
private final boolean optional
-
-
Constructor Details
-
OAuth1ServerFilter
@Inject public OAuth1ServerFilter(javax.ws.rs.core.Configuration rc) Create a new filter.- Parameters:
rc
- Resource config.
-
-
Method Details
-
filter
- Specified by:
filter
in interfacejavax.ws.rs.container.ContainerRequestFilter
- Throws:
IOException
-
getSecurityContext
private OAuth1SecurityContext getSecurityContext(javax.ws.rs.container.ContainerRequestContext request) throws OAuth1Exception - Throws:
OAuth1Exception
-
requiredOAuthParam
- Throws:
OAuth1Exception
-
supportedOAuthParam
- Throws:
OAuth1Exception
-
pattern
-
match
-
verifySignature
private boolean verifySignature(OAuthServerRequest osr, OAuth1Parameters params, OAuth1Secrets secrets) -
newBadRequestException
- Throws:
OAuth1Exception
-
newUnauthorizedException
- Throws:
OAuth1Exception
-