Auth_OpenID_PAPE_Request::preferredTypes PHP 메소드

preferredTypes() 공개 메소드

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.
public preferredTypes ( $supported_types ) : array
리턴 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.
    function preferredTypes($supported_types)
    {
        $result = array();
        foreach ($supported_types as $st) {
            if (in_array($st, $this->preferred_auth_policies)) {
                $result[] = $st;
            }
        }
        return $result;
    }

Usage Example

예제 #1
0
 private function _processPape(Auth_OpenID_PAPE_Request $papeRequest, $response)
 {
     if (($image = $this->user->getImage()) && @$_COOKIE['image']) {
         $cidSupportedPolicies = array(PAPE_AUTH_PHISHING_RESISTANT);
         if ($RPPreferredTypes = $papeRequest->preferredTypes($cidSupportedPolicies)) {
             $this->user->getLastLoginUtc();
             $papeResponse = new Auth_OpenID_PAPE_Response($cidSupportedPolicies, $this->user->getLastLoginUtc());
             $papeResponse->toMessage($response->fields);
         }
     }
 }