Class OpenIDConnectProvider
java.lang.Object
org.nuxeo.ecm.platform.oauth2.openid.OpenIDConnectProvider
- All Implemented Interfaces:
LoginProviderLinkComputer
Class that holds info about an OpenID provider, this includes an OAuth Provider as well as urls and icons
- Author:
- Nelson Silva, Tiry
-
Field Summary
Modifier and TypeFieldDescriptionprotected String
protected RedirectUriResolver
protected String
protected UserResolver
-
Constructor Summary
ConstructorDescriptionOpenIDConnectProvider
(OAuth2ServiceProvider oauth2Provider, String accessTokenKey, String userInfoURL, Class<? extends OpenIDUserInfo> openIdUserInfoClass, String icon, boolean enabled, RedirectUriResolver redirectUriResolver, Class<? extends UserResolver> userResolverClass, String userMapper) Deprecated.OpenIDConnectProvider
(OAuth2ServiceProvider oauth2Provider, String accessTokenKey, String userInfoURL, Class<? extends OpenIDUserInfo> openIdUserInfoClass, String icon, boolean enabled, RedirectUriResolver redirectUriResolver, Class<? extends UserResolver> userResolverClass, String userMapper, String authenticationMethod) -
Method Summary
Modifier and TypeMethodDescriptioncomputeUrl
(javax.servlet.http.HttpServletRequest req, String requestedUrl) Compute Url that should be used to login via this login provider.createStateToken
(javax.servlet.http.HttpServletRequest request) Create a state token to prevent request forgery.getAccessToken
(javax.servlet.http.HttpServletRequest req, String code) getAuthenticationUrl
(javax.servlet.http.HttpServletRequest req, String requestedUrl) getIcon()
getName()
getRedirectUri
(javax.servlet.http.HttpServletRequest req) getUserInfo
(String accessToken) boolean
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.
-
Field Details
-
redirectUriResolver
-
userResolver
-
userMapper
-
authenticationMethod
-
-
Constructor Details
-
OpenIDConnectProvider
@Deprecated public OpenIDConnectProvider(OAuth2ServiceProvider oauth2Provider, String accessTokenKey, String userInfoURL, Class<? extends OpenIDUserInfo> openIdUserInfoClass, String icon, boolean enabled, RedirectUriResolver redirectUriResolver, Class<? extends UserResolver> userResolverClass, String userMapper) -
OpenIDConnectProvider
public OpenIDConnectProvider(OAuth2ServiceProvider oauth2Provider, String accessTokenKey, String userInfoURL, Class<? extends OpenIDUserInfo> openIdUserInfoClass, String icon, boolean enabled, RedirectUriResolver redirectUriResolver, Class<? extends UserResolver> userResolverClass, String userMapper, String authenticationMethod)
-
-
Method Details
-
getRedirectUri
-
createStateToken
Create a state token to prevent request forgery. Store it in the session for later validation. -
verifyStateToken
public 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. -
getAuthenticationUrl
-
getName
-
getIcon
-
getAccessToken
-
getUserInfo
-
parseUserInfo
- Throws:
IOException
-
isEnabled
public boolean isEnabled() -
getUserResolver
-
computeUrl
Description copied from interface:LoginProviderLinkComputer
Compute Url that should be used to login via this login provider. Because the url can depend onb the context, it is computed by this method rather than using a static property- Specified by:
computeUrl
in interfaceLoginProviderLinkComputer
-
OpenIDConnectProvider(OAuth2ServiceProvider, String, String, Class, String, boolean, RedirectUriResolver, Class, String, String)