-
Notifications
You must be signed in to change notification settings - Fork 8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Auth with firebase #1352
Comments
@phuclam85 we don't have any docs specifically on firebase, but you can start with the following suggestion akveo/nebular#61 (comment). |
I was able to do this by rewriting my own auth components based off the existing ones from nebular/auth. I got rid of the config and the default authProvider and simply used AngularFire2 instead. This also allowed me to get rid of the nebular AuthModule in the @core. After that you simply have to configure your routes to point to your new components. You can check this section to get you started: https://akveo.github.io/nebular/#/docs/auth/configuring-ui Doc on AngularFire2 as well: https://github.com/angular/angularfire2/blob/master/docs/install-and-setup.md |
There's a pull request open in the nebular project. akveo/nebular#90 |
@mathieu-neron do you have the source available for the same. Would like to leverage the same in our project. |
@tanwarsatya don't have much to show that is that much different from what is already present in nebular: https://github.com/akveo/nebular/tree/9f122e1c2716169ff2901c624f5108c403bb6917/src/framework/auth. Like I said just take the auth components from there. We personally moved these components (auth-block, login, register, rquest-password, reset-password, etc.) under
with its own auth.routes.ts module and added everything in the themes.modules.ts. Here's a quick code example for the login component. You will have to do some cleanup, since you don't want to use these services if you go the AngularFire2 way:
|
@mathieu-neron thanks a lot, i will follow the same path. |
@mathieu-neron Hi bud, how did you direct the app to go from the app-routing.module to the auth login page in @/theme/components/auth? |
@avdwalt same as with any other component, I simply created a path for each of my component+children. I also added an Authgard for any component where I wanted to protect access. Here's my routes constant for reference:
I think I also defined and used an auth.routes.ts in my @/theme/component/auth folder, but the path are the same, so it might be redundant. |
@phuclam85 take a look at ngx-auth-firebaseui 👍 It's easy to use and built for angular v5. Here is a live demo |
Hi, If you want to do it on your own try to follow these steps :
At this step login and register should work with email and password but not with the social link. Then :
I hope this will help you. Have a good day! |
Hi,
Thank you for connecting and sharing your knowledge with me.I really
appreciate that.
I am looking for the integration of ngx-admin with asp.net web api project.
Can you please let me know the correct steps to integrate this theme with
web api project.
Thanks and Regards
Ashutosh Parashar
…On Tue, Apr 10, 2018 at 7:39 PM, GianlucaRi ***@***.***> wrote:
Hi,
I have integrated Firebase Auth in ngx-admin for my project and published
just the auth part yesterday.
You can take a look here : https://github.com/GianlucaRi/ngx-admin.
If you want to do it on your own try to follow these steps :
- Install angularfire2 and firebase.
- Add firebase to app.module.ts
- Create your own auth provider that calls the firebase auth service.
- Copie the pages from akveo/ as explained by @nnixaa
<https://github.com/nnixaa>
- Remove the NbAuthService but KEEP the config injection. ***@***.***
<https://github.com/Inject>(NB_AUTH_OPTIONS_TOKEN) config is important)
- Fix the rooting as described by @mathieu-neron
<https://github.com/mathieu-neron>
At this step login and register should work with email and password but
not with the social link.
RequestPassword should be work completely. The ResetPassword won't work
yet.
Then :
- Fix the social link : by editing your .module.ts and take a look
here https://github.com/GianlucaRi/ngx-admin/blob/master/src/app/
auth/login/login.component.html
<https://github.com/GianlucaRi/ngx-admin/blob/master/src/app/auth/login/login.component.html>
- Go to firebase in the auth section you have a template option to
change to make it point to the reset password page.
- Finally : extact the "code" in the link (parameter oobCode) from the
url to secure the password change.
I hope this will help you.
Have a good day!
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#1352 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AjnY2vzAIfIDiPjqg3sF5Z4wC7XrYwOTks5tnL0FgaJpZM4QN_Pv>
.
|
@GianlucaRi : Integrated in my project,Working well so far. Thanks for your efforts.
|
Hi @SanjeevKarki !
If you need more explanation feel free to ask me ;) Have a good day, Gianluca Ricciardelli |
Hi @GianlucaRi Thanks for your response. Thanks |
Hi @GianlucaRi, your explanation and code are good, but it is not working on last version of ngx-admin with angular 6, I am in troubles with the guard services, I even freezes the browser. |
@GianlucaRi how were you able to access the |
Yes there was a bug, its fixed in Ver. 4.1.1 , now you can import
|
Any news? is it now possible to use firebase with nebular auth? |
Seems it is being worked on and has a pull request here: |
So it seems it has been merged to master now on nebular: So I am assuming until ngx-admin merges the latest changes to master that you can just update the version of nebular auth in your package.json to "@nebular/auth": "5.1.0" then npm update? |
Can you help me using auth with firebase?
The text was updated successfully, but these errors were encountered: