Package io.milton.http
Class AuthenticationService
java.lang.Object
io.milton.http.AuthenticationService
- Author:
- brad
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionAuthenticationService(List<AuthenticationHandler> authenticationHandlers) Creates a AuthenticationService using the given handlers. -
Method Summary
Modifier and TypeMethodDescriptionauthenticate(Resource resource, Request request) Looks for an AuthenticationHandler which supports the given resource and authorization header, and then returns the result of that handler's authenticate method.booleanauthenticateDetailsPresent(Request request) Determine if there are any credentials present.booleancanUseExternalAuth(Resource resource, Request request) Determine if we can use external identify providers to authenticate this requestgetChallenges(Resource resource, Request request) Generates a list of http authentication challenges, one for each supported authentication method, to be sent to the client.booleanvoidsetDisableExternal(boolean disableExternal) voidsetExternalIdentityProviders(List<ExternalIdentityProvider> externalIdentityProviders)
-
Field Details
-
ATT_AUTH_STATUS
- See Also:
-
ATT_AUTH_CALLED
- See Also:
-
-
Constructor Details
-
AuthenticationService
Creates a AuthenticationService using the given handlers. Use this if you don't want the default of a BasicAuthHandler and a DigestAuthenticationHandler- Parameters:
authenticationHandlers-
-
-
Method Details
-
authenticate
Looks for an AuthenticationHandler which supports the given resource and authorization header, and then returns the result of that handler's authenticate method. Returns null if no handlers support the request Caches results so can be called multiple times in one request without performacne overhead- Parameters:
resource-request-- Returns:
- - null if no authentication was attempted. Otherwise, an AuthStatus object containing the Auth object and a boolean indicating whether the login succeeded
-
getChallenges
Generates a list of http authentication challenges, one for each supported authentication method, to be sent to the client.- Parameters:
resource- - the resoruce being requestedrequest- - the current request- Returns:
- - a list of http challenges
-
getAuthenticationHandlers
-
getExternalIdentityProviders
-
setExternalIdentityProviders
-
isDisableExternal
public boolean isDisableExternal() -
setDisableExternal
public void setDisableExternal(boolean disableExternal) -
canUseExternalAuth
Determine if we can use external identify providers to authenticate this request- Parameters:
resource-request-- Returns:
-
authenticateDetailsPresent
Determine if there are any credentials present. Note this does not check if the provided credentials are valid, only if they are available- Parameters:
request-- Returns:
-