Software applications need a way to identify users, store user data uniquely and serve these data to the right user at the right time. This process birthed authentication and authorization in software development. Almost every application today has an authentication flow and if you look closely, you will notice the similarity in the flow of authentication across different applications.
@jahz and @Avinash_Utekar1 I will go through the tutorial and try to figure out what is happening. Will post here once I am done. And of this week or beginning of next.
after redirect you will get id_token and access_token in the redirected url , to create or authenticate user in strapi hit below api with access_token localhost:1337/api/auth/auth0/callback?access_token=eyJhbGciOiJkaXIiLCJlbmMiOiJBMjU2R0NNIiwiaXNzIjoiaHR0cHM6Ly9wcmVmbGV0LmV1LmF1dGgwLmNvbS8ifQ…0ip_tzWwu7Xd1ESU.yLAYVuuIl3WRMjifgLnvs6ff5DBKZSSCFvLc1HzLAg6l32UHF-RnkLNinYnfkFK56yaUIu35K9E1nu0mrRg5NS7bMU63p7s8alZsJcHDvkZqKvRKxe-PXxPpcT0vSJXxu4XEVGoLwG86G4aWegT818KZgcWE4oethAwThawSLbH17U0VYZ-VvRX6T8NcuXtNYSLitZoLt8UsK1mVXeWLOtX9N0wdHk6DA2fhLQe1_2MBGuAXQmAtTNhNMMF16meESznjO_B7mQ.H9cd8k5uXanT63i247e6EA
it will create user at strapi side and return bearer token.
for login also do the same
Figured it out already forgot to update this thread. Thanks
So yes its exactly everything you guys added above.
In my case, I’m using next js, so I just have to get the id_token from the redirect and make my application do another fetch request to https://mystrapiendpoint/api/auth/auth0/callback?id_token and that would complete the cycle and issue the jwt from strapi that my application could use!
Thanks for response, but calling this callback url, i have a possibility to pass the strapi role? For example i have user in auth0 with Admin role and when i am logging in with strapi i want to pass admin role if it does not exist.