Last post Jul 11, 2020 06:49 AM by Akshat Pathak
Mar 07, 2020 06:54 PM|Mayurib|LINK
I am facing issue during Azure AD authentication and authorization implemented in my MVC application. Application users are stored in Azure AD and I have registered my MVC application in AD through App registration with proper redirect URIs.
When I try to sign in to the application for the first time with some user credentials it allows me to do so. It authenticates the user successfully and user gets into the application successfully with home page displayed. Now If I Sign out this user from
application and try to sign in with some other user credentials it is not authenticating the request for the second time. When I click on SignOut link, it sends SignOut request and signs out user from AD but then after that when it tries to send new authentication
request, it keeps calling the SecurityTokenValidated and AuthorizationCodeReceived events multiple times adding site details, cookies in browser cache multiple times. And then it gives Bad request error saying Request is too long. Checked the fiddler logs
but unable to identify the cause of the issue.
Sometimes it gives error like: 'We couldn't sign you in. Please try again later' and sometimes it goes into infinite signin loop.
I have done the configurations as suggested in quickstart example, Microsoft docs and other links. But still not able to make the authentication and authorization part smoothly.
Please suggest. I am struggling with this issue since last 15 days and did lot of troubleshooting, google searching. Tried many options fixes but all in vain. I need a proper solution or link of the documentation where the correct and exact flow is given
for a simple Authentication -Authorization flow in MVC app.
Please suggest at the earliest.
Mar 09, 2020 12:31 PM|Brando ZWZ|LINK
According to your description, I suggest you could try to delete the cookie and try again.
Mar 09, 2020 12:36 PM|Mayurib|LINK
Thanks for your reply. I tried that also, deleted the cookie and than ran the application but still facing the same issue. This is a recurring issue. After clearing cookies from browser, it runs for the first time but again on second attempt it gives same
issue. I think there is some issue with my code but I am not able to figure out that as which line of code is exactly causing the issue. I need the exact steps/configurations to be implemented in application for a simple Azure AD authentication and authorization.
Jun 29, 2020 02:49 PM|Shubh Agrahari|LINK
I am facing this same issue. Can you please let me know if you have fixed the issue.
Jul 11, 2020 06:49 AM|Akshat Pathak|LINK