google oauth2 - GMAIL API - Does it support access using service accounts and a single access token -
does gmail api support service accounts?
i have tried using service accounts access tokens, when using access token, "failed precondition" error.
on searching, found error bacause service account not have gmail mailbox, should using "sub" field in jwt user in domain.
however, when using sub field , authorizing service account gmail scopes, not access token. says "invalid grant, bad request"
any appreciated.
update: have managed token when using sub field , using token make requests.
however, cannot use 1 token access data users. delegating domain wide access mean me can 1 token , access users data.
currently, need use service account , each user in sub field access tokens each user spearately
you need make single auth call sub= each user want access token before call gmail api different user. how oauth2 domain-wide delegation works: https://developers.google.com/identity/protocols/oauth2serviceaccount
the "one token can access users in domain" horrible security practice google apis phasing out (imagine if token gets phished!).
Comments
Post a Comment