Google Oauth 2.0使用端点,YouTube ReadOnly范围
我正在使用新的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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论