How to set the redirect URL to a specific domain when successfully logged in with ADFS?











up vote
0
down vote

favorite












I'm authenticating users trough ADFS using OWIN in ASP.NET MVC.



I use the same ADFS server for two diferent sites.
The first site is www.mysite.com and the ADFS authentication works propertly.



The second site is www.mysiteadmin.com (the administrative site), but when the user succesfully logs-in in the ADFS site, the redirection is made to www.mysite.com and not to the "admin" site.



Does someone knows why is this happening. I asked to the ADFS Service owners and they said that both sites are registered as relying party trust.



I want to specify the respective redirection URL on each site, but I haven't found anything helpful over the internet.



Thank you very much!










share|improve this question


























    up vote
    0
    down vote

    favorite












    I'm authenticating users trough ADFS using OWIN in ASP.NET MVC.



    I use the same ADFS server for two diferent sites.
    The first site is www.mysite.com and the ADFS authentication works propertly.



    The second site is www.mysiteadmin.com (the administrative site), but when the user succesfully logs-in in the ADFS site, the redirection is made to www.mysite.com and not to the "admin" site.



    Does someone knows why is this happening. I asked to the ADFS Service owners and they said that both sites are registered as relying party trust.



    I want to specify the respective redirection URL on each site, but I haven't found anything helpful over the internet.



    Thank you very much!










    share|improve this question
























      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      I'm authenticating users trough ADFS using OWIN in ASP.NET MVC.



      I use the same ADFS server for two diferent sites.
      The first site is www.mysite.com and the ADFS authentication works propertly.



      The second site is www.mysiteadmin.com (the administrative site), but when the user succesfully logs-in in the ADFS site, the redirection is made to www.mysite.com and not to the "admin" site.



      Does someone knows why is this happening. I asked to the ADFS Service owners and they said that both sites are registered as relying party trust.



      I want to specify the respective redirection URL on each site, but I haven't found anything helpful over the internet.



      Thank you very much!










      share|improve this question













      I'm authenticating users trough ADFS using OWIN in ASP.NET MVC.



      I use the same ADFS server for two diferent sites.
      The first site is www.mysite.com and the ADFS authentication works propertly.



      The second site is www.mysiteadmin.com (the administrative site), but when the user succesfully logs-in in the ADFS site, the redirection is made to www.mysite.com and not to the "admin" site.



      Does someone knows why is this happening. I asked to the ADFS Service owners and they said that both sites are registered as relying party trust.



      I want to specify the respective redirection URL on each site, but I haven't found anything helpful over the internet.



      Thank you very much!







      asp.net-mvc adfs






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Nov 22 at 15:30









      Diego Arias

      177




      177
























          1 Answer
          1






          active

          oldest

          votes

















          up vote
          0
          down vote



          accepted










          If both sites are set up with RP trusts and both have the correct redirect URI this will work.



          These are separate applications?



          It sounds like both sites have the same URI?






          share|improve this answer





















          • Both sites are separate applications and both have different URI configured in the ida:Wtrealm key in the web.config
            – Diego Arias
            Nov 22 at 20:36






          • 1




            Sorry, I meant both RP on the ADFS side. Do they have different redirect URI?
            – nzpcmad
            Nov 22 at 23:35










          • Thank you very much for the answer. That was exactly the problem here. The ADFS administrators only had one of the URI registered as relying party trust with two different response urls, so the ADFS was always responding to the same principal response URL. They are going to register a second RPT and set a propper response URL. I appreciate a lot your help.
            – Diego Arias
            Nov 26 at 22:59






          • 1




            Cool. If all good, please remember to accept the answer,
            – nzpcmad
            Nov 27 at 0:55











          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53434153%2fhow-to-set-the-redirect-url-to-a-specific-domain-when-successfully-logged-in-wit%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          up vote
          0
          down vote



          accepted










          If both sites are set up with RP trusts and both have the correct redirect URI this will work.



          These are separate applications?



          It sounds like both sites have the same URI?






          share|improve this answer





















          • Both sites are separate applications and both have different URI configured in the ida:Wtrealm key in the web.config
            – Diego Arias
            Nov 22 at 20:36






          • 1




            Sorry, I meant both RP on the ADFS side. Do they have different redirect URI?
            – nzpcmad
            Nov 22 at 23:35










          • Thank you very much for the answer. That was exactly the problem here. The ADFS administrators only had one of the URI registered as relying party trust with two different response urls, so the ADFS was always responding to the same principal response URL. They are going to register a second RPT and set a propper response URL. I appreciate a lot your help.
            – Diego Arias
            Nov 26 at 22:59






          • 1




            Cool. If all good, please remember to accept the answer,
            – nzpcmad
            Nov 27 at 0:55















          up vote
          0
          down vote



          accepted










          If both sites are set up with RP trusts and both have the correct redirect URI this will work.



          These are separate applications?



          It sounds like both sites have the same URI?






          share|improve this answer





















          • Both sites are separate applications and both have different URI configured in the ida:Wtrealm key in the web.config
            – Diego Arias
            Nov 22 at 20:36






          • 1




            Sorry, I meant both RP on the ADFS side. Do they have different redirect URI?
            – nzpcmad
            Nov 22 at 23:35










          • Thank you very much for the answer. That was exactly the problem here. The ADFS administrators only had one of the URI registered as relying party trust with two different response urls, so the ADFS was always responding to the same principal response URL. They are going to register a second RPT and set a propper response URL. I appreciate a lot your help.
            – Diego Arias
            Nov 26 at 22:59






          • 1




            Cool. If all good, please remember to accept the answer,
            – nzpcmad
            Nov 27 at 0:55













          up vote
          0
          down vote



          accepted







          up vote
          0
          down vote



          accepted






          If both sites are set up with RP trusts and both have the correct redirect URI this will work.



          These are separate applications?



          It sounds like both sites have the same URI?






          share|improve this answer












          If both sites are set up with RP trusts and both have the correct redirect URI this will work.



          These are separate applications?



          It sounds like both sites have the same URI?







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Nov 22 at 18:17









          nzpcmad

          27.9k2892142




          27.9k2892142












          • Both sites are separate applications and both have different URI configured in the ida:Wtrealm key in the web.config
            – Diego Arias
            Nov 22 at 20:36






          • 1




            Sorry, I meant both RP on the ADFS side. Do they have different redirect URI?
            – nzpcmad
            Nov 22 at 23:35










          • Thank you very much for the answer. That was exactly the problem here. The ADFS administrators only had one of the URI registered as relying party trust with two different response urls, so the ADFS was always responding to the same principal response URL. They are going to register a second RPT and set a propper response URL. I appreciate a lot your help.
            – Diego Arias
            Nov 26 at 22:59






          • 1




            Cool. If all good, please remember to accept the answer,
            – nzpcmad
            Nov 27 at 0:55


















          • Both sites are separate applications and both have different URI configured in the ida:Wtrealm key in the web.config
            – Diego Arias
            Nov 22 at 20:36






          • 1




            Sorry, I meant both RP on the ADFS side. Do they have different redirect URI?
            – nzpcmad
            Nov 22 at 23:35










          • Thank you very much for the answer. That was exactly the problem here. The ADFS administrators only had one of the URI registered as relying party trust with two different response urls, so the ADFS was always responding to the same principal response URL. They are going to register a second RPT and set a propper response URL. I appreciate a lot your help.
            – Diego Arias
            Nov 26 at 22:59






          • 1




            Cool. If all good, please remember to accept the answer,
            – nzpcmad
            Nov 27 at 0:55
















          Both sites are separate applications and both have different URI configured in the ida:Wtrealm key in the web.config
          – Diego Arias
          Nov 22 at 20:36




          Both sites are separate applications and both have different URI configured in the ida:Wtrealm key in the web.config
          – Diego Arias
          Nov 22 at 20:36




          1




          1




          Sorry, I meant both RP on the ADFS side. Do they have different redirect URI?
          – nzpcmad
          Nov 22 at 23:35




          Sorry, I meant both RP on the ADFS side. Do they have different redirect URI?
          – nzpcmad
          Nov 22 at 23:35












          Thank you very much for the answer. That was exactly the problem here. The ADFS administrators only had one of the URI registered as relying party trust with two different response urls, so the ADFS was always responding to the same principal response URL. They are going to register a second RPT and set a propper response URL. I appreciate a lot your help.
          – Diego Arias
          Nov 26 at 22:59




          Thank you very much for the answer. That was exactly the problem here. The ADFS administrators only had one of the URI registered as relying party trust with two different response urls, so the ADFS was always responding to the same principal response URL. They are going to register a second RPT and set a propper response URL. I appreciate a lot your help.
          – Diego Arias
          Nov 26 at 22:59




          1




          1




          Cool. If all good, please remember to accept the answer,
          – nzpcmad
          Nov 27 at 0:55




          Cool. If all good, please remember to accept the answer,
          – nzpcmad
          Nov 27 at 0:55


















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.





          Some of your past answers have not been well-received, and you're in danger of being blocked from answering.


          Please pay close attention to the following guidance:


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53434153%2fhow-to-set-the-redirect-url-to-a-specific-domain-when-successfully-logged-in-wit%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          Trompette piccolo

          Slow SSRS Report in dynamic grouping and multiple parameters

          Simon Yates (cyclisme)