Class: StackMob::Rack::SimpleOAuthProvider
- Inherits:
-
Object
- Object
- StackMob::Rack::SimpleOAuthProvider
- Defined in:
- lib/stackmob/rack/simple_oauth_provider.rb
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app) ⇒ SimpleOAuthProvider
constructor
A new instance of SimpleOAuthProvider.
Constructor Details
#initialize(app) ⇒ SimpleOAuthProvider
Returns a new instance of SimpleOAuthProvider.
22 23 24 |
# File 'lib/stackmob/rack/simple_oauth_provider.rb', line 22 def initialize(app) @app = app end |
Instance Method Details
#call(env) ⇒ Object
26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/stackmob/rack/simple_oauth_provider.rb', line 26 def call(env) request = ::Rack::Request.new(env) signature = OAuth::Signature.build(request, :token_secret => "", :consumer_secret => StackMob.secret) if signature.verify (env) else auth_failed(env) end rescue OAuth::Signature::UnknownSignatureMethod auth_failed(env) end |