I am trying to implement single sign-on in my asp.net app. My customer uses Azure AD as an identity provider using SAML. I am able to create a request but every time I try to log in I get one of two errors.
The values I was provided with are:
entity ID = https://sts.windows.net/[id]/
login url = https://sts.windows.net/[id]/saml2
the login url looked off to me so I am also trying an alternate login url = https://login.microsoftonline.com/[id]/saml2
When I use the login.microsoftonline url it validates my login credentials (if I enter a non-existing username or the wrong password it rejects me, correctly), then shows this error:
AADSTS700016: Application with identifier 'https://sts.windows.net/[id]/' was not found in the directory '[id]'. This can happen if the application has not been installed by the administrator of the tenant or consented to by any user in the tenant. You may have sent your authentication request to the wrong tenant.
When I use the sts.windows url I get as far as entering my username then I get hit with:
There was an issue looking up your account. Tap Next to try again.
Additional information
- I have implemented Azure AD SSO before using the alternate login url, which is why i tried it.
- I can log in to office365 using these login credentials.
- I have tried every variation on these strings I can think of, including with and w/o ending slashes, without 'saml2', using just [id] as the entity ID,
I get the same errors every time (except when I leave of 'saml2', then it just doesn't connect and I get 404 error).
- [id] is actually a long string of characters, I replaced it here for security and readability.
- I am creating the request using AspNetSaml.
- I'm assuming the Azure application is configured properly, but if there really is no other possible solution I can ask the customer to check it again.
- I'm out of things to try and it's still not working. What is the correct way to implement this, or how can I fix these errors?