swelham / ueberauth_microsoft

Microsoft Strategy for Überauth
MIT License
37 stars 35 forks source link

Single callback_url for multiple tenants / subdomain #3

Closed pedromvieira closed 7 years ago

pedromvieira commented 7 years ago

Could you please add a global option for a single redirect_uri for multi tenant with subdomains ?

Ueberauth Strategy for Google has this similar feature.

config.exs

config :ueberauth, Ueberauth,
  providers: [
    ...
    microsoft: {Ueberauth.Strategy.Microsoft, [
      callback_url: "https://subdomain.example.com/auth/microsoft/callback"
    ]},
  ]

Thanks.

swelham commented 7 years ago

I have just been reviewing the code of this strategy and the google strategy and as far as I can tell they are resolving the callback_url in the same way. Unless there is something I'm missing (very likely), I would guess this option is provided by the base Ueberauth library and should work with this strategy already.

However, as you have taken the time to log this issue I am assuming that isn't the case. I will try and find some time to setup a test and see where the google strategy is overriding the url.

pedromvieira commented 7 years ago

I reviewed my app manifesto at Microsoft Graph and turn on this setting: ""allowPublicClient": true,". Now it's working both for localhost and https reply with the callback_url in config.exs. Sorry for the trouble. Thanks again.

swelham commented 7 years ago

No problem, thanks for the update.