Package io.milton.http.http11.auth
Class OAuth2AuthenticationHandler
java.lang.Object
io.milton.http.http11.auth.OAuth2AuthenticationHandler
- All Implemented Interfaces:
AuthenticationHandler
- Author:
- Lee YOU
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidappendChallenges(Resource resource, Request request, List<String> challenges) Create a challenge for this authentication method.authenticate(Resource resource, Request request) Authenticate the details in the request for access to the given resource.booleancredentialsPresent(Request request) Determine if there are login credentials present.static Objectstatic StringReturns the profile details as json formatted text.booleanisCompatible(Resource resource, Request request) 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 falseparse(OAuth2Resource oAuth2Resource, Request request) booleanReturns true if this supports authenticating with the given Auth data on the given resource.
-
Field Details
-
REQ_ATT_LOCAL_USER
- See Also:
-
REQ_ATT_OAUTH_DETAILS
- See Also:
-
REQ_ATT_OAUTH_JSON
- See Also:
-
-
Constructor Details
-
OAuth2AuthenticationHandler
-
-
Method Details
-
getFoundLocalUser
-
getOAuthDetails
-
getOAuthDetailsJson
Returns the profile details as json formatted text.- Parameters:
r-- Returns:
-
authenticate
Description copied from interface:AuthenticationHandlerAuthenticate the details in the request for access to the given resource.- Specified by:
authenticatein interfaceAuthenticationHandler- Returns:
-
supports
Description copied from interface:AuthenticationHandlerReturns 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:
supportsin interfaceAuthenticationHandler- Parameters:
r- - the resource being access- Returns:
-
appendChallenges
Description copied from interface:AuthenticationHandlerCreate 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:
appendChallengesin interfaceAuthenticationHandlerchallenges- - the list of challenges to append to, or not, as appropriate
-
isCompatible
Description copied from interface:AuthenticationHandlerReturns 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:
isCompatiblein interfaceAuthenticationHandler- Returns:
- - true if this can authenticate the resource, and it should issue a http challenge
-
credentialsPresent
Description copied from interface:AuthenticationHandlerDetermine if there are login credentials present. Should not attempt to validate credentials. Should only determine if something has been provided- Specified by:
credentialsPresentin interfaceAuthenticationHandler- 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:
BadRequestExceptionorg.apache.oltu.oauth2.common.exception.OAuthSystemExceptionorg.apache.oltu.oauth2.common.exception.OAuthProblemException
-