Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Customize grant flows per application: config doorkeeper grant_flows passing a block. #1245

Closed
phlegx opened this issue Apr 19, 2019 · 4 comments

Comments

@phlegx
Copy link

phlegx commented Apr 19, 2019

Hi!

Can I pass a block to:

Doorkeeper.configure do
  ...
  grant_flows %w[authorization_code client_credentials]
end

like in custom_access_token_expires_in:

Doorkeeper.configure do
  ...
  custom_access_token_expires_in do |context|
    context.client.some_method
  end
end

Passing a block to grant_flows can help setting up different grant flows per application. Example:

Doorkeeper.configure do
  ...
  grant_flows do |client|
    client.available_grant_flows
  end
end
@nbulaj
Copy link
Member

nbulaj commented Apr 19, 2019

Hi @phlegx . It's impossible at the moment. Also this configuration option is designed for the entire server and knows nothing about applications (clients). It defines grant flows supported by your server

@phlegx
Copy link
Author

phlegx commented Apr 19, 2019

Hi @nbulaj. But can be added as feature?

Yes, the server is one, but in Doorkeeper I can add many applications. Why should every application have all the default grant flows? Single application, single configuration, multiple applications, multiple configurations. I mean, why there are context blocks for custom_access_token_expires_in and use_refresh_token? Because they are useful to have better config granularity. The same could be very useful for grant_flows and other config parameters.

@phlegx
Copy link
Author

phlegx commented Apr 19, 2019

Found issue #1207 with the same feature request!

@phlegx phlegx changed the title Config doorkeeper grant_flows passing a block which accepts client. Customize grant flows per application: config doorkeeper grant_flows passing a block. Apr 19, 2019
@nbulaj
Copy link
Member

nbulaj commented Aug 1, 2019

Landed in master with #1286

@nbulaj nbulaj closed this as completed Aug 1, 2019
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants