Google APIs Client Library for C++
AuthorizationCredential Class Reference

The abstraction used to pass credentials also contains knowledge about how to use the credentials to authorize requests. More...

#include "client/transport/http_authorization.h"

+ Inheritance diagram for AuthorizationCredential:

List of all members.

Public Member Functions

virtual ~AuthorizationCredential ()
 Standard destructor.
virtual const StringPiece type () const =0
 Returns the type of credential for tracing/debug purposes.
virtual util::Status Refresh ()=0
 Refreshes credential.
virtual util::Status Load (DataReader *serialized_credential)=0
 Initialize the credential from a stream.
virtual DataReaderMakeDataReader () const =0
 Creates a DataReader stream serializing the credential.
virtual util::Status AuthorizeRequest (HttpRequest *request)=0
 Uses the credential to authorize a request.

Detailed Description

The abstraction used to pass credentials also contains knowledge about how to use the credentials to authorize requests.

In practice this is probably an OAuth2Credential, but this class provides an abstract interface sufficient to keep OAuth 2.0 depedencies out of the HTTP transport layer and core libraries that dont care about the mechanism details.


Constructor & Destructor Documentation

virtual ~AuthorizationCredential ( ) [virtual]

Standard destructor.


Member Function Documentation

virtual util::Status AuthorizeRequest ( HttpRequest request) [pure virtual]

Uses the credential to authorize a request.

Parameters:
[in,out]requestThe request to authorized will be modified as needed depending on the specific class (e.g. adding an authoriation header).
Returns:
failure if the request cannot be authorized. A success does not guarantee that the server will accept the authorization but a failure guarantees that it will not.

Implemented in OAuth2Credential.

virtual util::Status Load ( DataReader serialized_credential) [pure virtual]

Initialize the credential from a stream.

Parameters:
[in]serialized_credentialA serialized credential stream to load from.
See also:
MakeDataReader

Implemented in OAuth2Credential.

virtual DataReader* MakeDataReader ( ) const [pure virtual]

Creates a DataReader stream serializing the credential.

Returns:
serialized stream suitable for Load.

Implemented in OAuth2Credential.

virtual util::Status Refresh ( ) [pure virtual]

Refreshes credential.

Returns:
ok or reason for failure.

Implemented in OAuth2Credential.

virtual const StringPiece type ( ) const [pure virtual]

Returns the type of credential for tracing/debug purposes.

Implemented in OAuth2Credential.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines