首页 文章

请求邮递员令牌

提问于
浏览
0

我正在尝试将Postman配置为“获取新访问令牌”功能,以便在调用资源之前检索令牌 . 我正在使用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

在我放置认证信息的窗口中,我看到了这一行

回拨网址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

其中{},{}和{}是Postman的环境变量 .

New Access Token page example

哪里我错了?

谢谢 .

2 回答

  • 0

    回拨网址https://www.getpostman.com/oauth2/callback将其设置为应用设置页面中的回调网址 .

    此消息与您的访问令牌检索无关 . 输入所有身份验证信息后,您是否能够在单击“请求令牌”按钮时获取访问令牌?如果没有,那么错误信息是什么

    enter image description here

  • 0

    对不起我迟到的回答 . 我收到的信息是

    Error getting access token from client_credentials flow. Could not send request .

    This is a screenshot.

相关问题