Class BasicHttpSecuritySource
- java.lang.Object
-
- net.officefloor.web.spi.security.impl.AbstractHttpSecuritySource<HttpAuthentication<java.lang.Void>,HttpAccessControl,java.lang.Void,BasicHttpSecuritySource.Dependencies,None>
-
- net.officefloor.web.security.scheme.BasicHttpSecuritySource
-
- All Implemented Interfaces:
HttpSecuritySource<HttpAuthentication<java.lang.Void>,HttpAccessControl,java.lang.Void,BasicHttpSecuritySource.Dependencies,None>
public class BasicHttpSecuritySource extends AbstractHttpSecuritySource<HttpAuthentication<java.lang.Void>,HttpAccessControl,java.lang.Void,BasicHttpSecuritySource.Dependencies,None>
HttpSecuritySource
forBasic
HTTP security.- Author:
- Daniel Sagenschneider
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
BasicHttpSecuritySource.BasicCredentials
Decoded credentials.static class
BasicHttpSecuritySource.Dependencies
Dependency keys.-
Nested classes/interfaces inherited from class net.officefloor.web.spi.security.impl.AbstractHttpSecuritySource
AbstractHttpSecuritySource.DependencyLabeller, AbstractHttpSecuritySource.Labeller, AbstractHttpSecuritySource.MetaDataContext<A,AC extends java.io.Serializable,C,O extends java.lang.Enum<O>,F extends java.lang.Enum<F>>, AbstractHttpSecuritySource.SpecificationContext
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
AUTHENTICATION_SCHEME_BASIC
Authentication scheme Basic.static java.lang.String
PROPERTY_REALM
Name of property to retrieve the realm being secured.-
Fields inherited from class net.officefloor.web.spi.security.impl.AbstractHttpSecuritySource
UTF_8
-
-
Constructor Summary
Constructors Constructor Description BasicHttpSecuritySource()
-
Method Summary
-
Methods inherited from class net.officefloor.web.spi.security.impl.AbstractHttpSecuritySource
getSpecification, init, start, stop
-
-
-
-
Field Detail
-
AUTHENTICATION_SCHEME_BASIC
public static final java.lang.String AUTHENTICATION_SCHEME_BASIC
Authentication scheme Basic.- See Also:
- Constant Field Values
-
PROPERTY_REALM
public static final java.lang.String PROPERTY_REALM
Name of property to retrieve the realm being secured.- See Also:
- Constant Field Values
-
-
Method Detail
-
createAuthorizationHttpHeaderValue
public static java.lang.String createAuthorizationHttpHeaderValue(java.lang.String username, java.lang.String password)
Creates theAuthorization
HttpHeader
value.- Parameters:
username
- Username.password
- Password.- Returns:
Authorization
HttpHeader
value.
-
getBasicCredentials
public static BasicHttpSecuritySource.BasicCredentials getBasicCredentials(HttpRequest request)
Obtains theBasicHttpSecuritySource.BasicCredentials
from theHttpRequest
.- Parameters:
request
-HttpRequest
.- Returns:
BasicHttpSecuritySource.BasicCredentials
ornull
if not available.
-
getBasicCredentials
public static BasicHttpSecuritySource.BasicCredentials getBasicCredentials(java.lang.String basicParameters)
Obtains theBasicHttpSecuritySource.BasicCredentials
from thebasic
parameters.- Parameters:
basicParameters
-basic
parameters.- Returns:
BasicHttpSecuritySource.BasicCredentials
.
-
loadSpecification
protected void loadSpecification(AbstractHttpSecuritySource.SpecificationContext context)
Description copied from class:AbstractHttpSecuritySource
Overridden to load specifications.- Specified by:
loadSpecification
in classAbstractHttpSecuritySource<HttpAuthentication<java.lang.Void>,HttpAccessControl,java.lang.Void,BasicHttpSecuritySource.Dependencies,None>
- Parameters:
context
- Specifications.
-
loadMetaData
protected void loadMetaData(AbstractHttpSecuritySource.MetaDataContext<HttpAuthentication<java.lang.Void>,HttpAccessControl,java.lang.Void,BasicHttpSecuritySource.Dependencies,None> context) throws java.lang.Exception
Description copied from class:AbstractHttpSecuritySource
Overridden to load meta-data.- Specified by:
loadMetaData
in classAbstractHttpSecuritySource<HttpAuthentication<java.lang.Void>,HttpAccessControl,java.lang.Void,BasicHttpSecuritySource.Dependencies,None>
- Parameters:
context
- Meta-data.- Throws:
java.lang.Exception
- If fails to load the meta-data.
-
sourceHttpSecurity
public HttpSecurity<HttpAuthentication<java.lang.Void>,HttpAccessControl,java.lang.Void,BasicHttpSecuritySource.Dependencies,None> sourceHttpSecurity(HttpSecurityContext context) throws HttpException
Description copied from interface:HttpSecuritySource
Sources theHttpSecurity
.- Parameters:
context
-HttpSecurity
.- Returns:
HttpSecurity
.- Throws:
HttpException
- If fails to source theHttpSecurity
.
-
-