Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How should an SPA choose a client ID? #131

Open
mhansen0314 opened this issue Aug 20, 2020 · 2 comments
Open

How should an SPA choose a client ID? #131

mhansen0314 opened this issue Aug 20, 2020 · 2 comments

Comments

@mhansen0314
Copy link

I've seen this question posed a couple of times, but haven't found the answer.

What is the best practice for an SPA that must choose from multiple client IDs when authenticating a user? I'm guessing that the answer is the same regardless of whether those client IDs equate to multiples instances of the same app configured under one org, or multiples instances of the same app appearing in multiple orgs via the OIN.

Should specific URLs map to a client ID? This would require users to log in using a specific URL:
myapp.mycompany.com/friendly_name_for_client_id_1
myapp.mycompany.com/friendly_name_for_client_id_2

Should subdomains map to a client ID? This would require users to log in using a specific subdomain:
friendly_name_for_client_id_1.myapp.mycompany.com/
friendly_name_for_client_id_2.myapp.mycompany.com/

I hope there is a simpler answer. Any help is appreciated.

@shuowu
Copy link
Contributor

shuowu commented Aug 21, 2020

@mhansen0314 If I understand your question correctly. You are trying to configure multiple okta clients (by clientId) in one SPA. As it's a SPA app, I would manage a map on the client-side to route properly. I think your first option should work with proper routing setup.

@mhansen0314
Copy link
Author

Thank you for your response. We will likely start with that approach. I imagine that this has been tackled by some large players, so I'm surprised it's not covered somewhere on the Okta dev site.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants