Wt  3.2.3
Public Member Functions | Static Public Member Functions
Wt::Auth::GoogleService Class Reference

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

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

List of all members.

Public Member Functions

 GoogleService (const AuthService &baseAuth)
 Constructor.
virtual std::string name () const
 Returns the provider name.
virtual WString description () const
 Returns the provider description.
virtual int popupWidth () const
 Returns the desired width for the popup window.
virtual int popupHeight () const
 Returns the desired height for the popup window.
virtual std::string authenticationScope () const
 Returns the scope needed for authentication.
virtual std::string redirectEndpoint () const
 Returns the redirection endpoint URL.
virtual std::string redirectEndpointPath () const
 Returns the deployment path of the redirection endpoint.
virtual std::string authorizationEndpoint () const
 Returns the authorization endpoint URL.
virtual std::string tokenEndpoint () const
 Returns the token endpoint URL.
virtual std::string clientId () const
 Returns the client ID.
virtual std::string clientSecret () const
 Returns the client secret.
virtual OAuthProcesscreateProcess (const std::string &scope) const
 Creates a new authorizaiton process.

Static Public Member Functions

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

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:
http://code.google.com/apis/accounts/docs/OAuth2.html

Member Function Documentation

std::string Wt::Auth::GoogleService::authenticationScope ( ) const [virtual]

Returns the scope needed for authentication.

This returns the scope that is needed (and sufficient) for obtaining identity information, and thus to authenticate the user.

See also:
OAuthProcess::getIdentity(), OAuthProcess::startAuthenticate()

Implements Wt::Auth::OAuthService.

std::string Wt::Auth::GoogleService::authorizationEndpoint ( ) const [virtual]

Returns the authorization endpoint URL.

This is a remote URL which hosts the OAuth authorization user interface. This URL is loaded in the popup window at the start of an authorization process.

Implements Wt::Auth::OAuthService.

std::string Wt::Auth::GoogleService::clientId ( ) const [virtual]

Returns the client ID.

This is the identification for this web application with the OAuth authorization server.

Implements Wt::Auth::OAuthService.

std::string Wt::Auth::GoogleService::clientSecret ( ) const [virtual]

Returns the client secret.

This is the secret credentials for this web application with the OAuth authorization server.

Implements Wt::Auth::OAuthService.

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.

OAuthProcess * Wt::Auth::GoogleService::createProcess ( const std::string &  scope) const [virtual]

Creates a new authorizaiton process.

This creates a new authorization process for the indicated scope. Valid names for the scope are service provider dependent.

See also:
authenticationScope()

Implements Wt::Auth::OAuthService.

WString Wt::Auth::GoogleService::description ( ) const [virtual]

Returns the provider description.

This returns a description useful for e.g. tool tips on a login icon.

See also:
name()

Implements Wt::Auth::OAuthService.

std::string Wt::Auth::GoogleService::name ( ) const [virtual]

Returns the provider name.

This is a short identifier.

See also:
description()

Implements Wt::Auth::OAuthService.

int Wt::Auth::GoogleService::popupHeight ( ) const [virtual]

Returns the desired height for the popup window.

See also:
popupWidth()

Implements Wt::Auth::OAuthService.

int Wt::Auth::GoogleService::popupWidth ( ) const [virtual]

Returns the desired width for the popup window.

See also:
popupHeight()

Implements Wt::Auth::OAuthService.

std::string Wt::Auth::GoogleService::redirectEndpoint ( ) const [virtual]

Returns the redirection endpoint URL.

This is the local URL to which the browser is redirect from the service provider, after the authorization process. You need to configure this URL with the third party authentication service.

A static resource will be deployed at this URL.

See also:
WServer::addResource()

Implements Wt::Auth::OAuthService.

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.

std::string Wt::Auth::GoogleService::tokenEndpoint ( ) const [virtual]

Returns the token endpoint URL.

This is a remote URL which hosts a web-service that generates access tokens.

Implements Wt::Auth::OAuthService.

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator

Generated on Thu Nov 1 2012 for the C++ Web Toolkit (Wt) by doxygen 1.7.5.1