Class AbstractBasicHttpAuthenticatorFactory
java.lang.Object
org.springframework.extensions.webscripts.AbstractBasicHttpAuthenticatorFactory
- All Implemented Interfaces:
ServletAuthenticatorFactory
public abstract class AbstractBasicHttpAuthenticatorFactory
extends Object
implements ServletAuthenticatorFactory
HTTP Basic Authentication
Abstract class that makes basic authentication easier to handle by managing the request headers and the base 64 decoding.
Extend this class and implement doAuthenticate and doAuthorize to authenticate and authorize against a specific user store.
- Author:
- Erik Winlof
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclassHTTP Basic Authentication -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionFactory's create method.abstract booleandoAuthenticate(String username, String password) Implement to authenticate against a specific user store.abstract booleandoAuthorize(String username, Description.RequiredAuthentication role) Implement to authorize against a specific user store.voidsetBasicRealm(String basicRealm) The basic realm.voidsetGuestUserName(String guestUserName) The guest username.
-
Field Details
-
guestUserName
-
basicRealm
-
-
Constructor Details
-
AbstractBasicHttpAuthenticatorFactory
public AbstractBasicHttpAuthenticatorFactory()
-
-
Method Details
-
create
Factory's create method.- Specified by:
createin interfaceServletAuthenticatorFactory- Parameters:
req- The webscript requestres- THe webscript response- Returns:
- A BasicHttpAuthenticator instance
-
doAuthenticate
Implement to authenticate against a specific user store.- Parameters:
username- The usernamepassword- The password- Returns:
- Shall return true if authentication was successful
-
doAuthorize
Implement to authorize against a specific user store.- Parameters:
username- The usernamerole- The role that the user MUST have- Returns:
- Shall return true if the user has the given role
-
setGuestUserName
The guest username.- Parameters:
guestUserName- The guest username
-
setBasicRealm
The basic realm.- Parameters:
basicRealm- The basic realm
-