jacquesy
KKinde
•Created by LIFE on 12/6/2023 in #💻┃support
Resolving auth in back-end (.NET) with token retrieved from front-end (React)
@LIFE - This is pretty much exactly what I've done in my solution. You can now protect the whole controller or a specific action method using the
[Authorize(Policy = "admin")]
attribute.49 replies
KKinde
•Created by LIFE on 12/6/2023 in #💻┃support
Resolving auth in back-end (.NET) with token retrieved from front-end (React)
49 replies
KKinde
•Created by LIFE on 12/6/2023 in #💻┃support
Resolving auth in back-end (.NET) with token retrieved from front-end (React)
Hi @LIFE,
Do you need the actual access token in your controller action, or do you just need the details of the authenticated user?
Here's how I validate and use the access token (provided in the
Authorization
header in the request from my React app) -
In startup.cs
:
Now in your controller action you should be able to see HttpContext.User
populated with properties for the authenticated user - their userId (the sub
claim), their Kinde organization (the org_code
claim) etc49 replies
KKinde
•Created by António Duarte on 12/4/2023 in #💻┃support
Create Company during Register
Hi @António Duarte - is this what you're looking for?
https://kinde.com/docs/build/allow-org-create-on-signup/#allow-organization-creation-on-sign-up
18 replies