Package org.trellisldp.auth.basic
Class BasicAuthFilter
- java.lang.Object
-
- org.trellisldp.auth.basic.BasicAuthFilter
-
- All Implemented Interfaces:
ContainerRequestFilter
@Provider @Priority(1000) public class BasicAuthFilter extends Object implements ContainerRequestFilter
A basic authentication filter using an Authorization HTTP header.
-
-
Field Summary
Fields Modifier and Type Field Description static String
CONFIG_AUTH_ADMIN_USERS
The configuration key controlling the list of of admin WebID values.static String
CONFIG_AUTH_BASIC_CREDENTIALS
The configuration key controlling the location of the basic auth credentials file.static String
CONFIG_AUTH_REALM
The configuration key controlling the realm used in a WWW-Authenticate header, or 'trellis' by default.
-
Constructor Summary
Constructors Constructor Description BasicAuthFilter()
Create a basic auth filter.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
filter(ContainerRequestContext requestContext)
void
setAdmins(Set<String> admins)
Set the admin users.void
setChallenge(String challenge)
Set the challenge response on auth failures.void
setFile(File file)
Set the credentials file.
-
-
-
Field Detail
-
CONFIG_AUTH_BASIC_CREDENTIALS
public static final String CONFIG_AUTH_BASIC_CREDENTIALS
The configuration key controlling the location of the basic auth credentials file.- 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_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
-
-
Method Detail
-
setFile
public void setFile(File file)
Set the credentials file.- Parameters:
file
- the credentials file
-
setChallenge
public void setChallenge(String challenge)
Set the challenge response on auth failures.- Parameters:
challenge
- the challenge response
-
setAdmins
public void setAdmins(Set<String> admins)
Set the admin users.- Parameters:
admins
- the admin users
-
filter
public void filter(ContainerRequestContext requestContext)
- Specified by:
filter
in interfaceContainerRequestFilter
-
-