Auth_OpenID_Server
in package
I handle requests for an OpenID server.
Some types of requests (those which are not checkid requests) may be handed to my method, and I will take care of it and return a response.
For your convenience, I also provide an interface to and through my methods and .
All my state is encapsulated in an .
Example:
$oserver = new Auth_OpenID_Server(Auth_OpenID_FileStore($data_path),
"http://example.com/op");
$request = $oserver->decodeRequest();
if (in_array($request->mode, array('checkid_immediate',
'checkid_setup'))) {
if ($app->isAuthorized($request->identity, $request->trust_root)) {
$response = $request->answer(true);
} else if ($request->immediate) {
$response = $request->answer(false);
} else {
$app->showDecidePage($request);
return;
}
} else {
$response = $oserver->handleRequest($request);
}
$webresponse = $oserver->encode($response);
Table of Contents
- $op_endpoint : Auth_OpenID_ServiceEndpoint|null
- $decoder : Auth_OpenID_Decoder
- $encoder : Auth_OpenID_SigningEncoder
- $negotiator : Auth_OpenID_SessionNegotiator
- $signatory : Auth_OpenID_Signatory
- $store : Auth_OpenID_OpenIDStore
- __construct() : mixed
- Auth_OpenID_Server constructor.
- decodeRequest() : Auth_OpenID_ServerError|mixed
- Decodes a query args array into the appropriate {@link Auth_OpenID_Request} object.
- encodeResponse() : Auth_OpenID_AlreadySigned|Auth_OpenID_EncodingError|Auth_OpenID_ServerError
- Encodes as response in the appropriate format suitable for sending to the user agent.
- handleRequest() : Auth_OpenID_ServerResponse
- Handle a request. Given an {@link Auth_OpenID_Request} object, call the appropriate {@link Auth_OpenID_Server} method to process the request and generate a response.
- openid_associate() : mixed
- The callback for 'associate' messages.
- openid_check_authentication() : mixed
- The callback for 'check_authentication' messages.
Properties
$op_endpoint
public
Auth_OpenID_ServiceEndpoint|null
$op_endpoint
$decoder
private
Auth_OpenID_Decoder
$decoder
$encoder
private
Auth_OpenID_SigningEncoder
$encoder
$negotiator
private
Auth_OpenID_SessionNegotiator
$negotiator
$signatory
private
Auth_OpenID_Signatory
$signatory
$store
private
Auth_OpenID_OpenIDStore
$store
Methods
__construct()
Auth_OpenID_Server constructor.
public
__construct(Auth_OpenID_OpenIDStore $store[, Auth_OpenID_ServiceEndpoint|null $op_endpoint = null ]) : mixed
Parameters
- $store : Auth_OpenID_OpenIDStore
- $op_endpoint : Auth_OpenID_ServiceEndpoint|null = null
Return values
mixed —decodeRequest()
Decodes a query args array into the appropriate {@link Auth_OpenID_Request} object.
public
decodeRequest([array<string|int, mixed>|null $query = null ]) : Auth_OpenID_ServerError|mixed
Parameters
- $query : array<string|int, mixed>|null = null
Return values
Auth_OpenID_ServerError|mixed —encodeResponse()
Encodes as response in the appropriate format suitable for sending to the user agent.
public
encodeResponse(Auth_OpenID_ServerResponse $response) : Auth_OpenID_AlreadySigned|Auth_OpenID_EncodingError|Auth_OpenID_ServerError
Parameters
- $response : Auth_OpenID_ServerResponse
Return values
Auth_OpenID_AlreadySigned|Auth_OpenID_EncodingError|Auth_OpenID_ServerError —handleRequest()
Handle a request. Given an {@link Auth_OpenID_Request} object, call the appropriate {@link Auth_OpenID_Server} method to process the request and generate a response.
public
handleRequest(Auth_OpenID_Request $request) : Auth_OpenID_ServerResponse
Parameters
- $request : Auth_OpenID_Request
-
Return values
Auth_OpenID_ServerResponse —$response A response object capable of generating a user-agent reply.
openid_associate()
The callback for 'associate' messages.
public
openid_associate(Auth_OpenID_AssociateRequest $request) : mixed
Parameters
- $request : Auth_OpenID_AssociateRequest
Return values
mixed —openid_check_authentication()
The callback for 'check_authentication' messages.
public
openid_check_authentication(Auth_OpenID_CheckAuthRequest $request) : mixed
Parameters
- $request : Auth_OpenID_CheckAuthRequest