如何使用OIDC提供商添加Firebase auth oauthprovider添加其他范围 我已经在我的Google Identity平台中添加了自定义OIDC提供商。我可以成功地对其进行身份验证,所以我知道提供商配置不是问题,而是由于某种原因,当我尝试...

问题描述 投票:0回答:2

通过重定向

firebase.auth().getRedirectResult().then(function(result) { if (result.credential) { // This gives you the OAuth Access Token for that provider. var token = result.credential.accessToken; } var user = result.user; }); // Start a sign in process for an unauthenticated user. var provider = new firebase.auth.OAuthProvider('google.com'); provider.addScope('profile'); provider.addScope('email'); firebase.auth().signInWithRedirect(provider);

javascript firebase-authentication openid-connect angularfire google-identity
2个回答
0
投票
通过弹出窗口

var provider = new firebase.auth.OAuthProvider('google.com'); provider.addScope('profile'); provider.addScope('email'); firebase.auth().signInWithPopup(provider).then(function(result) { // This gives you the OAuth Access Token for that provider. var token = result.credential.accessToken; // The signed-in user info. var user = result.user; });

似乎Google Identity平台仅通过openid-configuration
Scopes_supported
字段传递定义的范围。但是我认为,提供功能不应该那样

{
 ...
 "scopes_supported": [
  "openid",
  "email",
  "profile"
 ],
 ...
}

0
投票

示例:

https://accounts.google.com/.well-nown/openid-configuration

https://login.salesforce.com/.well-nown/openid-configuration

https://login.windows.net/common/.well-nown/openid-configuration

最新问题
© www.soinside.com 2019 - 2025. All rights reserved.