Hi, I want to know if the if the flow below is pos...
# ask-a-descoper
n
Hi, I want to know if the if the flow below is possible with descope. If there is a better alternative I am ready to hear. 1. the user installs our app via a shopify marketplace (where he is authenticated there, and we trust that he is authenticated) (if you can refer me to one of your customer in the same case I will be more than happy) 2. when installation is done, the marketplace redirects the user into our backend api 3. we generate the user in our DB and will create the user in descope via the descope backend sdk. 4. we will use the descope sdk to make a login for this user (still in the backend code) 5. then we would like to redirect to our dashboard in a way that the user will be already authenticated. 6. I suppose that descope has a client middleware to check if the user is authenticated like auth0 has, and since we did the login in the backend we need a way to "inform" this middleware that the user is authenticated. Merci
s
Doing user create + login user - is fully supported from our backend sdks About point 5, "already authenticated" - this usually means just to pass along the JWT on cookie or req/response About point 6, you mean session JWT validation ? As a side note, we are working these days on Shopify connector, so would love to setup some call, to see if that connector can simplify work for you in any way
n
Hi @square-vr-55083, Thank you for your reply. About point 6, Yes so the user will be recognized as authenticated. How to do it via the descope client sdk ? just set a specific cookie and the client sdk will do the rest ? I will be happy to share our flow about shopify (we are not talking about login with shopify, this is a another flow. What we do is to create a user in our platform for shopify store owner so he will be able to use our platform directly without the need to manually create a user and a password)
s
n
One I did the login in the backend, what I need to send to the client ?
s
which client middleware are you using ? for React we have hooks (in React SDK) , so we might have something for your stack
n
In the client according to the link you sent, I need to set the sessionToken, the question is how to do it ? is it a simple cookie named DS (SESSION_TOKEN_KEY) ?
yes, we are using react
cookie named DS with SESSION_TOKEN and cookie named DSR for refresh token if you are not using cookies, by default we use local storage
maybe best we do a short call, sounds like we can cover the topics in a short call today
n
it will be very helpful.
what is your email ?
s
n
sent