Class: Devise::Oauth::AuthorizationsController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- Devise::Oauth::AuthorizationsController
- Includes:
- Helpers
- Defined in:
- app/controllers/devise/oauth/authorizations_controller.rb
Instance Method Summary collapse
- #create ⇒ Object
- #destroy ⇒ Object
-
#show ⇒ Object
before_filter :token_blocked?, only: :show # check for an existing token before_filter :refresh_token, only: :show # create a new token.
Methods included from Helpers
#access_blocked?, #client_blocked?, #normalize_scope
Instance Method Details
#create ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'app/controllers/devise/oauth/authorizations_controller.rb', line 18 def create @client.granted! # section 4.1.1 - authorization code flow if params[:response_type] == "code" = Devise::Oauth::Authorization.create(client: @client, resource_owner: @resource_owner, scope: @scope) redirect_to (@client, , params[:state]) end # section 4.2.1 - implicit grant flow if params[:response_type] == "token" @token = Devise::Oauth::AccessToken.create(client: @client, resource_owner: @resource_owner, scope: scope) redirect_to implicit_redirect_uri(@client, @token, params[:state]) end end |
#destroy ⇒ Object
34 35 36 37 |
# File 'app/controllers/devise/oauth/authorizations_controller.rb', line 34 def destroy @client.revoked! redirect_to deny_redirect_uri(params[:response_type], params[:state]) end |
#show ⇒ Object
before_filter :token_blocked?, only: :show # check for an existing token before_filter :refresh_token, only: :show # create a new token
15 16 |
# File 'app/controllers/devise/oauth/authorizations_controller.rb', line 15 def show end |