Wt  3.7.1
Public Member Functions | Static Public Member Functions | List of all members
Wt::Auth::GoogleService Class Reference

OAuth service for Google as third-party authenticator. More...

Inheritance diagram for Wt::Auth::GoogleService:
Inheritance graph
[legend]

Public Member Functions

 GoogleService (const AuthService &baseAuth)
 Constructor.
 
virtual std::string redirectEndpointPath () const
 Returns the deployment path of the redirection endpoint. More...
 
- Public Member Functions inherited from Wt::Auth::OidcService
 OidcService (const AuthService &baseAuth)
 Constructor.
 
virtual std::string name () const
 Returns the provider name. More...
 
virtual WString description () const
 Returns the provider description. More...
 
virtual int popupWidth () const
 Returns the desired width for the popup window. More...
 
virtual int popupHeight () const
 Returns the desired height of the popup window. More...
 
virtual std::string authenticationScope () const
 Returns the scope needed for authentication. More...
 
virtual std::string redirectEndpoint () const
 Returns the redirection endpoint URL. More...
 
virtual std::string authorizationEndpoint () const
 Returns the authorization endpoint URL. More...
 
virtual std::string tokenEndpoint () const
 Returns the token endpoint URL. More...
 
virtual std::string userInfoEndpoint () const
 Returns the user info endpoint URL. More...
 
virtual std::string clientId () const
 Returns the client ID. More...
 
virtual std::string clientSecret () const
 Returns the client secret. More...
 
virtual ClientSecretMethod clientSecretMethod () const
 Returns the method to transfer the client secret. More...
 
virtual OidcProcesscreateProcess (const std::string &scope) const
 Creates a new authentication process. More...
 
void setRedirectEndpoint (const std::string &url)
 Sets the redirection endpoint URL. More...
 
void setClientId (const std::string &id)
 Sets the client ID. More...
 
void setClientSecret (const std::string &secret)
 Sets the client secret. More...
 
void setAuthEndpoint (const std::string &url)
 Sets the authorization endpoint URL. More...
 
void setTokenEndpoint (const std::string &url)
 Sets the token endpoint URL. More...
 
void setUserInfoEndpoint (const std::string &url)
 Sets the user info endpoint URL. More...
 
void setAuthenticationScope (const std::string &scope)
 Sets the scope needed for authentication. More...
 
void setName (const std::string &name)
 Sets the provider name. More...
 
void setDescription (const std::string &description)
 Sets the provider description. More...
 
void setClientSecretMethod (ClientSecretMethod method)
 Sets the method to transfer the client secret. More...
 
void setPopupWidth (int width)
 Sets the desired width for the popup window. More...
 
void setPopupHeight (int height)
 Sets the desired height for the popup window. More...
 
- Public Member Functions inherited from Wt::Auth::OAuthService
 OAuthService (const AuthService &baseAuth)
 Constructor. More...
 
virtual ~OAuthService ()
 Destructor.
 
const AuthServicebaseAuth () const
 Returns the basic authentication service.
 
virtual std::string encodeState (const std::string &sessionId) const
 Derives a state value from the session ID. More...
 
virtual std::string decodeState (const std::string &state) const
 Validates and decodes a state parameter. More...
 
virtual Http::Method tokenRequestMethod () const
 Returns the HTTP method used for the token request. More...
 
void configureRedirectEndpoint () const
 Configures the static resource implementing the redirect endpoint. More...
 

Static Public Member Functions

static bool configured ()
 Checks whether a GoogleAuth service is properly configured. More...
 

Detailed Description

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.

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. A "const GoogleService" object is thus thread-safe.

See also
https://developers.google.com/identity/protocols/OAuth2
https://developers.google.com/identity/protocols/OpenIDConnect
Note
For FastCGI, see also additional configuration in OAuthService

Member Function Documentation

◆ configured()

bool Wt::Auth::GoogleService::configured ( )
static

Checks whether a GoogleAuth service is properly configured.

This returns true if a value is found for the three configuration properties.

◆ redirectEndpointPath()

std::string Wt::Auth::GoogleService::redirectEndpointPath ( ) const
virtual

Returns the deployment path of the redirection endpoint.

This returns the path at which the static resource is deployed that corresponds to the redirectEndpoint().

The default implementation will derive this path from the redirectEndpoint() URL.

Reimplemented from Wt::Auth::OAuthService.


Generated on Tue Dec 15 2020 for the C++ Web Toolkit (Wt) by doxygen 1.8.13