OAuth/ODIC - Azure AD authentication loop - Self-hosted Netbird #317

Closed
opened 2025-11-20 05:09:32 -05:00 by saavagebueno · 4 comments
Owner

Originally created by @spanishdexter on GitHub (Apr 17, 2023).

Describe the problem
After configuring a self-hosted netbird server with Azure AD OAuth, a login loop occurs when navigating to the netbird web interface. I get re-directed to the Azure AD login page for my Azure AD tenant as expected, authenticate, then get re-directed to Netbird, but then Netbird keeps trying to redirect me back to Azure AD. Azure AD already knows I'm authenticated then redirects me back, this causes a redirect loop over and over until Azure AD times out and throws an error that I could not be logged in.

To Reproduce
Steps to reproduce the behavior:

  1. Navigate to your Netbird instance in a browser.
  2. If you configured your setup.env file correctly, you should get re-directed to Azure AD SSO login to provide credentials. Login.
  3. You should be re-directed to Netbird after login, but Netbird keeps re-directing back to Azure AD instead, Azure AD will re-direct back to Netbird because your already logged in, causing a re-direct loop until Azure AD times out and throws a login error.

Expected behavior
Navigating to the Netbird web interface on the server should redirect to Azure AD where user login occurs then the user should be re-directed back to the Netbird web console, logged in successfully.

NetBird status -d output:
If applicable, add the output of the netbird status -d command. Can't login to my VM from my current location at this time to run this command, I will need to wait until I am home from the office.

Originally created by @spanishdexter on GitHub (Apr 17, 2023). **Describe the problem** After configuring a self-hosted netbird server with Azure AD OAuth, a login loop occurs when navigating to the netbird web interface. I get re-directed to the Azure AD login page for my Azure AD tenant as expected, authenticate, then get re-directed to Netbird, but then Netbird keeps trying to redirect me back to Azure AD. Azure AD already knows I'm authenticated then redirects me back, this causes a redirect loop over and over until Azure AD times out and throws an error that I could not be logged in. **To Reproduce** Steps to reproduce the behavior: 1. Navigate to your Netbird instance in a browser. 2. If you configured your setup.env file correctly, you should get re-directed to Azure AD SSO login to provide credentials. Login. 3. You should be re-directed to Netbird after login, but Netbird keeps re-directing back to Azure AD instead, Azure AD will re-direct back to Netbird because your already logged in, causing a re-direct loop until Azure AD times out and throws a login error. **Expected behavior** Navigating to the Netbird web interface on the server should redirect to Azure AD where user login occurs then the user should be re-directed back to the Netbird web console, logged in successfully. **NetBird status -d output:** If applicable, add the output of the `netbird status -d` command. Can't login to my VM from my current location at this time to run this command, I will need to wait until I am home from the office.
saavagebueno added the config-issue label 2025-11-20 05:09:32 -05:00
Author
Owner

@Stunt0265 commented on GitHub (May 17, 2023):

Followed this?

cb03373f8f/docs/integrations/identity-providers/self-hosted/azure-ad.md

And make sure the to see if this was done: "Modify the api scope within dashboard enviroment variable AUTH_SUPPORTED_SCOPES located in docker-compose.yml to api://<application_id>/api."

@Stunt0265 commented on GitHub (May 17, 2023): Followed this? https://github.com/netbirdio/docs/blob/cb03373f8feb9da0204606ab055fa9825f0f9a26/docs/integrations/identity-providers/self-hosted/azure-ad.md And make sure the to see if this was done: "Modify the api scope within dashboard enviroment variable AUTH_SUPPORTED_SCOPES located in docker-compose.yml to api://<application_id>/api."
Author
Owner

@spanishdexter commented on GitHub (May 17, 2023):

@Stunt0265 OMG thank you!!!

@spanishdexter commented on GitHub (May 17, 2023): @Stunt0265 OMG thank you!!!
Author
Owner

@mlsmaycon commented on GitHub (Jun 16, 2023):

Hello @Stunt0265 we've updated the documentation and added integration to our management. Check it out here: https://docs.netbird.io/selfhosted/identity-providers#azure-ad

@mlsmaycon commented on GitHub (Jun 16, 2023): Hello @Stunt0265 we've updated the documentation and added integration to our management. Check it out here: https://docs.netbird.io/selfhosted/identity-providers#azure-ad
Author
Owner

@nazarewk commented on GitHub (Apr 17, 2025):

closing, because seems like it was resolved and documented

@nazarewk commented on GitHub (Apr 17, 2025): closing, because seems like it was resolved and documented
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: SVI/netbird#317