I am implementing a Microsoft Authentication in .NET Core that uses azure AD. I managed to implement this authentication correctly and a redirection to a swagger endpoint once the authentication process is completed.
The problem is that the token is given in the redirection URL, as shown below:token in url
And for sending the request to the endpoints, I have to manually copy that token and send it attached to the request, otherwise I will still get an unathorized code.
Is there any way in which upon the redirection I can extract the token and save it in the session (or similar) and that way include it automatically in the next requests that are made?
if not, can I at least extract the token string it in some way? as I didn't find any way to read the actual current value of the url being displayed, only when issuing a request I am able to read the address but thats for the request, not for the actual /swagger/access_token... etc