# OIDC for OIN and multi-tenancy and base url

**URL:** <https://devforum.okta.com/t/oidc-for-oin-and-multi-tenancy-and-base-url/18413>\
**Category:** OIN Submissions\
**Created:** [December 8, 2021, 1:54am UTC](https://devforum.okta.com/t/oidc-for-oin-and-multi-tenancy-and-base-url/18413 "2021-12-08T01:54:43Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![devperson](https://avatars.discourse-cdn.com/v4/letter/d/eb9ed0/32.png) [@devperson](https://devforum.okta.com/u/devperson)\
**Post date:** [December 8, 2021, 1:54am UTC](https://devforum.okta.com/t/oidc-for-oin-and-multi-tenancy-and-base-url/18413/1 "2021-12-08T01:54:43Z")

</div>

So my goal is create an OIDC integration for the OIN. I have the basics working in my dev instance, but my question is about getting the baseUrl as a part of the OIDC flow.

Now, when a user clicks into my app from Okta dashboard, Okta sends them to the initate login URI which includes the tenant’s base url in the iss query param like `initiate-login?iss=https%3A%2F%2Fdev-xx.okta.com`. With this information I can redirect the browser to the authorize URL based on the url ie: `dev-xx.okta.com/oauth2/v1/authorize`. Okta then redirects to the Redirect URI that includes the authorization code so like `localhost:8888/callback?code=CODE`. However, now I have no idea which Okta instance they came from to make the call to get the access token? Is there a standard way to do this?

Obviously, I can require the Okta admin to add some kind of query param to the Redirect URI, but is that recommended way to build something for the OIN? I would prefer that they have to do as little as possible.

---

<div class="post-metadata">

**Author:** ![devperson](https://avatars.discourse-cdn.com/v4/letter/d/eb9ed0/32.png) [@devperson](https://devforum.okta.com/u/devperson)\
**Post date:** [December 8, 2021, 2:04am UTC](https://devforum.okta.com/t/oidc-for-oin-and-multi-tenancy-and-base-url/18413/2 "2021-12-08T02:04:59Z")

</div>

Is it ok to send something along in the `state` query param that I can use to identify which okta org (and thus base Url) they came from?

---

<div class="post-metadata">

**Author:** ![warren](https://avatars.discourse-cdn.com/v4/letter/w/97f17d/32.png) [@warren](https://devforum.okta.com/u/warren)\
**Post date:** [December 8, 2021, 4:05am UTC](https://devforum.okta.com/t/oidc-for-oin-and-multi-tenancy-and-base-url/18413/3 "2021-12-08T04:05:47Z")

</div>

You could send it in the `state` query parameter as you have mentioned. If your app supports a different redirect\_uri based on tenant, you can configure that in the submission form as well.

 ![Screen Shot 2021-12-07 at 7.59.17 PM](https://global.discourse-cdn.com/oktadev/original/2X/2/21ca4ea076217071300cfd461731e3a8e600f414.png)

[https://developer.okta.com/docs/guides/submit-app/openidconnect/submission2-specific/#protocol-specific-settings](https://developer.okta.com/docs/guides/submit-app/openidconnect/submission2-specific/#protocol-specific-settings)

---

<div class="post-metadata">

**Author:** ![devperson](https://avatars.discourse-cdn.com/v4/letter/d/eb9ed0/32.png) [@devperson](https://devforum.okta.com/u/devperson)\
**Post date:** [December 8, 2021, 2:02pm UTC](https://devforum.okta.com/t/oidc-for-oin-and-multi-tenancy-and-base-url/18413/4 "2021-12-08T14:02:36Z")

</div>

Thank you @warren! I had read that documentation but since I’m developing this via the AIW (where this option doesn’t seem to exist) I couldn’t quite picture how it worked. Your screenshot makes it super clear and now I realize I can vary the Redirect URI per tenant with pretty minimal work for the end-users.

---

<div class="post-metadata">

**Author:** ![akhil](https://avatars.discourse-cdn.com/v4/letter/a/7ab992/32.png) [@akhil](https://devforum.okta.com/u/akhil)\
**Post date:** [August 8, 2023, 11:02am UTC](https://devforum.okta.com/t/oidc-for-oin-and-multi-tenancy-and-base-url/18413/5 "2023-08-08T11:02:26Z")

</div>

Hello @warren, I wanted to test the multiple redirect URI varying per tenant feature . I could not find that when I create a native OIDC app in my developer account. i.e. I wanted to test the above feature in a native OIDC app rather than submitting the ISV form and testing it in production. Do I need to enable some configuration so the above feature is visible for my native OIDC apps?

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/oktadev/original/1X/589c4c5f80de422d01f47cee7185a7fb8227835c.png) [@system](https://devforum.okta.com/u/system)\
**Post date:** [February 13, 2024, 12:42am UTC](https://devforum.okta.com/t/oidc-for-oin-and-multi-tenancy-and-base-url/18413/6 "2024-02-13T00:42:29Z")

</div>

Closed on February 13, 2024, 12:42am UTC

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.
