私はPlaygroundを使用して作成したOAuth2サーバーをテストしています。 完全設定URLはhereです。OAuth2 Playground - DNSルックアップエラーでトークンの交換が失敗する
ステップ1(認可付与)は完全に機能します。私が見ることができるネットワークを見てみると
POST /oauth2/api/token HTTP/1.1
Host: localhost:8080
Content-length: 153
content-type: application/x-www-form-urlencoded
user-agent: google-oauth-playground
code=2l0vf6n&redirect_uri=https%3A%2F%2Fdevelopers.google.com%2Foauthplayground&client_id=acme1&client_secret=secret&scope=&grant_type=authorization_code
HTTP/1.1 400 Bad Request
Content-length: 115
Content-type: text/plain
An error occured while connecting to the server: DNS lookup failed for URL: https://localhost:8080/oauth2/api/token
:で失敗し
GET https://localhost:8080/oauth2/api/authorize?scope=fp&redirect_uri=https%3A%2F%2Fdevelopers.google.com%2Foauthplayground&response_type=code&client_id=acme1&access_type=offline
ステップ2(トークンの交換):クロームで、私はこの要求を見ることができます。この体で
POST https://developers.google.com/oauthplayground/exchangeAuthCode
を:
{"token_uri":"https://localhost:8080/oauth2/api/token","client_id":"acme1","client_secret":"secret","code":"5kns7"}
isこれはどのように働くことを意図していますか? OAuthサーバーとのやりとりは、少なくともトークン交換の場合はが公衆ネットワーク上にあるになっていますか?
手順2をローカルサーバーに対して実行できる場合は、非常に便利です。誰も私たちがこれを達成する方法を知っていますか?
おかげ