1

I have been trying to set up a page using Angular, where an admin with requisite permissions can add users using Firebase 'username' and 'password' authentication.

I have been lurking around stackoverflow for answers. I have found : Firebase create user "manually" and this: Firebase kicks out current user

Going by the answers, I think they have achieved this by not using the Admin SDK and by bypassing the re-authentication that happens after a user is registered.

Problem is, I am a newbie and I am working in Angular. I was told to add the API keys and everything in the environment.ts and then add the Initialize method to the app.module.ts. How do I go about this special use case? The procedure I follow could be wrong altogether. I am trying to wrap my head around this. Any help or a link to any resource online would be greatly appreciated. Thanks.

4

1 Answer 1

1

Well in the end it goes this way.

  • Keep the regular initilize.app method in your app.module.ts.

  • Initialize the App again as a separate service (or wherever) with a separate name, which would be something like initialize.app(config,"secondary"); - The "secondary" thing is important. Call it any name, I just added it as secondary. Add users with this initialization. config is your API key and other files you get from firebase.

  • Because of this "secondary" initialization there would not be any re-authentication of the user.

Phew. Thats like two days of work. lol.

Sign up to request clarification or add additional context in comments.

1 Comment

That was the same thing that was being said in the links that I gave in the question earlier. But, github.com/angular/angularfire2/issues/761 helped me out as I was confused where to add the secondary initialization in angular, whether it is the app.module or elsewhere.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.