2017-08-28 5 views
0

私は、リソースを呼び出す前にトークンを取得するために、「新しいアクセストークンを取得する」機能にPostmanを設定しようとしています。私は、これは私が郵便受けとトークンをリクエスト

コールバックURL https://www.getpostman.com/oauth2/callback のようにこれを設定して、この行を見て、認証情報を置くウィンドウで

# 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 

私のsecurity.ymlであるFOSOAuthServerBundle

を使用していますコールバックURLをアプリ設定ページに表示します。

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}}ですが、郵便配達の環境変数:

theeseは、認証情報です。私が間違っている

New Access Token page example

ありがとうございました。

答えて

0

コールバックURL https://www.getpostman.com/oauth2/callbackアプリ設定ページの コールバックURLに設定します。

このメッセージは、アクセストークンの取得とは関係ありません。すべての認証情報を入力したら、Request Tokenボタンをクリックするとアクセストークンを取得できましたか?そうでない場合は、何が私が受け取った私の後半answer.Theメッセージのため申し訳ありませんが、エラーメッセージ

enter image description here

+0

ご迷惑をおかけして申し訳ありません。私が受け取ったメッセージは 'client_credentialsからのアクセストークンの取得中にエラーが発生しました。要求を送信できませんでした。 –

+0

あなたのトークンURL「topken」にスペルミスがあり、すべての値が間違いなく正しく入力されていることを確認しています。 –

+0

ありがとうございます。いいえ、それは答えの本文の唯一のタイプミスです。私はすぐに修正します。 –

0

Error getting access token from client_credentials flow. Could not send requestですました。

This is a screenshot.

関連する問題