How to detect which identity provider send a response












0















Currently, I'm trying to implement an OpenID Connect solution which supports multiple identity providers. I chose to use the authorization code flow for this.



When the user opens the login screen the logo's of the supported identity providers are visible. When a logo/identity provider is clicked the system will store the necessary cookies and will redirect the user to the identity provider.



The response of the identity provider contains the following information:




  1. Authorization code

  2. Session_state

  3. State

  4. Scope


Now if I want to make a token request I don't know which identity provider to use. Some things I thought of two things to solve this issue:




  1. Using the UrlReferrer

  2. Storing the used provider in the cookies(Encrypted).


Does anyone know how to solve this problem?










share|improve this question





























    0















    Currently, I'm trying to implement an OpenID Connect solution which supports multiple identity providers. I chose to use the authorization code flow for this.



    When the user opens the login screen the logo's of the supported identity providers are visible. When a logo/identity provider is clicked the system will store the necessary cookies and will redirect the user to the identity provider.



    The response of the identity provider contains the following information:




    1. Authorization code

    2. Session_state

    3. State

    4. Scope


    Now if I want to make a token request I don't know which identity provider to use. Some things I thought of two things to solve this issue:




    1. Using the UrlReferrer

    2. Storing the used provider in the cookies(Encrypted).


    Does anyone know how to solve this problem?










    share|improve this question



























      0












      0








      0








      Currently, I'm trying to implement an OpenID Connect solution which supports multiple identity providers. I chose to use the authorization code flow for this.



      When the user opens the login screen the logo's of the supported identity providers are visible. When a logo/identity provider is clicked the system will store the necessary cookies and will redirect the user to the identity provider.



      The response of the identity provider contains the following information:




      1. Authorization code

      2. Session_state

      3. State

      4. Scope


      Now if I want to make a token request I don't know which identity provider to use. Some things I thought of two things to solve this issue:




      1. Using the UrlReferrer

      2. Storing the used provider in the cookies(Encrypted).


      Does anyone know how to solve this problem?










      share|improve this question
















      Currently, I'm trying to implement an OpenID Connect solution which supports multiple identity providers. I chose to use the authorization code flow for this.



      When the user opens the login screen the logo's of the supported identity providers are visible. When a logo/identity provider is clicked the system will store the necessary cookies and will redirect the user to the identity provider.



      The response of the identity provider contains the following information:




      1. Authorization code

      2. Session_state

      3. State

      4. Scope


      Now if I want to make a token request I don't know which identity provider to use. Some things I thought of two things to solve this issue:




      1. Using the UrlReferrer

      2. Storing the used provider in the cookies(Encrypted).


      Does anyone know how to solve this problem?







      single-sign-on oidc






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 26 '18 at 11:13









      the_ultimate_developer

      1,026822




      1,026822










      asked Nov 26 '18 at 11:02









      RonaldRonald

      112




      112
























          1 Answer
          1






          active

          oldest

          votes


















          0














          Storing the provider details in session or in cookies would be the better option I guess as you might need to use other endpoints (such as introspection, certification) later in the flow.






          share|improve this answer
























          • After reading the following article link I noticed that using the optional audience claim in the OAuth2 state is intended for storing the client(provider) the state is intended for. But should there not be a better way for doing this?

            – Ronald
            Nov 28 '18 at 17:26











          • Client is not the identity provider. aud claim in the token returns the application(s) which a user authorizes to access a certain resource on his behalf. This client should also be registered as a client in your IdP. Since the tokens returned are in the form of jwt, you can validate the signature to determine whether the token has been tampered with.

            – RakihthaRR
            Nov 29 '18 at 2:28












          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',
          autoActivateHeartbeat: false,
          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%2f53479728%2fhow-to-detect-which-identity-provider-send-a-response%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









          0














          Storing the provider details in session or in cookies would be the better option I guess as you might need to use other endpoints (such as introspection, certification) later in the flow.






          share|improve this answer
























          • After reading the following article link I noticed that using the optional audience claim in the OAuth2 state is intended for storing the client(provider) the state is intended for. But should there not be a better way for doing this?

            – Ronald
            Nov 28 '18 at 17:26











          • Client is not the identity provider. aud claim in the token returns the application(s) which a user authorizes to access a certain resource on his behalf. This client should also be registered as a client in your IdP. Since the tokens returned are in the form of jwt, you can validate the signature to determine whether the token has been tampered with.

            – RakihthaRR
            Nov 29 '18 at 2:28
















          0














          Storing the provider details in session or in cookies would be the better option I guess as you might need to use other endpoints (such as introspection, certification) later in the flow.






          share|improve this answer
























          • After reading the following article link I noticed that using the optional audience claim in the OAuth2 state is intended for storing the client(provider) the state is intended for. But should there not be a better way for doing this?

            – Ronald
            Nov 28 '18 at 17:26











          • Client is not the identity provider. aud claim in the token returns the application(s) which a user authorizes to access a certain resource on his behalf. This client should also be registered as a client in your IdP. Since the tokens returned are in the form of jwt, you can validate the signature to determine whether the token has been tampered with.

            – RakihthaRR
            Nov 29 '18 at 2:28














          0












          0








          0







          Storing the provider details in session or in cookies would be the better option I guess as you might need to use other endpoints (such as introspection, certification) later in the flow.






          share|improve this answer













          Storing the provider details in session or in cookies would be the better option I guess as you might need to use other endpoints (such as introspection, certification) later in the flow.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Nov 27 '18 at 3:05









          RakihthaRRRakihthaRR

          304313




          304313













          • After reading the following article link I noticed that using the optional audience claim in the OAuth2 state is intended for storing the client(provider) the state is intended for. But should there not be a better way for doing this?

            – Ronald
            Nov 28 '18 at 17:26











          • Client is not the identity provider. aud claim in the token returns the application(s) which a user authorizes to access a certain resource on his behalf. This client should also be registered as a client in your IdP. Since the tokens returned are in the form of jwt, you can validate the signature to determine whether the token has been tampered with.

            – RakihthaRR
            Nov 29 '18 at 2:28



















          • After reading the following article link I noticed that using the optional audience claim in the OAuth2 state is intended for storing the client(provider) the state is intended for. But should there not be a better way for doing this?

            – Ronald
            Nov 28 '18 at 17:26











          • Client is not the identity provider. aud claim in the token returns the application(s) which a user authorizes to access a certain resource on his behalf. This client should also be registered as a client in your IdP. Since the tokens returned are in the form of jwt, you can validate the signature to determine whether the token has been tampered with.

            – RakihthaRR
            Nov 29 '18 at 2:28

















          After reading the following article link I noticed that using the optional audience claim in the OAuth2 state is intended for storing the client(provider) the state is intended for. But should there not be a better way for doing this?

          – Ronald
          Nov 28 '18 at 17:26





          After reading the following article link I noticed that using the optional audience claim in the OAuth2 state is intended for storing the client(provider) the state is intended for. But should there not be a better way for doing this?

          – Ronald
          Nov 28 '18 at 17:26













          Client is not the identity provider. aud claim in the token returns the application(s) which a user authorizes to access a certain resource on his behalf. This client should also be registered as a client in your IdP. Since the tokens returned are in the form of jwt, you can validate the signature to determine whether the token has been tampered with.

          – RakihthaRR
          Nov 29 '18 at 2:28





          Client is not the identity provider. aud claim in the token returns the application(s) which a user authorizes to access a certain resource on his behalf. This client should also be registered as a client in your IdP. Since the tokens returned are in the form of jwt, you can validate the signature to determine whether the token has been tampered with.

          – RakihthaRR
          Nov 29 '18 at 2:28




















          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.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53479728%2fhow-to-detect-which-identity-provider-send-a-response%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

          Wiesbaden

          Marschland

          Dieringhausen