JanRain OpenID Library

Auth_OpenID_GenericConsumer
in package

This class is the interface to the OpenID consumer logic.

Instances of it maintain no per-request state, so they can be reused (or even used by multiple threads concurrently) as needed.

Table of Contents

$_use_assocs  : mixed
$discoverMethod  : mixed
$fetcher  : Auth_Yadis_ParanoidHTTPFetcher|Auth_Yadis_PlainHTTPFetcher
$negotiator  : Auth_OpenID_SessionNegotiator
$openid1_nonce_query_arg_name  : mixed
$openid1_return_to_identifier_name  : mixed
Another query parameter that gets added to the return_to for OpenID 1; if the user's session state is lost, use this claimed identifier to do discovery when verifying the response.
$session_types  : array<string|int, mixed>
$store  : mixed
This consumer's store object.
__construct()  : mixed
This method initializes a new {@link Auth_OpenID_Consumer} instance to access the library.
_checkAuth()  : bool
_checkReturnTo()  : bool
_checkSetupNeeded()  : bool
_complete_cancel()  : Auth_OpenID_CancelResponse
_complete_error()  : Auth_OpenID_FailureResponse
_complete_id_res()  : Auth_OpenID_FailureResponse|Auth_OpenID_SetupNeededResponse|Auth_OpenID_SuccessResponse|null
_complete_setup_needed()  : Auth_OpenID_FailureResponse|Auth_OpenID_SetupNeededResponse
_completeInvalid()  : Auth_OpenID_FailureResponse
_createAssociateRequest()  : array<string|int, mixed>|null
_createCheckAuthRequest()  : Auth_OpenID_Message|null
_discoverAndVerify()  : Auth_OpenID_FailureResponse
_doIdRes()  : Auth_OpenID_FailureResponse|Auth_OpenID_SuccessResponse|mixed|null|string
_extractAssociation()  : Auth_OpenID_Association|Auth_OpenID_FailureResponse|null
_extractSupportedAssociationType()  : array<string|int, mixed>|null
Handle ServerErrors resulting from association requests.
_getAssociation()  : Auth_OpenID_Association|Auth_OpenID_Message|Auth_OpenID_ServerErrorContainer|null
_getOpenID1SessionType()  : string
Given an association response message, extract the OpenID 1.X session type.
_httpResponseToMessage()  : Auth_OpenID_Message|Auth_OpenID_ServerErrorContainer|null
Adapt a POST response to a Message.
_idResCheckForFields()  : Auth_OpenID_FailureResponse|mixed|null|string
_idResCheckNonce()  : Auth_OpenID_FailureResponse|null
_idResCheckSignature()  : Auth_OpenID_FailureResponse|null
_idResGetNonceOpenID1()  : string
Extract the nonce from an OpenID 1 response. Return the nonce from the BARE_NS since we independently check the return_to arguments are the same as those in the response message.
_makeKVPost()  : Auth_OpenID_Message|Auth_OpenID_ServerErrorContainer|null
_negotiateAssociation()  : Auth_OpenID_Association|null
_processCheckAuthResponse()  : bool
_requestAssociation()  : Auth_OpenID_Association|Auth_OpenID_Message|Auth_OpenID_ServerErrorContainer|null
_verifyDiscoveryResults()  : Auth_OpenID_FailureResponse|Auth_OpenID_ServiceEndpoint
_verifyDiscoveryResultsOpenID1()  : Auth_OpenID_FailureResponse|Auth_OpenID_ServiceEndpoint
_verifyDiscoveryResultsOpenID2()  : Auth_OpenID_FailureResponse|Auth_OpenID_ServiceEndpoint
_verifyDiscoveryServices()  : Auth_OpenID_FailureResponse|Auth_OpenID_ServiceEndpoint
_verifyDiscoverySingle()  : Auth_OpenID_FailureResponse|null
_verifyReturnToArgs()  : Auth_OpenID_FailureResponse|bool
begin()  : Auth_OpenID_AuthRequest
Called to begin OpenID authentication using the specified {@link Auth_OpenID_ServiceEndpoint}.
complete()  : Auth_OpenID_SuccessResponse
Given an {@link Auth_OpenID_Message}, {@link Auth_OpenID_ServiceEndpoint} and optional return_to URL, complete OpenID authentication.

Properties

$_use_assocs

public mixed $_use_assocs
Tags
access

private

$discoverMethod

public mixed $discoverMethod = 'Auth_OpenID_discover'
Tags
access

private

$openid1_nonce_query_arg_name

public mixed $openid1_nonce_query_arg_name = 'janrain_nonce'
Tags
access

private

$openid1_return_to_identifier_name

Another query parameter that gets added to the return_to for OpenID 1; if the user's session state is lost, use this claimed identifier to do discovery when verifying the response.

public mixed $openid1_return_to_identifier_name = 'openid1_claimed_id'

$session_types

public array<string|int, mixed> $session_types

$store

This consumer's store object.

public mixed $store

Methods

__construct()

This method initializes a new {@link Auth_OpenID_Consumer} instance to access the library.

public __construct(Auth_OpenID_OpenIDStore $store) : mixed
Parameters
$store : Auth_OpenID_OpenIDStore

This must be an object that implements the interface in . Several concrete implementations are provided, to cover most common use cases. For stores backed by MySQL, PostgreSQL, or SQLite, see the class and its sublcasses. For a filesystem-backed store, see the module. As a last resort, if it isn't possible for the server to store state at all, an instance of can be used.

Return values
mixed

_createAssociateRequest()

public _createAssociateRequest(Auth_OpenID_ServiceEndpoint $endpoint, string $assoc_type, string $session_type) : array<string|int, mixed>|null
Parameters
$endpoint : Auth_OpenID_ServiceEndpoint
$assoc_type : string
$session_type : string
Tags
access

private

Return values
array<string|int, mixed>|null

_extractSupportedAssociationType()

Handle ServerErrors resulting from association requests.

public _extractSupportedAssociationType( $server_error) : array<string|int, mixed>|null
Parameters
$server_error :
Tags
access

private

Return values
array<string|int, mixed>|null

$result If server replied with an C{unsupported-type} error, return a tuple of supported C{association_type}, C{session_type}. Otherwise logs the error and returns null.

_getOpenID1SessionType()

Given an association response message, extract the OpenID 1.X session type.

public _getOpenID1SessionType(Auth_OpenID_Message $assoc_response) : string

This function mostly takes care of the 'no-encryption' default behavior in OpenID 1.

If the association type is plain-text, this function will return 'no-encryption'

Parameters
$assoc_response : Auth_OpenID_Message
Tags
access

private

Return values
string

The association type for this message

_idResGetNonceOpenID1()

Extract the nonce from an OpenID 1 response. Return the nonce from the BARE_NS since we independently check the return_to arguments are the same as those in the response message.

public _idResGetNonceOpenID1(Auth_OpenID_Message $message) : string

See the openid1_nonce_query_arg_name class variable

Parameters
$message : Auth_OpenID_Message
Tags
access

private

Return values
string

The nonce as a string or null

_verifyDiscoveryServices()

public _verifyDiscoveryServices(string $claimed_id, array<string|int, Auth_OpenID_ServiceEndpoint$services, array<string|int, Auth_OpenID_ServiceEndpoint$to_match_endpoints) : Auth_OpenID_FailureResponse|Auth_OpenID_ServiceEndpoint
Parameters
$claimed_id : string
$services : array<string|int, Auth_OpenID_ServiceEndpoint>
$to_match_endpoints : array<string|int, Auth_OpenID_ServiceEndpoint>
Tags
access

private

Return values
Auth_OpenID_FailureResponse|Auth_OpenID_ServiceEndpoint

Search results