0
votes

i have an angular app which uses Firebase authentication - email provider. Works just the way, application wants it.

Now, i have a new customer who wants to use the application. The only issue is that he is not keen on having email addresses / mobile numbers as login identity. He wants to create his own usernames for their users to login. the username will be a string something like:

md, accounts, branchmanager, customer_with_weird_requirements etc

for attacking this situation, i have two approaches in mind.

  1. changing the provider to customauth provider, bring in jwt and have a back-end endpoint
  2. making the user only enter the username and suffix a common domain url like @abc.com and mock an emailauth provider

the following are the problem i have using the approaches

  • the app is fully powered by firestore and its web sdks. i need to start a new cloud function for creating the endpoint. well, not difficult but for just one module, we have a architectural change which i am not a fan

  • not the ideal way to handle auth module. also, reset password will not work as the rest link will be sent to the [email protected] which doesn't exist in the first place.

Is there any way to use the providers available in firebase auth, with maybe basic tweaking, which doesn't make your email/mobile no mandatory?

1

1 Answers

0
votes

What you want is beyond what the built-in providers of Firebase Authentication can be configured to handle. You'll have to create you own provider to support you needs.

Keep in mind that Firebase has some great examples of how to build a custom provider, like this username/password provider.