私は、リソースを呼び出す前にトークンを取得するために、「新しいアクセストークンを取得する」機能に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は、認証情報です。私が間違っている
?
ありがとうございました。
ご迷惑をおかけして申し訳ありません。私が受け取ったメッセージは 'client_credentialsからのアクセストークンの取得中にエラーが発生しました。要求を送信できませんでした。 –
あなたのトークンURL「topken」にスペルミスがあり、すべての値が間違いなく正しく入力されていることを確認しています。 –
ありがとうございます。いいえ、それは答えの本文の唯一のタイプミスです。私はすぐに修正します。 –