public class OpenIDConnectProvider extends Object implements LoginProviderLinkComputer
Modifier and Type | Field and Description |
---|---|
protected static org.apache.commons.logging.Log |
log |
protected RedirectUriResolver |
redirectUriResolver |
protected String |
userMapper |
protected UserResolver |
userResolver |
Constructor and Description |
---|
OpenIDConnectProvider(OAuth2ServiceProvider oauth2Provider,
String accessTokenKey,
String userInfoURL,
Class<? extends OpenIDUserInfo> openIdUserInfoClass,
String icon,
boolean enabled,
RedirectUriResolver redirectUriResolver,
Class<? extends UserResolver> userResolverClass,
String userMapper) |
Modifier and Type | Method and Description |
---|---|
String |
computeUrl(javax.servlet.http.HttpServletRequest req,
String requestedUrl)
Compute Url that should be used to login via this login provider.
|
String |
createStateToken(javax.servlet.http.HttpServletRequest request)
Create a state token to prevent request forgery.
|
String |
getAccessToken(javax.servlet.http.HttpServletRequest req,
String code) |
String |
getAuthenticationUrl(javax.servlet.http.HttpServletRequest req,
String requestedUrl) |
String |
getIcon() |
String |
getName() |
String |
getRedirectUri(javax.servlet.http.HttpServletRequest req) |
OpenIDUserInfo |
getUserInfo(String accessToken) |
UserResolver |
getUserResolver() |
boolean |
isEnabled() |
OpenIDUserInfo |
parseUserInfo(String userInfoJSON) |
boolean |
verifyStateToken(javax.servlet.http.HttpServletRequest request)
Ensure that this is no request forgery going on, and that the user sending us this connect request is the user
that was supposed to.
|
protected static final org.apache.commons.logging.Log log
protected RedirectUriResolver redirectUriResolver
protected UserResolver userResolver
protected String userMapper
public OpenIDConnectProvider(OAuth2ServiceProvider oauth2Provider, String accessTokenKey, String userInfoURL, Class<? extends OpenIDUserInfo> openIdUserInfoClass, String icon, boolean enabled, RedirectUriResolver redirectUriResolver, Class<? extends UserResolver> userResolverClass, String userMapper)
public String getRedirectUri(javax.servlet.http.HttpServletRequest req)
public String createStateToken(javax.servlet.http.HttpServletRequest request)
HttpServletRequest
- requestpublic boolean verifyStateToken(javax.servlet.http.HttpServletRequest request)
HttpServletRequest
- requestpublic String getAuthenticationUrl(javax.servlet.http.HttpServletRequest req, String requestedUrl)
public String getAccessToken(javax.servlet.http.HttpServletRequest req, String code)
public OpenIDUserInfo getUserInfo(String accessToken)
public OpenIDUserInfo parseUserInfo(String userInfoJSON) throws IOException
IOException
public boolean isEnabled()
public UserResolver getUserResolver()
public String computeUrl(javax.servlet.http.HttpServletRequest req, String requestedUrl)
LoginProviderLinkComputer
computeUrl
in interface LoginProviderLinkComputer
Copyright © 2015 Nuxeo SA. All rights reserved.