0
votes

I'm trying to configure Postman to " Get New Access Token" function in order to retrieve a token before calling a resource. I'm using FOSOAuthServerBundle

this is my 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

In the window where i put the authentication information I saw this line

Callback URL https://www.getpostman.com/oauth2/callback Set this as the callback URL in your app settings page.

theese are the authentication informations:

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

where {{url}}, {{client_id}} and {{client_secret}} are Postman's environment variables.

New Access Token page example

Where I'm wrong?

Thanks.

2

2 Answers

0
votes

Callback URL https://www.getpostman.com/oauth2/callback Set this as the callback URL in your app settings page.

This message has nothing to do with your access token retrieval. Once you entered all the authentication info, were you able to get the access token when you click Request Token button? If not what was the error message

enter image description here

0
votes

Sorry for my late answer.The message I've received is

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

This is a screenshot.