doorkeeper
  • Doorkeeper Guides
  • Ruby on Rails
    • Getting Started
    • Routes
    • Configuration
    • Scopes
    • Securing the API
    • API Mode
    • PKCE Flow
    • Polymorphic Resource Owner
  • Grape
    • Grape
  • ORMs
    • Active Record
    • MongoDB
    • Sequel
    • Couchbase
  • Internals
    • Database Design
    • Internationalization (i18n)
    • Rake
    • Testing
    • Upgrading
    • Creating extensions
  • Security
    • Token and Application Secrets
  • Configuration
    • Models
    • Scopes
    • Skip Authorization
    • Other Configurations
    • Route Constraints and other integrations
Powered by GitBook
On this page

Was this helpful?

  1. Configuration

Skip Authorization

How to use `skip_authorization` configuration option

PreviousScopesNextOther Configurations

Last updated 6 years ago

Was this helpful?

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:

config/initializers/doorkeeper.rb
skip_authorization do
  true
end

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:

config/initializers/doorkeeper.rb
skip_authorization do |resource_owner, client|
  client.superapp? || resource_owner.admin?
end