Hello @Niket Kumar Singh, I'm glad that you were able to resolve your issue and thank you for posting your solution so that others experiencing the same thing can easily reference this! Since the Microsoft Q&A community has a policy that "The question author cannot accept their own answer. They can only accept answers by others ", I'll repost your solution in case you'd like to "Accept " the answer.
Issue: SAML SSO Redirection Behavior – ReturnUrl ignored, always posting to /Saml2/Acs instead of custom route
Solution: Resolved by @Niket Kumar Singh,
Since the library did not allow ACS customization, we re-architected the flow without using Sustainsys and built a custom SAML response handler:
- Configured Azure AD to point to our custom ACS endpoint: ✅ https://localhost:5001/api/Saml2/Acs
- Implemented a controller endpoint in our .NET backend to directly receive and decode the SAML response.
- Validated the SAML POST payload and extracted the necessary user claims (email, name, etc.).
- Successfully verified the authentication flow end-to-end without relying on Sustainsys.
- The application is now capable of handling the SAML response securely and flexibly and matches the custom ACS route expected in enterprise scenarios.
If you have any other questions or are still running into more issues, please let me know. Thank you again for your time and patience throughout this issue.
Please remember to "Accept Answer
" if any answer/reply helped, so that others in the community facing similar issues can easily find the solution.