Package org.trellisldp.oauth
Class OAuthFilter
- java.lang.Object
-
- org.trellisldp.oauth.OAuthFilter
-
- All Implemented Interfaces:
ContainerRequestFilter
@Provider @Priority(1000) public class OAuthFilter extends Object implements ContainerRequestFilter
An OAuth authentication filter that processes JWT-based Bearer tokens from an Authorization HTTP header.
-
-
Field Summary
Fields Modifier and Type Field Description static StringCONFIG_AUTH_ADMIN_USERSThe configuration key controlling the list of of admin WebID values.static StringCONFIG_AUTH_OAUTH_JWK_URLThe configuration key controlling the OAuth JWK URL.static StringCONFIG_AUTH_OAUTH_KEYSTORE_CREDENTIALSThe configuration key controlling the OAuth Keystore credentials.static StringCONFIG_AUTH_OAUTH_KEYSTORE_IDSThe configuration key controlling the OAuth Keystore ids.static StringCONFIG_AUTH_OAUTH_KEYSTORE_PATHThe configuration key controlling the OAuth Keystore path.static StringCONFIG_AUTH_OAUTH_SHARED_SECRETThe configuration key controlling the OAuth HMAC shared secret.static StringCONFIG_AUTH_REALMThe configuration key controlling the realm used in a WWW-Authenticate header, or 'trellis' by default.static StringSCHEMEThe authentication scheme used by this module.
-
Constructor Summary
Constructors Constructor Description OAuthFilter()Create an OAuth filter.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidfilter(ContainerRequestContext requestContext)voidsetAdmins(Set<String> admins)Set the admin users.voidsetAuthenticator(Authenticator authenticator)Set the authenticator to use.voidsetChallenge(String challenge)Set the challenge text.
-
-
-
Field Detail
-
CONFIG_AUTH_ADMIN_USERS
public static final String CONFIG_AUTH_ADMIN_USERS
The configuration key controlling the list of of admin WebID values.- See Also:
- Constant Field Values
-
CONFIG_AUTH_REALM
public static final String CONFIG_AUTH_REALM
The configuration key controlling the realm used in a WWW-Authenticate header, or 'trellis' by default.- See Also:
- Constant Field Values
-
CONFIG_AUTH_OAUTH_KEYSTORE_PATH
public static final String CONFIG_AUTH_OAUTH_KEYSTORE_PATH
The configuration key controlling the OAuth Keystore path.- See Also:
- Constant Field Values
-
CONFIG_AUTH_OAUTH_KEYSTORE_CREDENTIALS
public static final String CONFIG_AUTH_OAUTH_KEYSTORE_CREDENTIALS
The configuration key controlling the OAuth Keystore credentials.- See Also:
- Constant Field Values
-
CONFIG_AUTH_OAUTH_KEYSTORE_IDS
public static final String CONFIG_AUTH_OAUTH_KEYSTORE_IDS
The configuration key controlling the OAuth Keystore ids.- See Also:
- Constant Field Values
-
CONFIG_AUTH_OAUTH_SHARED_SECRET
public static final String CONFIG_AUTH_OAUTH_SHARED_SECRET
The configuration key controlling the OAuth HMAC shared secret.- See Also:
- Constant Field Values
-
CONFIG_AUTH_OAUTH_JWK_URL
public static final String CONFIG_AUTH_OAUTH_JWK_URL
The configuration key controlling the OAuth JWK URL.- See Also:
- Constant Field Values
-
SCHEME
public static final String SCHEME
The authentication scheme used by this module.- See Also:
- Constant Field Values
-
-
Method Detail
-
setAuthenticator
public void setAuthenticator(Authenticator authenticator)
Set the authenticator to use.- Parameters:
authenticator- the authenticator in use
-
setChallenge
public void setChallenge(String challenge)
Set the challenge text.- Parameters:
challenge- the challenge text
-
setAdmins
public void setAdmins(Set<String> admins)
Set the admin users.- Parameters:
admins- the admin users
-
filter
public void filter(ContainerRequestContext requestContext)
- Specified by:
filterin interfaceContainerRequestFilter
-
-