Class AuthenticationService

java.lang.Object
io.milton.http.AuthenticationService

public class AuthenticationService extends Object
Author:
brad
  • Field Details

  • Constructor Details

    • AuthenticationService

      public AuthenticationService(List<AuthenticationHandler> authenticationHandlers)
      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

      public AuthenticationService.AuthStatus authenticate(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.

      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

      public List<String> getChallenges(Resource resource, Request request)
      Generates a list of http authentication challenges, one for each supported authentication method, to be sent to the client.
      Parameters:
      resource - - the resoruce being requested
      request - - the current request
      Returns:
      - a list of http challenges
    • getAuthenticationHandlers

      public List<AuthenticationHandler> getAuthenticationHandlers()
    • getExternalIdentityProviders

      public List<ExternalIdentityProvider> getExternalIdentityProviders()
    • setExternalIdentityProviders

      public void setExternalIdentityProviders(List<ExternalIdentityProvider> externalIdentityProviders)
    • isDisableExternal

      public boolean isDisableExternal()
    • setDisableExternal

      public void setDisableExternal(boolean disableExternal)
    • canUseExternalAuth

      public boolean canUseExternalAuth(Resource resource, Request request)
      Determine if we can use external identify providers to authenticate this request
      Parameters:
      resource -
      request -
      Returns:
    • authenticateDetailsPresent

      public boolean authenticateDetailsPresent(Request request)
      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: