Class: OauthAuthorizeController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- OauthAuthorizeController
- Defined in:
- app/controllers/oauth_authorize_controller.rb
Overview
Copyright © 2010 ThoughtWorks Inc. (thoughtworks.com) Licenced under the MIT License (www.opensource.org/licenses/mit-license.php)
Instance Method Summary collapse
Methods included from Oauth2::Provider::TransactionHelper
Methods included from Oauth2::Provider::SslHelper
Instance Method Details
#authorize ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'app/controllers/oauth_authorize_controller.rb', line 15 def return unless validate_params unless params[:authorize] == 'Yes' redirect_to "#{params[:redirect_uri]}?error=access-denied" return end = @client.(current_user_id_for_oauth) state_param = if params[:state].blank? "" else "&state=#{CGI.escape(params[:state])}" end redirect_to "#{params[:redirect_uri]}?code=#{authorization.code}&expires_in=#{authorization.expires_in}#{state_param}" end |
#index ⇒ Object
11 12 13 |
# File 'app/controllers/oauth_authorize_controller.rb', line 11 def index return unless validate_params end |