Module: Rack::Rpx::Methods
- Defined in:
- lib/rack-rpx.rb
Overview
Helper methods intended to be included in your Rails controller or in your Sinatra helpers block
Instance Method Summary collapse
- #callback_url ⇒ Object
-
#get_credentials(token) ⇒ Object
This is the method you want to call.
- #login_widget_url(app_name = nil) ⇒ Object
Instance Method Details
#callback_url ⇒ Object
42 43 44 |
# File 'lib/rack-rpx.rb', line 42 def callback_url "http://#{env['HTTP_HOST']}#{OPTIONS[:callback_path]}" end |
#get_credentials(token) ⇒ Object
This is the method you want to call.
After you’re authorized and redirected back to your #redirect_to path, you should be able to call get_access_token to get and hold onto the access token for the user you’ve been authorized as.
You can use the token to make GET/POST/etc requests
34 35 36 |
# File 'lib/rack-rpx.rb', line 34 def get_credentials(token) Rack::Rpx.get_credentials(token) end |
#login_widget_url(app_name = nil) ⇒ Object
38 39 40 |
# File 'lib/rack-rpx.rb', line 38 def (app_name=nil) "https://#{app_name}.rpxnow.com/openid/v2/signin?token_url=#{callback_url}" end |