修复: doorkeeper 无法生成jwt token

This commit is contained in:
2022-06-17 18:33:37 +08:00
parent 8f45bcf959
commit 21ccedab9c
4 changed files with 112 additions and 88 deletions

View File

@@ -7,7 +7,7 @@ Doorkeeper.configure do
# This block will be called to check whether the resource owner is authenticated or not.
resource_owner_authenticator do
raise "Please configure doorkeeper resource_owner_authenticator block located in #{__FILE__}"
# raise "Please configure doorkeeper resource_owner_authenticator block located in #{__FILE__}"
# Put your resource owner authentication logic here.
# Example implementation:
User.find_by(id: session[:www_user_id]) || redirect_to(new_user_session_url)
@@ -228,7 +228,7 @@ Doorkeeper.configure do
# `grant_type` - the grant type of the request (see Doorkeeper::OAuth)
# `scopes` - the requested scopes (see Doorkeeper::OAuth::Scopes)
#
# use_refresh_token
use_refresh_token
# Provide support for an owner to be assigned to each registered application (disabled by default)
# Optional parameter confirmation: true (default: false) if you want to enforce ownership of
@@ -304,7 +304,7 @@ Doorkeeper.configure do
#
# You can completely disable this feature with:
#
# allow_blank_redirect_uri false
allow_blank_redirect_uri true
#
# Or you can define your custom check:
#
@@ -444,6 +444,9 @@ Doorkeeper.configure do
# skip_authorization do |resource_owner, client|
# client.superapp? or resource_owner.admin?
# end
skip_authorization do
true
end
# Configure custom constraints for the Token Introspection request.
# By default this configuration option allows to introspect a token by another
@@ -540,7 +543,7 @@ Doorkeeper::JWT.configure do
# Set the encryption secret. This would be shared with any other applications
# that should be able to read the payload of the token. Defaults to "secret".
secret_key ENV['JWT_SECRET']
secret_key ENV['JWT_SECRET'] || "forgeplus"
# If you want to use RS* encoding specify the path to the RSA key to use for
# signing. If you specify a `secret_key_path` it will be used instead of