Redirect based on URLRSS

2 replies

Last post Nov 30, 2014 10:40 PM by Bryan_802

  • Redirect based on URL

    Nov 19, 2014 10:58 AM|technoaddict|LINK

    Hi all,

    Not sure if this is the right group to ask. But I think the answer of my question has to do with scripting.

    We have an ADFS setup running with one website (for example sts.company.com). ADFS has trusts with multiple external parties.
    If you connect to a specific external party, you will be redirected to sts.company.com running on the ADFS server, on where you will have to authenticate. If you enter invalid credentials or cancel the authentication you will be prompted with a 401 error page.

    What we now want is that if u come from a specific external party, IIS has to redirect you to the 401 page hosted at the External party.
    But, when you come from other External Parties, you should just get the default IIS 401 error page.

    Is it possible to add a piece of code inside the 401 error page, that extracts the URL? If a specific piece of text is in the URL, redirect the browser to the 401 hosted at the external party, else just show the default 401 error. Is this possible?

    The 401 URL looks like this:

    https://sts.company.com/adfs/ls/auth/integrated/?wa=wsignin1.0&wtrealm=example1.example.com

    While the 401 if you come from another external party could like this

    https://sts.company.com/adfs/ls/auth/integrated/?wa=wsignin1.0&wtrealm=example2.example.com

    I wonder if its possible to add some code to the page that checks for 'example1.example.com' and if found, sent user to another webpage.
    If not found, just show the 401 default.

    Hope somebody knows if this is possible. And if so, can help me getting there.

    Thanks in advance.

  • Re: Redirect based on URL

    Nov 26, 2014 09:26 AM|Perkinsville|LINK

    Hi,

    Without reading completely, you might want to look at URL Rewrite.

    HTH, Benjamin

  • Re: Redirect based on URL

    Nov 30, 2014 10:40 PM|Bryan_802|LINK

    Hi,

    I am a engineer from AD team, and based on my  experience and research, I don't think you can achieve this goal from AD side.

    Thank you.