public class CasOAuthWrapperClient extends BaseOAuth20Client<CasOAuthWrapperProfile>
This class is the OAuth client to authenticate users on CAS servers using OAuth wrapper.
The url of the OAuth endpoint of the CAS server must be set by using the setCasOAuthUrl(String)
method.
It returns a CasOAuthWrapperProfile
.
More information at https://wiki.jasig.org/display/CASUM/OAuth+server+support
logger, OAUTH_CODE
service
ATTEMPTED_AUTHENTICATION_SUFFIX, callbackUrl, callbackUrlResolver
Constructor and Description |
---|
CasOAuthWrapperClient() |
CasOAuthWrapperClient(String key,
String secret,
String casOAuthUrl) |
Modifier and Type | Method and Description |
---|---|
protected CasOAuthWrapperProfile |
extractUserProfile(String body)
Extract the user profile from the response (JSON, XML...) of the profile url.
|
protected com.github.scribejava.core.builder.api.BaseApi<com.github.scribejava.core.oauth.OAuth20Service> |
getApi()
Define the OAuth API for this client.
|
String |
getCasOAuthUrl() |
protected String |
getProfileUrl(com.github.scribejava.core.model.OAuth2AccessToken accessToken)
Retrieve the url of the profile of the authenticated user for the provider.
|
protected boolean |
hasOAuthGrantType()
Whether the grant type must be added.
|
protected void |
internalInit(WebContext context)
Internal initialization of the object.
|
boolean |
isSpringSecurityCompliant() |
void |
setCasOAuthUrl(String casOAuthUrl) |
void |
setSpringSecurityCompliant(boolean springSecurityCompliant) |
addAccessTokenToProfile, getAccessToken, getOAuthCredentials, retrieveAuthorizationUrl, signRequest
buildOAuthConfig, createOAuthRequest, getConnectTimeout, getKey, getOAuthScope, getReadTimeout, getResponseType, getSecret, hasBeenCancelled, isTokenAsHeader, retrieveCredentials, retrieveRedirectAction, retrieveUserProfile, retrieveUserProfileFromToken, sendRequestForData, setConnectTimeout, setKey, setReadTimeout, setResponseType, setSecret, setTokenAsHeader
computeFinalCallbackUrl, getAjaxRequestResolver, getCallbackUrl, getCallbackUrlResolver, getCredentials, getRedirectAction, getStateParameter, isIncludeClientNameInCallbackUrl, redirect, setAjaxRequestResolver, setCallbackUrl, setCallbackUrlResolver, setIncludeClientNameInCallbackUrl
addAuthorizationGenerator, getAuthorizationGenerators, getName, getUserProfile, setAuthorizationGenerator, setAuthorizationGenerators, setAuthorizationGenerators, setName, toString
init, reinit
protected void internalInit(WebContext context)
InitializableWebObject
internalInit
in class BaseOAuthClient<CasOAuthWrapperProfile,com.github.scribejava.core.oauth.OAuth20Service,com.github.scribejava.core.model.OAuth2AccessToken>
context
- the web contextprotected com.github.scribejava.core.builder.api.BaseApi<com.github.scribejava.core.oauth.OAuth20Service> getApi()
BaseOAuthClient
getApi
in class BaseOAuthClient<CasOAuthWrapperProfile,com.github.scribejava.core.oauth.OAuth20Service,com.github.scribejava.core.model.OAuth2AccessToken>
protected boolean hasOAuthGrantType()
BaseOAuthClient
hasOAuthGrantType
in class BaseOAuthClient<CasOAuthWrapperProfile,com.github.scribejava.core.oauth.OAuth20Service,com.github.scribejava.core.model.OAuth2AccessToken>
protected String getProfileUrl(com.github.scribejava.core.model.OAuth2AccessToken accessToken)
BaseOAuthClient
getProfileUrl
in class BaseOAuthClient<CasOAuthWrapperProfile,com.github.scribejava.core.oauth.OAuth20Service,com.github.scribejava.core.model.OAuth2AccessToken>
accessToken
- only used when constructing dynamic urls from data in the tokenprotected CasOAuthWrapperProfile extractUserProfile(String body) throws HttpAction
BaseOAuthClient
extractUserProfile
in class BaseOAuthClient<CasOAuthWrapperProfile,com.github.scribejava.core.oauth.OAuth20Service,com.github.scribejava.core.model.OAuth2AccessToken>
body
- the response bodyHttpAction
- whether an additional HTTP action is requiredpublic String getCasOAuthUrl()
public void setCasOAuthUrl(String casOAuthUrl)
public boolean isSpringSecurityCompliant()
public void setSpringSecurityCompliant(boolean springSecurityCompliant)
Copyright © 2016. All rights reserved.