Class OAuth2AuthenticationHandler

java.lang.Object
io.milton.http.http11.auth.OAuth2AuthenticationHandler
All Implemented Interfaces:
AuthenticationHandler

public class OAuth2AuthenticationHandler extends Object implements AuthenticationHandler
Author:
Lee YOU
  • Field Details

  • Constructor Details

    • OAuth2AuthenticationHandler

      public OAuth2AuthenticationHandler(NonceProvider nonceProvider)
  • Method Details

    • getFoundLocalUser

      public static Object getFoundLocalUser(Request r)
    • getOAuthDetails

      public static OAuth2Resource.OAuth2ProfileDetails getOAuthDetails(Request r)
    • getOAuthDetailsJson

      public static String getOAuthDetailsJson(Request r)
      Returns the profile details as json formatted text.
      Parameters:
      r -
      Returns:
    • authenticate

      public Object authenticate(Resource resource, Request request)
      Description copied from interface: AuthenticationHandler
      Authenticate the details in the request for access to the given resource.
      Specified by:
      authenticate in interface AuthenticationHandler
      Returns:
    • supports

      public boolean supports(Resource r, Request request)
      Description copied from interface: AuthenticationHandler
      Returns true if this supports authenticating with the given Auth data on the given resource. Only the first AuthenticationHandler which returns true for supports will be used for authentication. Ie supports implementations should be mutually exclusive
      Specified by:
      supports in interface AuthenticationHandler
      Parameters:
      r - - the resource being access
      Returns:
    • appendChallenges

      public void appendChallenges(Resource resource, Request request, List<String> challenges)
      Description copied from interface: AuthenticationHandler
      Create a challenge for this authentication method. This should be completely formatted as per http://tools.ietf.org/html/rfc2617 and appended to the given list of challenges. It is allowable to append more then one challenge if appropriate
      Specified by:
      appendChallenges in interface AuthenticationHandler
      challenges - - the list of challenges to append to, or not, as appropriate
    • isCompatible

      public boolean isCompatible(Resource resource, Request request)
      Description copied from interface: AuthenticationHandler
      Returns true if this authentication handler is compatible with the given resource This is used when authorisation has failed, in generating challenge responses If you don't want to add a challenge response, return false
      Specified by:
      isCompatible in interface AuthenticationHandler
      Returns:
      - true if this can authenticate the resource, and it should issue a http challenge
    • credentialsPresent

      public boolean credentialsPresent(Request request)
      Description copied from interface: AuthenticationHandler
      Determine if there are login credentials present. Should not attempt to validate credentials. Should only determine if something has been provided
      Specified by:
      credentialsPresent in interface AuthenticationHandler
      Returns:
    • parse

      public OAuth2Resource.OAuth2ProfileDetails parse(OAuth2Resource oAuth2Resource, Request request) throws BadRequestException, org.apache.oltu.oauth2.common.exception.OAuthSystemException, org.apache.oltu.oauth2.common.exception.OAuthProblemException
      Throws:
      BadRequestException
      org.apache.oltu.oauth2.common.exception.OAuthSystemException
      org.apache.oltu.oauth2.common.exception.OAuthProblemException