在 gmail 授权中,根据 google 文档如何通过重定向 url 生成代码?

In gmail authorization, as per google doc how code can be generated by redirect url?

根据Google doc:

Handling authorization requests

When a user loads your application for the first time, they are presented with a dialog to grant permission for your application to access their Gmail account with the requested permission scopes. After this initial authorization, the user is only presented with the permission dialog if your app's client ID changes or the requested scopes have changed.

Authenticate the user

This initial sign-in returns an authorization result object that contains an authorization code if successful.

但无法获取如何处理授权流程?它有端点吗?

我得到了答案, 要求: https://accounts.google.com/o/oauth2/auth?client_id=*****.apps.googleusercontent.com&redirect_uri=https://www.msn.com&scope=https://mail.google.com/&response_type=code&access_type=offline&prompt=consent

在这里,确保您在同意屏幕中指定了范围。

它将重定向用户以授予对 gmail 范围的访问权限,之后您将被重定向到 msn url。 url 本身包含将进一步用于获取访问令牌的代码。您获得的代码将只使用一次。