asp.net identity - How to use an identifier other than "email" for users in Firebase Authentication + OIDC - S

I've set up Firebase Authentication for my app with an OIDC provider. In this OIDC provider, the e

I've set up Firebase Authentication for my app with an OIDC provider. In this OIDC provider, the email address isn't required to be unique. For instance, users from the same company could share their company's email address. When I log in to the app through Firebase Authentication however, Firebase uses the email as the "identifier". This means that a different user with the same email ends up sharing the same Firebase Authentication user.

Is it possible to tell Firebase Authentication to use something else as the identifier (eg. the "sub")?

Alternatively, could there be any additional setup I need to do in our OIDC provider the signal to Firebase what it should use as an identifier? The provider uses ASP.NET Identity + OpenIDDict.

Thanks.

I've set up Firebase Authentication for my app with an OIDC provider. In this OIDC provider, the email address isn't required to be unique. For instance, users from the same company could share their company's email address. When I log in to the app through Firebase Authentication however, Firebase uses the email as the "identifier". This means that a different user with the same email ends up sharing the same Firebase Authentication user.

Is it possible to tell Firebase Authentication to use something else as the identifier (eg. the "sub")?

Alternatively, could there be any additional setup I need to do in our OIDC provider the signal to Firebase what it should use as an identifier? The provider uses ASP.NET Identity + OpenIDDict.

Thanks.

Share Improve this question asked Nov 20, 2024 at 13:17 katkakkatkak 3361 silver badge11 bronze badges
Add a comment  | 

2 Answers 2

Reset to default 0

Firebase has a configuration option that determines whether email addresses have to be unique in a project. It's on by default, but if you turn it off you can have multiple users with the same email address.

I fixed this by passing a custom scope from my clients that use Firebase Auth.

The OIDC provider then looks for that scope and when it is present, it does not provide the email claim. This seems to trigger Firebase Auth to use the name claim instead, which in my case is sufficiently unique.

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1742353977a4428069.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信