Hello !
Random questions for people who are working on a react app, with python and a mysql database:
• for which reasons did you choose react-sdk, python-sdk or flows ?
• did your choice allow you to communicate easily with your database ? (like, registering someone, or later retrieve user infos once they are identified)
• did you manage to add some fields in your sign-up form, and send them to your database ?
• is "JWT" the keyword I should investigate regarding those questions ?
Thanks in advance for sharing !
b
breezy-evening-56597
05/04/2023, 3:37 PM
Hi Joe,
The integration approaches - flows v.s frontend SDK vs. backend SDK are described here:
https://docs.descope.com/build/
• In general, this depends on what you are building and to what extent your sign-up and sign-in experience is complicated. For the popular frameworks (React frontend and Python backend), we recommend using the Flows in the frontend and our Python SDK in the backend to validate sessions and acquire the tenants, roles, and claims from the JWT.
• Yes. We support custom attributes. You can add attributes in the Users page (top tab) and then add them as part of the user's object and in the JWT.
• JWT is the standard way to pass authenticated user information between the client and the server. So once the user completes the sign-in process - the JWT is placed on the browser and then should be passed to the backend to be validated by our SDK.
Recommend watching the following tutorials that will give you a good overview of the capabilities and how to use them:
• Descope fundamentals -
Hello Gilad, thank you for your message !
I'm building an ear training web app. I think the sign-in process will be straight-forward, but the sign-up will be trickier (at least, for me):
A subscriber will have to go through Stripe or Paypal in order to pay a monthly/yearly fee. The "active subscription" status will be stored in my DB, and verified at each sign-in to grant access or not.
Thank you for the videos; I already watched them (and re-watched them), now I just have to connect the dots 😅
Sometimes, the doc isn't really newbie-friendly, although I understand that an authentication process, for devs, is only using concepts and procedures they already know. A little "copy this in the <head> section of thisFile.js" here and there would probably be helpful for some !
That said, I'm impressed by the reactiveness of you all, and the time you give to help others. Thanks 🙏
b
breezy-evening-56597
05/06/2023, 6:35 AM
Hi Joe, sounds like a very interesting app and use case!
One option to implement such a use case -
1. Add a subscription field as a custom attribute
2. Include that as a claim in the JWT
3. in your app, whenever you detect a user without an active subscription (no claim in JWT) - you redirect them to the payment page to create a subscription.
4. When a subscription is set up - your backend calls our management SDK to update the subscription field so any subsequent user access will include it.
👍 1
a
abundant-afternoon-83661
05/06/2023, 7:18 AM
Thank you, I'm saving this answer for a bit later;
For now the sign-in flow is integrated in app.js (I hesitated between this or index.js, and rolled the dice). Next steps:
• Validate the session with python-sdk
• See if I can use the roles to determine who has access to which react components.
I'll get back if I'm stuck. Thank you, again !