LoginRadius / developer-authentication-demos

Awesome authentication demos using LoginRadius
MIT License
6 stars 10 forks source link

Create a user authentication demo in nodejs hapi framework #6

Closed vyasriday closed 4 years ago

vyasriday commented 4 years ago

Need to create a small user authentication demo using LoginRadius solution, Check our Demo Guidelines for how to make the authentication demo and Contributing Guidelines to know about the contribution flow.

Platform - NodeJS (latest stable version) Framework - Hapi (latest stable version) Code Folder - https://github.com/LoginRadius/developer-authentication-demos/tree/master/demos/nodejs/hapi

karmanya007 commented 4 years ago

I can take this one.

ashish8947 commented 4 years ago

Hello, @karmanya007 Thanks for your interest Please feel free to create a demo and let us know here once you raise a PR.

Also please go through https://www.loginradius.com/engineering/page/hacktoberfest2020 to get free swags from LoginRadius as well. Happy Coding :)

karmanya007 commented 4 years ago

👍

karmanya007 commented 4 years ago

@ashish8947 After successful authentication, what should be the return url. Is it the profile.html page?

ashish8947 commented 4 years ago

@karmanya007 Yes, after successful authentication you can show the user profile. For more information, you can check out our sample demo.

pareek-naren commented 4 years ago

@karmanya007 In General, return_url can be any URL where you want to handle the token and get the profile using sdk and display/utilize profile data as per the requirement. Also need to whitelist the domain (URL) in LoginRadius Dashboard under configuration -> Domain Whitelisting.

In case of our authentication demos, we've already created the frontend theme for this: so the return URL will be http://localhost:3000 in this case and you'll get the token here after successful authentication: http://localhost:3000?token=<access token>.

As @ashish8947 mentioned, Sample demo is here

Note: By default http://localhost would be whitelisted in LoginRadius Dashboard under configuration -> Domain Whitelisting.

karmanya007 commented 4 years ago

Done!!

karmanya007 commented 4 years ago

PR Opened.

karmanya007 commented 4 years ago

I have also completed the wrapper in restify framework. If you could merge this PR, I would open a new one.