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

Using one Azure app for multiple domains #61

Open
maxi032 opened this issue Oct 11, 2022 · 2 comments
Open

Using one Azure app for multiple domains #61

maxi032 opened this issue Oct 11, 2022 · 2 comments

Comments

@maxi032
Copy link

maxi032 commented Oct 11, 2022

How can I use 1 single Azure app to login to multiple websites?
We have 2 CMS backends
I wonder if it is possible to use the same Azure app to login to both of them since the content editors are all from the same Azure organization and the CMSs are using the same codebase (different .env files for each)

For that I've made an azure app with different Redirect URIs
Example:

https://cmsportal1.example/login/azurecallback
https://cmsportal2.example/login/azurecallback

When I try to login to the cmsportal1 I am redirected to the second url from the list.

@dickalexei
Copy link

Hi,

Did you specify the "redirect_uri" parameter on you "authorize" request?
Both URL are welle declared on your Azure portal as redirect?

@janzikmund
Copy link

@maxi032 - this seems already mostly implemented in master branch, but it's missing in latest release 0.9.10. So until a new release is made with this feature included, you can install the package using composer require rootinc/laravel-azure-middleware:dev-master.

That will give you latest master branch, where these changes are responsible to pass your azure.callback route as return_uri to the server.

As long as all the return urls are defined in your Redirect URIs on Azure app, Azure should respect that and send each authentication back to its original app.

Unfortunately looks like redirect_uri is only appended to general routes authentication, but not to the initial login itself. I made a PR here that should fix it, so let's see if it gets approved.

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

3 participants