Package eu.webtoolkit.jwt.auth
Class GoogleService
java.lang.Object
eu.webtoolkit.jwt.auth.OAuthService
eu.webtoolkit.jwt.auth.OidcService
eu.webtoolkit.jwt.auth.GoogleService
OAuth service for Google as third-party authenticator.
The configuration of the service is done using properties, whose values need to match the values configured at Google.
google-oauth2-redirect-endpoint
: the URL of the local redirect endpoint, to which the google OAuth service redirects the user after authentication. See alsoOidcService.getRedirectEndpoint()
google-oauth2-redirect-endpoint-path
: optionally, the deployment path that corresponds to the redirect endpoint. See alsogetRedirectEndpointPath()
google-oauth2-client-id
: The client IDgoogle-oauth2-client-secret
: The client secret.
For example:
<properties>
<property name="google-oauth2-redirect-endpoint">
http://localhost:8080/oauth2callback
</property>
<property name="google-oauth2-client-id">
123456789012.apps.googleusercontent.com
</property>
<property name="google-oauth2-client-secret">
abcdefghijk-12312312312
</property>
</properties>
Like all service classes, this class holds only configuration state. Thus, once configured, it can be safely shared between multiple sessions since its state (the configuration) is read-only.
See also: https://developers.google.com/identity/protocols/OAuth2 https://developers.google.com/identity/protocols/OpenIDConnect
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
Checks whether a GoogleAuth service is properly configured.Returns the deployment path of the redirection endpoint.Methods inherited from class eu.webtoolkit.jwt.auth.OidcService
createProcess, getAuthenticationScope, getAuthorizationEndpoint, getClientId, getClientSecret, getClientSecretMethod, getDescription, getName, getPopupHeight, getPopupWidth, getRedirectEndpoint, getTokenEndpoint, getUserInfoEndpoint, setAuthEndpoint, setAuthenticationScope, setClientId, setClientSecret, setClientSecretMethod, setDescription, setName, setPopupHeight, setPopupWidth, setRedirectEndpoint, setTokenEndpoint, setUserInfoEndpoint
Methods inherited from class eu.webtoolkit.jwt.auth.OAuthService
configurationProperty, configureRedirectEndpoint, decodeState, encodeState, getBaseAuth, getGenerateRedirectEndpoint, getRedirectInternalPath, getTokenRequestMethod, isPopupEnabled, setPopupEnabled
-
Constructor Details
-
GoogleService
Constructor.
-
-
Method Details
-
configured
public static boolean configured()Checks whether a GoogleAuth service is properly configured.This returns
true
if a value is found for the three configuration properties. -
getRedirectEndpointPath
Description copied from class:OAuthService
Returns the deployment path of the redirection endpoint.This returns the path at which the static resource is deployed that corresponds to the
getRedirectEndpoint()
.The default implementation will derive this path from the
getRedirectEndpoint()
URL.- Overrides:
getRedirectEndpointPath
in classOAuthService
-