Hello
I'm trying to implement a custom authentication flow
I went through the steps here: Custom API authentication | Retool Docs
But I dont understand what should come next, once a user has clicked the login button, the modal form has opened, he entered the email/password, a request has been sent to our identity server, a token as been given, saved it to a variable and put it in the headers for the next calls
what now? how do I actually use it? I need to save the user data somewhere, redirect the user to a new page, have a context of him being logged in in the rest of the application
I dont seem to understand
Hello @Tal_Adari,
Once your identity provider returns an access token to Retool, this token will automatically be sent in the headers of query requests to resources that require their authentication via the identity provider to approve the query request!
As resources have auth options, these are being protected by checking queries for the needed token for a user to run requests to that query.
This will not be useful for storing user data. Our automated token storage will not be accessible.
If you want to grab the information the user entered into the modal form, you will need to pass that into a front end variable for you to hold and use. Or use a POST method to send the user login information to a database to store and for you to then fetch with a query as needed.
If you need to redirect a user to a new page, you will have to get the users info from either the variable you created from the login info, the data you fetched from a DB storing login info, or from the current user object.