raystack / frontier

Frontier is an all-in-one user management platform that provides identity, access and billing management to help organizations secure their systems and data. (Open source alternative to Clerk)
https://raystack-frontier.vercel.app/
Apache License 2.0
269 stars 34 forks source link

Need a guidance to describe how to make a integrated authentication for my own app with frontier. #692

Open micli opened 3 months ago

micli commented 3 months ago

I saw frontier description on home page that frontier is a identity and access management tool. I thought that frontier can take responsibility of authentication in every REST API call/ web page access. How can may own app integrated frontier when REST API resquest contains bearer token? I checked documentation seems there is no specific article regarding this.

Thanks!

kushsharma commented 3 months ago

You can authenticate in Frontier in multiple ways, starting with email-based OTP as the easiest. Mail configs needs to be set up for it to work.

Once configured, use /auth/register endpoint to specify email as a strategy and pass the required values. It will give you a state token and send an OTP to email. To start a session, provide this state and the OTP from email to /auth/callback endpoint. This will set the session cookies in your REST call starting the session. If the call is made from browser, the cookies will be persisted in browser and all subsequent calls to frontier will automatically send the cookies to authenticate the user.