Class: OpenID::Consumer::SuccessResponse

### Home Classes Methods

### In Files

- lib/openid/consumer/responses.rb

### Parent

Object

### Methods

- ::new
- #extension_response
- #get_signed
- #get_signed_ns
- #is_openid1
- #signed?

### Included Modules

- OpenID::Consumer::Response

### 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::Consumer::SuccessResponse

A successful acknowledgement from the OpenID server that the supplied URL is, indeed controlled by the requesting agent.

### Constants

STATUS

### Attributes

message[R]
signed_fields[R]

### Public Class Methods

new(endpoint, message, signed_fields) click to toggle source

    # File lib/openid/consumer/responses.rb, line 62
    def initialize(endpoint, message, signed_fields)
      # Don't use :endpoint=, because endpoint should never be nil
      # for a successfull transaction.
      @endpoint = endpoint
      @identity_url = endpoint.claimed_id
      @message = message
      @signed_fields = signed_fields
    end

### Public Instance Methods

extension_response(namespace_uri, require_signed) click to toggle source

Return response arguments in the specified namespace. If require_signed is true and the arguments are not signed, return nil.

    # File lib/openid/consumer/responses.rb, line 109
    def extension_response(namespace_uri, require_signed)
      if require_signed
        get_signed_ns(namespace_uri)
      else
        @message.get_args(namespace_uri)
      end
    end

get_signed(ns_uri, ns_key, default=nil) click to toggle source

Return the specified signed field if available, otherwise return default

    # File lib/openid/consumer/responses.rb, line 85
    def get_signed(ns_uri, ns_key, default=nil)
      if signed?(ns_uri, ns_key)
        return @message.get_arg(ns_uri, ns_key, default)
      else
        return default
      end
    end

get_signed_ns(ns_uri) click to toggle source

Get signed arguments from the response message. Return a dict of all arguments in the specified namespace. If any of the arguments are not signed, return nil.

    # File lib/openid/consumer/responses.rb, line 96
    def get_signed_ns(ns_uri)
      msg_args = @message.get_args(ns_uri)
      msg_args.each_key do |key|
        if !signed?(ns_uri, key)
          return nil
        end
      end
      return msg_args
    end

is_openid1() click to toggle source

Was this authentication response an OpenID 1 authentication response?

    # File lib/openid/consumer/responses.rb, line 73
    def is_openid1
      @message.is_openid1
    end

signed?(ns_uri, ns_key) click to toggle source

Return whether a particular key is signed, regardless of its namespace alias

    # File lib/openid/consumer/responses.rb, line 79
    def signed?(ns_uri, ns_key)
      @signed_fields.member?(@message.get_key(ns_uri, ns_key))
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.