1
我很努力使郵遞員和Google Apps Admin Sdk之間的oauth2工作。我已經在谷歌控制檯創建一個客戶端應用程序,並設置授權的重新導向URI來https://www.getpostman.com/oauth2/callback
和是我在郵遞員的設置如下使用postman + oauth2訪問Google Apps Admin SDK
Auth URL - https://accounts.google.com/o/oauth2/v2/auth
Access Token URL - https://www.googleapis.com/oauth2/v4/token
Client Id - some id here
Client Secrent - some secret here
Scope - https://www.googleapis.com/auth/admin.directory.user.readonly
Token Name - Google
Grant Type - Authorization Code
Request Access Token Locally - Checked
這將返回一個令牌 - xyz
- 在登錄後
我做一個GET
請求與令牌的URL
https://www.googleapis.com/admin/directory/v1/users?key=xyz
我得到的錯誤是低於
{
"error": {
"errors": [
{
"domain": "global",
"reason": "required",
"message": "Login Required",
"locationType": "header",
"location": "Authorization"
}
],
"code": 401,
"message": "Login Required"
}
}
從我讀過的這個應該可以工作。我還有哪些地方需要登錄?我究竟做錯了什麼?