我正在尝试将邮递员配置为“获取新访问令牌”函数,以便在调用资源之前检索令牌。我使用FOSOAuthServerBundle与邮递员请求令牌
这是我security.yml
# To get started with security, check out the documentation:
# http://symfony.com/doc/current/security.html
security:
encoders:
FOS\UserBundle\Model\UserInterface: sha512
providers:
fos_userbundle:
id: fos_user.user_provider.username
firewalls:
oauth_token: # Everyone can access the access token URL.
pattern: ^/oauth/v2/token
security: false
api:
pattern: ^/ # All URLs are protected
fos_oauth: true # OAuth2 protected resource
stateless: true # Do no set session cookies
anonymous: false # Anonymous access is not allowed
在窗口,在这里我把我看到了这条线的认证信息
回调URL https://www.getpostman.com/oauth2/callback 把它设为您的应用设置页面中的回叫网址。
theese是身份验证信息:
Auth URL: https://{{url}}/api/web/app_dev.php/oauth/v2/auth
Access Token URL: https://{{url}}/api/web/app_dev.php/oauth/v2/token
Client ID: {{client_id}}
Client Secret: {{client_secret}}
Grant Type: Client Credentials
其中{{URL}},{{CLIENT_ID}}和{{client_secret}}是邮差的环境变量。
我哪里错了?
谢谢。
对不起,我迟到的答案。我收到的消息是 '从client_credentials流获取访问令牌时出错。无法发送请求。“# –
我发现在yout令牌网址'topken'中存在拼写错误,请确保所有值都正确输入,没有任何错误。 –
谢谢。不,它只是答案中的一个错字。我很快就会解决的。 –