I have really hard time trying to understand mostly how should I implement my authorization flow. I think I have the authentication flow mostly correctly implemented using the technologies I've listed in the title. Here's what I want to achieve:
Basically I have a mobile app built using React-Native
and I have made a restful API for this mobile app to use. I am currently at the point that I have implemented authentication using ADFS 4.0
. My mobile app directly uses the ADFS
endpoints to authenticate the user and I am able to receive the id_token and access token correctly from there. But here comes the part that I have no clue what to do next. Before I used openID, I had my own authentication and just an OAuth2 flow in my Spring REST Api
and everytime I made a request from the mobile app to the API, I provided the access token in the headers, and used it to verify from the authorization server that the user is indeed authenticated and also received some crucial information about the user to use in my API. But now since I use OpenID-Connect
and ADFS 4.0
for the authentication, I have the cruicial information I need in my API in the id_token
. The question is, what exactly should i send to my API now from the mobile app, the id_token
, access token
or both? Given the access token
to the userinfo endpoint at the ADFS
returns the subject of the owner of the token. Like is there any way I could receive the users info using the subject or what exactly should I do. I've tried to research this subject a lot, but I am still very confused..