You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Create a client app that has read and write scopes: #<OauthApplication:0x0000ffff8c614450 id: 1, name: "client_app_0", uid: "***", secret: "***", redirect_uri: "http://localhost:3001/oauth/callback", scopes: "read write", confidential: true, created_at: Thu, 25 Jul 2024 10:46:30.141147000 UTC +00:00, updated_at: Mon, 26 Aug 2024 15:53:34.834773000 UTC +00:00>
Do the standard doorkeeper.rb configuration, enabling refresh tokens (see below).
Create a client request of this form: get '/auth' do settings.logger.info "received request for /auth path" redirect settings.client_external.auth_code.authorize_url( redirect_uri: REDIRECT_URI_EXTERNAL, scope: "read write" ) end
The more detailed the issue, the more likely that we will fix it ASAP.
Don't use GitHub issues for questions like "How can I do that?" —
use StackOverflow
instead with the corresponding tag.
Expected behavior
Tell us what should happen
The response to the client should have both an access token and a refresh token.
Actual behavior
Tell us what happens instead
Only an access token is returned.
If my client app request a single scope, i.e. only requests the scope or only requests the write scope, then the access token plus a refresh token is in the response.
But when the client requests both read and write scopes, then the access token is returned in the response, but the refresh token is not.
System configuration
You can help us to understand your problem if you will share some very
useful information about your project environment (don't forget to
remove any confidential data if it exists).
Doorkeeper initializer:
# config/initializers/doorkeeper.rbDoorkeeper.configuredo# ...orm:active_recordresource_owner_authenticatordoifuser_signed_in?ifrequest.path == "/oauth/authorize/native"# the /oauth/authorize/native path is only used for mobile devices# and so it is better to deactivate itredirect_toroot_path,alert: "You are not authorized to perform this action."elsecurrent_userendelsewarden.authenticate!(scope: :user)endendadmin_authenticatordo |_routes|
ifcurrent_userunlesscurrent_user.can_super_admin?redirect_toroot_path,alert: "You are not authorized to perform this action."endelsewarden.authenticate!(scope: :user)endendgrant_flows%w[authorization_codeclient_credentials]default_scopes:readoptional_scopes:writeenforce_configured_scopesaccess_token_expires_in30.daysreuse_access_tokenuse_refresh_tokenexpiry: 90.daysforce_ssl_in_redirect_urifalseend
Steps to reproduce
What we need to do to see your problem or bug?
Create a client app that has read and write scopes:
#<OauthApplication:0x0000ffff8c614450 id: 1, name: "client_app_0", uid: "***", secret: "***", redirect_uri: "http://localhost:3001/oauth/callback", scopes: "read write", confidential: true, created_at: Thu, 25 Jul 2024 10:46:30.141147000 UTC +00:00, updated_at: Mon, 26 Aug 2024 15:53:34.834773000 UTC +00:00>
Do the standard doorkeeper.rb configuration, enabling refresh tokens (see below).
Create a client request of this form:
get '/auth' do settings.logger.info "received request for /auth path" redirect settings.client_external.auth_code.authorize_url( redirect_uri: REDIRECT_URI_EXTERNAL, scope: "read write" ) end
The more detailed the issue, the more likely that we will fix it ASAP.
Don't use GitHub issues for questions like "How can I do that?" —
use StackOverflow
instead with the corresponding tag.
Expected behavior
Tell us what should happen
The response to the client should have both an access token and a refresh token.
Actual behavior
Tell us what happens instead
Only an access token is returned.
If my client app request a single scope, i.e. only requests the scope or only requests the write scope, then the access token plus a refresh token is in the response.
But when the client requests both read and write scopes, then the access token is returned in the response, but the refresh token is not.
System configuration
You can help us to understand your problem if you will share some very
useful information about your project environment (don't forget to
remove any confidential data if it exists).
Doorkeeper initializer:
Ruby version: ``
3.0.5
Gemfile.lock:
Gemfile.lock content
The text was updated successfully, but these errors were encountered: