I suggest you check out this instruction to debug this problem from Microsoft: https://learn.microsoft.com/en-us/entra/identity/enterprise-apps/debug-saml-sso-issues
Here are things I recommend looking out for:
Sign-in logs:
In Microsoft Entra, go to Users and select the user who most recently attempted to sign in. Then, click on Sign-in logs from the left-hand panel under the user's name. This will show whether the sign-in was successful or failed.
If the sign-in failed, check the Conditional Access section to identify any policies that might be blocking the user from accessing the application.
Authorization Rules:
Check the issuance authorization rules for the relying party. If you have strict rules set up, it's possible that the user isn't meeting the criteria for token issuance. Make sure to check if all the necessary rules are defined and whether any deny rules are overriding allow rules.
Reply URL Configuration:
Ensure your application's reply URL (Assertion Consumer Service URL) is correctly set up. If the reply URL points to localhost or an incorrect endpoint, Azure AD might not know where to send the token. Double-check the configuration on the Azure side.
Testing SSO:
Utilize the Test SSO feature in the Microsoft Entra admin center for your application. It can provide error resolution guidance tailored to your setup.
If you feel like this might be related to your implementation of the application, please send me your implementation of SAML in your program.cs.
I also suggest posting this problem under Azure and Entra tags to get more insights from this problem.
Feel free to reach out if you have any problems.
Best regards