Class: OpenID::PAPE::Request

### Home Classes Methods

### In Files

- lib/openid/extensions/pape.rb

### Parent

OpenID::Extension

### Methods

- ::from_openid_request
- ::new
- #add_policy_uri
- #get_extension_args
- #parse_extension_args
- #preferred_types

### Files

- LICENSE

### Class/Module Index

Quicksearch

- OpenID
- OpenID::AX
- OpenID::AX::AXMessage
- OpenID::AX::AttrInfo
- OpenID::AX::Error
- OpenID::AX::FetchRequest
- OpenID::AX::FetchResponse
- OpenID::AX::KeyValueMessage
- OpenID::AX::StoreRequest
- OpenID::AX::StoreResponse
- OpenID::AssertionError
- OpenID::Association
- OpenID::AssociationNegotiator
- OpenID::Consumer
- OpenID::Consumer::AssociationManager
- OpenID::Consumer::CancelResponse
- OpenID::Consumer::CheckIDRequest
- OpenID::Consumer::DiffieHellmanSHA1Session
- OpenID::Consumer::DiffieHellmanSHA256Session
- OpenID::Consumer::DiffieHellmanSession
- OpenID::Consumer::DiscoveredServices
- OpenID::Consumer::DiscoveryManager
- OpenID::Consumer::FailureResponse
- OpenID::Consumer::IdResHandler
- OpenID::Consumer::NoEncryptionSession
- OpenID::Consumer::Response
- OpenID::Consumer::Session
- OpenID::Consumer::SetupNeededResponse
- OpenID::Consumer::SuccessResponse
- OpenID::CryptUtil
- OpenID::DiffieHellman
- OpenID::DiscoveryFailure
- OpenID::Extension
- OpenID::FetchingError
- OpenID::HTTPRedirectLimitReached
- OpenID::HTTPResponse
- OpenID::HTTPStatusError
- OpenID::InvalidOpenIDNamespace
- OpenID::KVFormError
- OpenID::KVPostNetworkError
- OpenID::Message
- OpenID::Message::KeyNotFound
- OpenID::NamespaceAliasRegistrationError
- OpenID::NamespaceMap
- OpenID::Nonce
- OpenID::OAuth
- OpenID::OAuth::Request
- OpenID::OAuth::Response
- OpenID::OpenIDError
- OpenID::OpenIDServiceEndpoint
- OpenID::PAPE
- OpenID::PAPE::Request
- OpenID::PAPE::Response
- OpenID::ProtocolError
- OpenID::RealmVerificationRedirected
- OpenID::SReg
- OpenID::SReg::NamespaceError
- OpenID::SReg::Request
- OpenID::SReg::Response
- OpenID::SSLFetchingError
- OpenID::Server
- OpenID::Server::AlreadySigned
- OpenID::Server::AssociateRequest
- OpenID::Server::BaseServerSession
- OpenID::Server::CheckAuthRequest
- OpenID::Server::CheckIDRequest
- OpenID::Server::Decoder
- OpenID::Server::DiffieHellmanSHA1ServerSession
- OpenID::Server::DiffieHellmanSHA256ServerSession
- OpenID::Server::Encoder
- OpenID::Server::EncodingError
- OpenID::Server::MalformedReturnURL
- OpenID::Server::MalformedTrustRoot
- OpenID::Server::NoReturnToError
- OpenID::Server::OpenIDRequest
- OpenID::Server::OpenIDResponse
- OpenID::Server::PlainTextServerSession
- OpenID::Server::ProtocolError
- OpenID::Server::Server
- OpenID::Server::Signatory
- OpenID::Server::SigningEncoder
- OpenID::Server::UntrustedReturnURL
- OpenID::Server::VersionError
- OpenID::Server::WebResponse
- OpenID::ServerError
- OpenID::StandardFetcher
- OpenID::Store
- OpenID::Store::Filesystem
- OpenID::Store::Interface
- OpenID::Store::Memcache
- OpenID::Store::Memory
- OpenID::TrustRoot
- OpenID::TrustRoot::TrustRoot
- OpenID::TypeURIMismatch
- OpenID::UI
- OpenID::UI::Request
- OpenID::URINorm
- OpenID::UndefinedOpenIDNamespace
- OpenID::Util
- OpenID::Yadis
- OpenID::Yadis::BasicServiceEndpoint
- OpenID::Yadis::CompoundFilter
- OpenID::Yadis::DiscoveryResult
- OpenID::Yadis::TransformFilterMaker
- OpenID::Yadis::XRDSError
- OpenID::Yadis::XRDSFraud
- OpenID::Yadis::XRI
- OpenID::Yadis::XRI::ProxyResolver
- OpenID::Yadis::XRI::XRIHTTPError
- HMAC
- HMAC::Base
- HMAC::SHA1
- HMAC::SHA256
- HMAC::SHA384
- HMAC::SHA512
- Net
- Net::HTTP
- HTMLComment
- HTMLTag
- HTMLText
- HTMLToken
- HTMLTokenizer
- HTMLTokenizerError
- Object

No matching classes.

# OpenID::PAPE::Request

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

### Attributes

max_auth_age[RW]
ns_alias[RW]
ns_uri[RW]
preferred_auth_policies[RW]

### Public Class Methods

from_openid_request(oid_req) click to toggle source

Instantiate a Request object from the arguments in a checkid_* OpenID message return nil if the extension was not requested.

    # File lib/openid/extensions/pape.rb, line 49
    def self.from_openid_request(oid_req)
      pape_req = new
      args = oid_req.message.get_args(NS_URI)
      if args == {}
        return nil
      end
      pape_req.parse_extension_args(args)
      return pape_req
    end

new(preferred_auth_policies=[], max_auth_age=nil) click to toggle source

    # File lib/openid/extensions/pape.rb, line 22
    def initialize(preferred_auth_policies=[], max_auth_age=nil)
      @ns_alias = 'pape'
      @ns_uri = NS_URI
      @preferred_auth_policies = preferred_auth_policies
      @max_auth_age = max_auth_age
    end

### Public Instance Methods

add_policy_uri(policy_uri) click to toggle source

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.

    # File lib/openid/extensions/pape.rb, line 32
    def add_policy_uri(policy_uri)
      unless @preferred_auth_policies.member? policy_uri
        @preferred_auth_policies << policy_uri
      end
    end

get_extension_args() click to toggle source

    # File lib/openid/extensions/pape.rb, line 38
    def get_extension_args
      ns_args = {
        'preferred_auth_policies' => @preferred_auth_policies.join(' ')
      }
      ns_args['max_auth_age'] = @max_auth_age.to_s if @max_auth_age
      return ns_args
    end

parse_extension_args(args) click to toggle source

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

    # File lib/openid/extensions/pape.rb, line 61
    def parse_extension_args(args)
      @preferred_auth_policies = []
      policies_str = args['preferred_auth_policies']
      if policies_str
        policies_str.split(' ').each{|uri|
          add_policy_uri(uri)
        }
      end

      max_auth_age_str = args['max_auth_age']
      if max_auth_age_str
        @max_auth_age = max_auth_age_str.to_i
      else
        @max_auth_age = nil
      end
    end

preferred_types(supported_types) click to toggle source

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

    # File lib/openid/extensions/pape.rb, line 81
    def preferred_types(supported_types)
      @preferred_auth_policies.select{|uri| supported_types.member? uri}
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.