public class OAuth2AuthenticationHandler extends Object implements AuthenticationHandler
| Modifier and Type | Field and Description |
|---|---|
static String |
REQ_ATT_LOCAL_USER |
static String |
REQ_ATT_OAUTH_DETAILS |
static String |
REQ_ATT_OAUTH_JSON |
| Constructor and Description |
|---|
OAuth2AuthenticationHandler(NonceProvider nonceProvider) |
| Modifier and Type | Method and Description |
|---|---|
void |
appendChallenges(Resource resource,
Request request,
List<String> challenges)
Create a challenge for this authentication method.
|
Object |
authenticate(Resource resource,
Request request)
Authenticate the details in the request for access to the given
resource.
|
boolean |
credentialsPresent(Request request)
Determine if there are login credentials present.
|
static Object |
getFoundLocalUser(Request r) |
static OAuth2Resource.OAuth2ProfileDetails |
getOAuthDetails(Request r) |
static String |
getOAuthDetailsJson(Request r)
Returns the profile details as json formatted text.
|
boolean |
isCompatible(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 false
|
OAuth2Resource.OAuth2ProfileDetails |
parse(OAuth2Resource oAuth2Resource,
Request request) |
boolean |
supports(Resource r,
Request request)
Returns true if this supports authenticating with the given Auth data
on the given resource.
|
public static final String REQ_ATT_LOCAL_USER
public static final String REQ_ATT_OAUTH_DETAILS
public static final String REQ_ATT_OAUTH_JSON
public OAuth2AuthenticationHandler(NonceProvider nonceProvider)
public static OAuth2Resource.OAuth2ProfileDetails getOAuthDetails(Request r)
public static String getOAuthDetailsJson(Request r)
r - public Object authenticate(Resource resource, Request request)
AuthenticationHandlerauthenticate in interface AuthenticationHandlerpublic boolean supports(Resource r, Request request)
AuthenticationHandlersupports in interface AuthenticationHandlerr - - the resource being accesspublic void appendChallenges(Resource resource, Request request, List<String> challenges)
AuthenticationHandlerappendChallenges in interface AuthenticationHandlerchallenges - - the list of challenges to append to, or not, as appropriatepublic boolean isCompatible(Resource resource, Request request)
AuthenticationHandlerisCompatible in interface AuthenticationHandlerpublic boolean credentialsPresent(Request request)
AuthenticationHandlercredentialsPresent in interface AuthenticationHandlerpublic OAuth2Resource.OAuth2ProfileDetails parse(OAuth2Resource oAuth2Resource, Request request) throws BadRequestException, org.apache.oltu.oauth2.common.exception.OAuthSystemException, org.apache.oltu.oauth2.common.exception.OAuthProblemException
BadRequestExceptionorg.apache.oltu.oauth2.common.exception.OAuthSystemExceptionorg.apache.oltu.oauth2.common.exception.OAuthProblemExceptionCopyright © 2021 McEvoy Software Ltd. All rights reserved.