Class: RockOAuth::Provider

Inherits:
Object
  • Object
show all
Defined in:
lib/rockoauth/provider.rb,
lib/rockoauth/provider/error.rb,
lib/rockoauth/provider/exchange.rb,
lib/rockoauth/provider/access_token.rb,
lib/rockoauth/provider/authorization.rb

Defined Under Namespace

Classes: AccessToken, Assertion, Authorization, Error, Exchange

Constant Summary collapse

EXPIRY_TIME =
3600

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.enforce_sslObject

Returns the value of attribute enforce_ssl.



86
87
88
# File 'lib/rockoauth/provider.rb', line 86

def enforce_ssl
  @enforce_ssl
end

.realmObject

Returns the value of attribute realm.



86
87
88
# File 'lib/rockoauth/provider.rb', line 86

def realm
  @realm
end

Class Method Details

.access_token(*args) ⇒ Object



124
125
126
# File 'lib/rockoauth/provider.rb', line 124

def self.access_token(*args)
  Router.access_token(*args)
end

.access_token_from_request(*args) ⇒ Object



128
129
130
# File 'lib/rockoauth/provider.rb', line 128

def self.access_token_from_request(*args)
  Router.access_token_from_request(*args)
end

.clear_assertion_handlers!Object



89
90
91
92
93
# File 'lib/rockoauth/provider.rb', line 89

def self.clear_assertion_handlers!
  @password_handler   = nil
  @assertion_handlers = {}
  @assertion_filters  = []
end

.filter_assertions(&filter) ⇒ Object



106
107
108
# File 'lib/rockoauth/provider.rb', line 106

def self.filter_assertions(&filter)
  @assertion_filters.push(filter)
end

.handle_assertion(client, assertion, scopes, resource_owner) ⇒ Object



114
115
116
117
118
# File 'lib/rockoauth/provider.rb', line 114

def self.handle_assertion(client, assertion, scopes, resource_owner)
  return nil unless @assertion_filters.all? { |f| f.call(client) }
  handler = @assertion_handlers[assertion.type]
  handler ? handler.call(client, assertion.value, scopes, resource_owner) : nil
end

.handle_assertions(assertion_type, &handler) ⇒ Object



110
111
112
# File 'lib/rockoauth/provider.rb', line 110

def self.handle_assertions(assertion_type, &handler)
  @assertion_handlers[assertion_type] = handler
end

.handle_password(client, username, password, scopes) ⇒ Object



101
102
103
104
# File 'lib/rockoauth/provider.rb', line 101

def self.handle_password(client, username, password, scopes)
  return nil unless @password_handler
  @password_handler.call(client, username, password, scopes)
end

.handle_passwords(&block) ⇒ Object



97
98
99
# File 'lib/rockoauth/provider.rb', line 97

def self.handle_passwords(&block)
  @password_handler = block
end

.parse(*args) ⇒ Object



120
121
122
# File 'lib/rockoauth/provider.rb', line 120

def self.parse(*args)
  Router.parse(*args)
end