Use a customized login flow to authenticate users
Generate a private key
Create a login flow
/login/jwt-callback
path of your docs, including the JWT as the hashConfigure your Authentication settings
docs.foo.com
. I want my docs
to be completely separate from my dashboard (or I don’t have a dashboard at all).
To set up authentication with Mintlify, I go to my Mintlify dashboard and generate a
JWT secret. I create a web URL https://foo.com/docs-login
that initiates a login flow
for my users. At the end of this login flow, once I have verified the identity of the user,
I create a JWT containing the user’s custom data according to Mintlify’s specification.
I use a JWT library to sign this JWT with my Mintlify secret, create a redirect URL of the
form https://docs.foo.com/login/jwt-callback#{SIGNED_JWT}
, and redirect the user.
I then go to the dashboard settings and enter https://foo.com/docs-login
for the
Login URL field.
Here’s what the code might look like:
/quickstart
)
redirect
query parameter
https://docs.foo.com/quickstart
https://foo.com/docs-login?redirect=%2Fquickstart
redirect
parameter in your JWT callback URL to send users to their intended destination:
https://docs.foo.com/login/jwt-callback?redirect=%2Fquickstart#{SIGNED_JWT}