0
我正在測試使用Playground編寫的OAuth2服務器。 完整配置網址是here。OAuth2 Playground - 令牌交換失敗,DNS查找錯誤
步驟1(授權許可)完美地工作。在Chrome我可以看到這個請求:
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 /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
尋找在網絡I可以看出:
POST https://developers.google.com/oauthplayground/exchangeAuthCode
與此體:
{"token_uri":"https://localhost:8080/oauth2/api/token","client_id":"acme1","client_secret":"secret","code":"5kns7"}
是這是如何打算工作的? OAuth服務器交互,至少對於令牌交換,已將置於公共網絡上?
如果第2步可以在本地服務器上執行,這將非常有用。有誰知道我們可以如何做到這一點?
感謝