我使用Symfony 5和oauth2 bundle trikoderoauth2-bundle在一个web应用程序中建立了一个oauth2服务器,以便登录其他客户站点的用户。当客户端网站激活授权请求时,我得到这个错误。我读了Stackoverflow上对这个问题的回答,但他们回答的是Laravel的问题,而不是Symfony 5.这里是.env文件。
###> trikoderoauth2-bundle ####.
OAUTH2_STRING_PASSWORD=4YUuCt############x2wsEdg。
OAUTH2_ENCRYPTION_KEY=def###############################cbf
下面是configpackagestrikoder_oauth2.yaml文件。
trikoder_oauth2:
authorization_server:
private_key: /var/oauth/private.key # Change this
private_key_passphrase: null # Passphrase of the private key, if any
encryption_key: '%env(string:OAUTH2_ENCRYPTION_KEY)%' # (Optional) Change this
encryption_key_type: "defuse"
# How long the issued access token should be valid for.
# The value should be a valid interval: http://php.net/manual/en/dateinterval.construct.php#refsect1-dateinterval.construct-parameters
access_token_ttl: PT1H
# How long the issued refresh token should be valid for.
# The value should be a valid interval: http://php.net/manual/en/dateinterval.construct.php#refsect1-dateinterval.construct-parameters
refresh_token_ttl: P1M
# How long the issued auth code should be valid for.
# The value should be a valid interval: http://php.net/manual/en/dateinterval.construct.php#refsect1-dateinterval.construct-parameters
auth_code_ttl: PT10M
resource_server:
public_key: /var/oauth/public.key # Change this
persistence:
doctrine: null
public.key和private.key在varauth路径中,客户端是在oauth2_client表中创建的,有两个参数identifier和secret.Thanks a lot for your response!
是不是你的配置中出现了错别字?
变种oauthprivate.key而不是varauth私钥就像你说的那样?