I’m a newbie with authentication and authorization. When I go to a website, it redirects me to a url which requires email and password to login Microsoft Account. If I pass the right credential, it will redirects me to the original page where I want to go.
The login URL looks like this:
https://login.microsoftonline.com/{hypothetically-tenant-id}/oauth2/v2.0/authorize?state={
"redirectUrl":"{the-original-url-I-want-to-visit}",
"adminConsentSessionId":null,
"isMFAModeRetry":false
}&client_id={client-id}
&redirect_uri=https://{original-url-domain}/api/auth/azuread/login/code
&response_type=code id_token
&response_mode=form_post
&nonce={nonce}
&scope=openid offline_access
&sso_reload=true
I want to ask if there is a way I can write a flow to provide the credentials to Microsoft if my token expires / not exists, and use the token to see the destination page plus bypassing the login page?
I check the cookie storage and there is a key value pair, if I use that key value pair and place it in the cookie storage, then I won’t have to login again. I guess that is the token obtain after the first login.
I also try setting the cookie storage programatically and it works. Of course the cookie key value pair is obtain by myself manually beforehand, so I guess it will expires later on.
Minh Trí Nguyễn is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.