Class GoogleService

java.lang.Object

public class GoogleService
extends OidcService
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 also OidcService.getRedirectEndpoint()
  • google-oauth2-redirect-endpoint-path: optionally, the deployment path that corresponds to the redirect endpoint. See also getRedirectEndpointPath()
  • google-oauth2-client-id: The client ID
  • google-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