Skip to content
Permalink
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
36 lines (27 sloc) 1.08 KB
description
How to use `skip_authorization` configuration option

Skip Authorization

Users using the Authorization Code Flow will see this screen after logging in:

Under some circumstances, you might want to let users skip the screen above and have applications auto-approved (for example, when dealing with a trusted application).

This is possible via a configuration option skip_authorization which takes either true or false:

{% code-tabs %} {% code-tabs-item title="config/initializers/doorkeeper.rb" %}

skip_authorization do
  true
end

{% endcode-tabs-item %} {% endcode-tabs %}

If you need more control over which application or user can skip the authorization, the resource owner and client will be available as block arguments:

{% code-tabs %} {% code-tabs-item title="config/initializers/doorkeeper.rb" %}

skip_authorization do |resource_owner, client|
  client.superapp? || resource_owner.admin?
end

{% endcode-tabs-item %} {% endcode-tabs %}

You can’t perform that action at this time.