This project has moved and is read-only. For the latest updates, please go here.

Multiple domains and provider keys

Jun 13, 2014 at 3:02 PM
We have a web application that has custom branding and functionality depending on the subdomain being used. With the need to have specific URLs configured in the Google developer console when allowing users to link their Google account, I am having to create multiple sets of clientid/secret keys. Yet I do not see how I can configure Google authentication with those keys on a session basis vs. when the application starts.

Is there a way to configure or re-configure what keys should be used on a session basis vs. globally for the application? Any changes with v3 that might help the situation?

It is looking like I may have to have each custom subdomain set up as a different site in IIS to make this work but given we will have 300 subdomains in use once finished, this complicated the deployment of changes.

Any advice?

Thank you,
Jun 13, 2014 at 4:10 PM
I'm pretty sure you can register multiple redirect URIs for a single Client ID in the google developer console. That means you only need one Client ID and secret, so only one normally configured middleware.

If that doesn't work...

Our Google middleware is really not set up for multiple ids like this. The best we can manage at the moment is having multiple instances of the middleware in the pipeline, but that doesn't scale well.

If you really need to decide this on a per-request basis, I recommend you take a copy of our middleware and add your own extensibility points. The latest code is in the Dev branch. If you find an elegant solution you think others could benefit from, consider contributing it. If you need help, folks in may be able provide guidance.