Package org.keycloak.adapters
Class OAuthRequestAuthenticator
java.lang.Object
org.keycloak.adapters.OAuthRequestAuthenticator
- Version:
- $Revision: 1 $
- Author:
- Bill Burke
-
Field Summary
Modifier and TypeFieldDescriptionprotected AuthChallenge
protected KeycloakDeployment
protected HttpFacade
protected IDToken
protected String
protected String
protected RequestAuthenticator
protected int
protected String
protected AccessToken
protected AdapterSessionStore
protected String
-
Constructor Summary
ConstructorDescriptionOAuthRequestAuthenticator
(RequestAuthenticator requestAuthenticator, HttpFacade facade, KeycloakDeployment deployment, int sslRedirectPort, AdapterSessionStore tokenStore) -
Method Summary
Modifier and TypeMethodDescriptionprotected AuthChallenge
challenge
(int code, OIDCAuthenticationError.Reason reason, String description) protected AuthChallenge
protected String
getCode()
protected HttpFacade.Cookie
protected String
getCookieValue
(String cookieName) protected String
getError()
protected String
getQueryParamValue
(String paramName) protected String
getRedirectUri
(String state) protected String
protected String
getToken()
protected boolean
protected AuthChallenge
protected AuthChallenge
resolveCode
(String code) Start or continue the oauth login process.void
setIdToken
(IDToken idToken) void
setIdTokenString
(String idTokenString) void
setStrippedOauthParametersRequestUri
(String strippedOauthParametersRequestUri) protected int
protected String
strip out unwanted query parameters and redirect so bookmarks don't retain oauth protocol bits
-
Field Details
-
deployment
-
reqAuthenticator
-
sslRedirectPort
protected int sslRedirectPort -
tokenStore
-
tokenString
-
idTokenString
-
idToken
-
token
-
facade
-
challenge
-
refreshToken
-
strippedOauthParametersRequestUri
-
-
Constructor Details
-
OAuthRequestAuthenticator
public OAuthRequestAuthenticator(RequestAuthenticator requestAuthenticator, HttpFacade facade, KeycloakDeployment deployment, int sslRedirectPort, AdapterSessionStore tokenStore)
-
-
Method Details
-
getChallenge
-
getTokenString
-
getToken
-
getRefreshToken
-
getIdTokenString
-
setIdTokenString
-
getIdToken
-
setIdToken
-
getStrippedOauthParametersRequestUri
-
setStrippedOauthParametersRequestUri
-
getRequestUrl
-
isRequestSecure
protected boolean isRequestSecure() -
getCookie
-
getCookieValue
-
getQueryParamValue
-
getError
-
getCode
-
getRedirectUri
-
sslRedirectPort
protected int sslRedirectPort() -
getStateCode
-
loginRedirect
-
checkStateCookie
-
authenticate
-
challenge
protected AuthChallenge challenge(int code, OIDCAuthenticationError.Reason reason, String description) -
resolveCode
Start or continue the oauth login process. if code query parameter is not present, then browser is redirected to authUrl. The redirect URL will be the URL of the current request. If code query parameter is present, then an access token is obtained by invoking a secure request to the codeUrl. If the access token is obtained, the browser is again redirected to the current request URL, but any OAuth protocol specific query parameters are removed.- Returns:
- null if an access token was obtained, otherwise a challenge is returned
-
stripOauthParametersFromRedirect
strip out unwanted query parameters and redirect so bookmarks don't retain oauth protocol bits
-