Setting up Azure AD for SAML login to external website

I'm trying to get Azure AD to generate SAML tokens to allow login for an external website (not using Azure in any way)
However, I think I don't get some of the basics here? I know SAML/IdP/RP/SP but I don't find the right menus/settings in Azure AD?

I've got a website like:
  www.mysite.com/login-page 
to which, normally, end users browse (http) and then automatically/immediately are redirected (GET) to something like:
  www.idp-service.com/mysite-SSO

There they use a login form to supply username/password (unless they are already logged in to the idp-service), and they are then redirected (POST) to:
  www.mysite.com/logged-in-page
with a SAMLResponse that contains a token that mysite.com may use to allow the end user access. And everyone are happy :-)


However, now I'd like to stop using idp-service.com and instead use Azure AD.

Thus, I bought a "Azure Premium" account and created an "app registration", where I entered:
  Home page URL: www.mysite.com/login-page
  Reply URL: www.mysite.com/logged-in-page


Now, when "starting the external app" from the Azure portal, I do get redirected to this mysite page - but I then of course need some URL to redirect the user back to the Azure IDP again, to request a SAML token.
I understand that I probably should use some endpoint URL with parameters "client_id" or similar, but I honestly cannot understand how to find/determine the correct URL?
Also, how do I get hold of the (public) certificate that I should copy to mysite.com and use to verify the signature?

The app registration properties specifies something like
  Application ID: XXX-YYY-ZZZ
  App ID URI: https://mysite.onmicrosoft.com/XXX-YYY-ZZZ

...but I don't get how to construct the URL that will let end users login to Azure, and eventually be redirected to the mysite reply URL.

Any suggestions? Or do I miss some very basic prerequisite here?
Stefan LennerbrantAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Jian An LimSolutions ArchitectCommented:
Reference site: https://docs.microsoft.com/en-us/azure/active-directory/active-directory-saas-custom-apps

As above said, you need to add an unlisted application in Azure AD.
once you done that, you will get your unique url


the single sign-on service url in format of sts.windows.net or login.windows.net

the appid is after domain part.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Stefan LennerbrantAuthor Commented:
Well, using IdP initiated login does work (even though I only find the starting point in the "classic" Azure portal, I cannot find any application start link in the "new" portal layout :-(
The IdP then eventuallt ends up at "https://login.microsoftonline.com/XXX-YYY-ZZZ/saml2?SAMLRequest=xxx_the_token_xxx" and from there redirects to the site "www.mysite.com/logged-in-page" with the token as a POST:ed value. That's good.

But for SP initiated login, I cannot determine what URL to use. How do I initiate a login from my own side, when not already inside Azure?
How do I construct the "sts.windows.net or login.windows.net with the appid after the domain part"?

BTW, just using "https://login.microsoftonline.com/XXX-YYY-ZZZ" results in "the page cannot be found" and "https://login.microsoftonline.com/XXX-YYY-ZZZ/saml2" of course results in "The request is not a valid SAML 2.0 protocol message"
0
Stefan LennerbrantAuthor Commented:
Yeah, I just found the URL!

It's on the form
  https://myapps.microsoft.com/signin/NAME/XXX-YYY-ZZZ

where NAME is the name of the application and XXX-YYY-ZZZ is the app Id.

Great, thanks for the inspiration! :-)
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
AzureAD

From novice to tech pro — start learning today.