Wt
3.3.8
|
OAuth service for Google as third-party authenticator. More...
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 OidcProcess * | createProcess (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 AuthService & | baseAuth () 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... | |
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 redirectEndpoint()google-oauth2-redirect-endpoint-path
: optionally, the deployment path that corresponds to the redirect endpoint. See also redirectEndpointPath()google-oauth2-client-id
: The client IDgoogle-oauth2-client-secret
: The client secret.For example:
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.
|
static |
Checks whether a GoogleAuth service is properly configured.
This returns true
if a value is found for the three configuration properties.
|
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.