ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
Auth_OpenID_PAPE_Request Class Reference

A Provider Authentication Policy request, sent from a relying party to a provider. More...

+ Inheritance diagram for Auth_OpenID_PAPE_Request:
+ Collaboration diagram for Auth_OpenID_PAPE_Request:

Public Member Functions

 Auth_OpenID_PAPE_Request ($preferred_auth_policies=null, $max_auth_age=null)
 
 addPolicyURI ($policy_uri)
 Add an acceptable authentication policy URI to this request. More...
 
 getExtensionArgs ()
 Get the string arguments that should be added to an OpenID message for this extension. More...
 
 parseExtensionArgs ($args)
 Set the state of this request to be that expressed in these PAPE arguments. More...
 
 preferredTypes ($supported_types)
 Given a list of authentication policy URIs that a provider supports, this method returns the subsequence of those types that are preferred by the relying party. More...
 
- Public Member Functions inherited from Auth_OpenID_Extension
 getExtensionArgs ()
 Get the string arguments that should be added to an OpenID message for this extension. More...
 
 toMessage ($message)
 Add the arguments from this extension to the provided message. More...
 

Static Public Member Functions

static fromOpenIDRequest ($request)
 Instantiate a Request object from the arguments in a checkid_* OpenID message. More...
 

Data Fields

 $ns_alias = 'pape'
 
 $ns_uri = Auth_OpenID_PAPE_NS_URI
 
- Data Fields inherited from Auth_OpenID_Extension
 $ns_uri = null
 ns_uri: The namespace to which to add the arguments for this extension More...
 
 $ns_alias = null
 

Detailed Description

A Provider Authentication Policy request, sent from a relying party to a provider.

preferred_auth_policies: The authentication policies that the relying party prefers

max_auth_age: The maximum time, in seconds, that the relying party wants to allow to have elapsed before the user must re-authenticate

Definition at line 30 of file PAPE.php.

Member Function Documentation

◆ addPolicyURI()

Auth_OpenID_PAPE_Request::addPolicyURI (   $policy_uri)

Add an acceptable authentication policy URI to this request.

This method is intended to be used by the relying party to add acceptable authentication types to the request.

policy_uri: The identifier for the preferred type of authentication.

Definition at line 55 of file PAPE.php.

57 : The identifier for the preferred type of
58 * authentication.
59 */
60 function addPolicyURI($policy_uri)
addPolicyURI($policy_uri)
Add an acceptable authentication policy URI to this request.
Definition: PAPE.php:55

Referenced by Auth_OpenID_PAPE_Request().

+ Here is the caller graph for this function:

◆ Auth_OpenID_PAPE_Request()

Auth_OpenID_PAPE_Request::Auth_OpenID_PAPE_Request (   $preferred_auth_policies = null,
  $max_auth_age = null 
)

Definition at line 35 of file PAPE.php.

35 {
36
37 var $ns_alias = 'pape';
39
40 function Auth_OpenID_PAPE_Request($preferred_auth_policies=null,
41 $max_auth_age=null)
42 {
43 if ($preferred_auth_policies === null) {
44 $preferred_auth_policies = array();
const Auth_OpenID_PAPE_NS_URI
An implementation of the OpenID Provider Authentication Policy Extension 1.0.
Definition: PAPE.php:13
Auth_OpenID_PAPE_Request($preferred_auth_policies=null, $max_auth_age=null)
Definition: PAPE.php:35

References $ns_alias, $ns_uri, addPolicyURI(), Auth_OpenID_PAPE_NS_URI, and Auth_OpenID_PAPE_Request().

Referenced by Auth_OpenID_PAPE_Request(), and fromOpenIDRequest().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fromOpenIDRequest()

static Auth_OpenID_PAPE_Request::fromOpenIDRequest (   $request)
static

Instantiate a Request object from the arguments in a checkid_* OpenID message.

Definition at line 80 of file PAPE.php.

86 {
87 $obj = new Auth_OpenID_PAPE_Request();
88 $args = $request->message->getArgs(Auth_OpenID_PAPE_NS_URI);
89
90 if ($args === null || $args === array()) {
91 return null;

References Auth_OpenID_PAPE_NS_URI, and Auth_OpenID_PAPE_Request().

+ Here is the call graph for this function:

◆ getExtensionArgs()

Auth_OpenID_PAPE_Request::getExtensionArgs ( )

Get the string arguments that should be added to an OpenID message for this extension.

Reimplemented from Auth_OpenID_Extension.

Definition at line 62 of file PAPE.php.

62 {
63 $this->preferred_auth_policies[] = $policy_uri;
64 }
65 }
66
67 function getExtensionArgs()
68 {
69 $ns_args = array(
70 'preferred_auth_policies' =>
71 implode(' ', $this->preferred_auth_policies)
72 );
73
74 if ($this->max_auth_age !== null) {
getExtensionArgs()
Get the string arguments that should be added to an OpenID message for this extension.
Definition: PAPE.php:62

◆ parseExtensionArgs()

Auth_OpenID_PAPE_Request::parseExtensionArgs (   $args)

Set the state of this request to be that expressed in these PAPE arguments.

Parameters
argsThe PAPE arguments without a namespace

Definition at line 99 of file PAPE.php.

102 : The PAPE arguments without a namespace
103 */
104 function parseExtensionArgs($args)
105 {
106 // preferred_auth_policies is a space-separated list of policy
107 // URIs
108 $this->preferred_auth_policies = array();
109
110 $policies_str = Auth_OpenID::arrayGet($args, 'preferred_auth_policies');
111 if ($policies_str) {
112 foreach (explode(' ', $policies_str) as $uri) {
113 if (!in_array($uri, $this->preferred_auth_policies)) {
114 $this->preferred_auth_policies[] = $uri;
115 }
116 }
117 }
118
119 // max_auth_age is base-10 integer number of seconds
120 $max_auth_age_str = Auth_OpenID::arrayGet($args, 'max_auth_age');
121 if ($max_auth_age_str) {
parseExtensionArgs($args)
Set the state of this request to be that expressed in these PAPE arguments.
Definition: PAPE.php:99
static arrayGet($arr, $key, $fallback=null)
Convenience function for getting array values.
Definition: OpenID.php:242

◆ preferredTypes()

Auth_OpenID_PAPE_Request::preferredTypes (   $supported_types)

Given a list of authentication policy URIs that a provider supports, this method returns the subsequence of those types that are preferred by the relying party.

Parameters
supported_typesA sequence of authentication policy type URIs that are supported by a provider
Returns
array The sub-sequence of the supported types that are preferred by the relying party. This list will be ordered in the order that the types appear in the supported_types sequence, and may be empty if the provider does not prefer any of the supported authentication types.

Definition at line 137 of file PAPE.php.

143 {
144 $result = array();
145
146 foreach ($supported_types as $st) {
147 if (in_array($st, $this->preferred_auth_policies)) {
$result

Field Documentation

◆ $ns_alias

Auth_OpenID_PAPE_Request::$ns_alias = 'pape'

Definition at line 32 of file PAPE.php.

Referenced by Auth_OpenID_PAPE_Request().

◆ $ns_uri

Auth_OpenID_PAPE_Request::$ns_uri = Auth_OpenID_PAPE_NS_URI

Definition at line 33 of file PAPE.php.

Referenced by Auth_OpenID_PAPE_Request().


The documentation for this class was generated from the following file: