Sha256: 026c7c6ddd50550d6b22f87cd23c0197306cb3140a99734bfe1a386d9fcd049a

Contents?: true

Size: 1.09 KB

Versions: 4

Compression:

Stored size: 1.09 KB

Contents

# all these methods must return true or false
module AuthlogicConnect::Openid::State
    # 1. to call
    def openid_request?
      !openid_identifier.blank?
    end
    
    def openid_identifier?
      openid_request?
    end
    
    def openid_provider?
      
    end
    
    # 2. from call
    # better check needed
    def openid_response?
      !auth_session[:auth_attributes].nil? && auth_session[:auth_method] == "openid"
    end
    alias_method :openid_complete?, :openid_response?
    
    # 3. either to or from call
    # this should include more!
    # we know we are using open id if:
    #   the params passed in have "openid_identifier"
    def using_openid?
      openid_request? || openid_response?
    end
    
    def authenticating_with_openid?
      session_class.activated? && using_openid?
    end
    
    def allow_openid_redirect?
      authenticating_with_openid?
    end
    
    def redirecting_to_openid_server?
      allow_openid_redirect? && !authenticate_with_openid
    end
    
    def validate_password_with_openid?
      !using_openid? && require_password?
    end
    
end

Version data entries

4 entries across 4 versions & 2 rubygems

Version Path
lsdr-authlogic-connect-0.0.3.9 lib/authlogic_connect/openid/state.rb
authlogic-connect-0.0.3.9 lib/authlogic_connect/openid/state.rb
authlogic-connect-0.0.3.8 lib/authlogic_connect/openid/state.rb
authlogic-connect-0.0.3.6 lib/authlogic_connect/openid/state.rb