Google Oauth 2.0使用端点,YouTube ReadOnly范围

发布于 2025-01-30 10:55:01 字数 1154 浏览 3 评论 0原文

我正在使用新的oauth2endpoint访问YouTube readOnly许可,并且还可以在 next.js 中授权使用firebase auth授权

 // Parameters to pass to OAuth 2.0 endpoint.
    var params = {
      client_id: process.env.NEXT_PUBLIC_GOOGLE_CLIENT_ID,
      redirect_uri: 'http://localhost:3000/authorize/',
      response_type: 'token',
      scope: 'https://www.googleapis.com/auth/youtube.readonly',
      include_granted_scopes: 'true',
      state: 'authorized',
    };

响应

asPath:"/authorize#state=authorized&access_token=ya29.a0ARrdaM_Z-DtT8QirWCb9phht7k8ePDDPzwSmvtAkm0ecv18KkLg71LeFlURKO6rLfsT66MxRC9SgkenqN7SHPg89Hp5ESpzDBsaTjeJTbx24g-_-18inaSvnmmKTzz68XLrnryyehFGn7-LGozKwVOe9RsZg&token_type=Bearer&expires_in=3599&scope=email%20profile%20https://www.googleapis.com/auth/userinfo.email%20https://www.googleapis.com/auth/userinfo.profile%20openid%20https://www.googleapis.com/auth/youtube.readonly&authuser=0&prompt=consent"

如何获得查询(/授权?)而不是(/授权#)

回调URL是http:// localhost:3000/授权/

I am using new oauth2Endpoint to access youtube readonly permission and also Token to authorize with firebase auth in Next.js

 // Parameters to pass to OAuth 2.0 endpoint.
    var params = {
      client_id: process.env.NEXT_PUBLIC_GOOGLE_CLIENT_ID,
      redirect_uri: 'http://localhost:3000/authorize/',
      response_type: 'token',
      scope: 'https://www.googleapis.com/auth/youtube.readonly',
      include_granted_scopes: 'true',
      state: 'authorized',
    };

Response

asPath:"/authorize#state=authorized&access_token=ya29.a0ARrdaM_Z-DtT8QirWCb9phht7k8ePDDPzwSmvtAkm0ecv18KkLg71LeFlURKO6rLfsT66MxRC9SgkenqN7SHPg89Hp5ESpzDBsaTjeJTbx24g-_-18inaSvnmmKTzz68XLrnryyehFGn7-LGozKwVOe9RsZg&token_type=Bearer&expires_in=3599&scope=email%20profile%20https://www.googleapis.com/auth/userinfo.email%20https://www.googleapis.com/auth/userinfo.profile%20openid%20https://www.googleapis.com/auth/youtube.readonly&authuser=0&prompt=consent"

How to get results in query (/authorize?) instead of (/authorize#)

Callback URL is http://localhost:3000/authorize/

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文