integrating azure user flow in my superset application

Harshit sharma 0 Reputation points
2024-10-22T08:28:56.29+00:00

Hi, I am trying to integrate azure ad b2c in my superset app and I am following these documentations.
https://learn.microsoft.com/en-us/azure/active-directory-b2c/enable-authentication-python-web-app-options
https://flask-appbuilder.readthedocs.io/en/latest/security.html

using these docs, I have integrated the azure auth from this code.

AUTH_USER_REGISTRATION = True
     AUTH_USER_REGISTRATION_ROLE = "Admin"
     AUTH_ROLES_SYNC_AT_LOGIN = False  
     from flask_appbuilder.security.manager import AUTH_OAUTH
     AUTH_TYPE = AUTH_OAUTH
     OAUTH_PROVIDERS = [
      {'name': 'azure',
      'icon': 'fa-windows',
      'token_key': 'access_token',
      'remote_app': {
      'client_id': '63e79babXXXXXXXXXXXXXXX',
      'client_secret': '5qW8Q~XXXXXXXXXXXXXXXX-',
      'api_base_url': 'https://login.microsoftonline.com/XXXXXXXX-0546-4513-8c32-3475d2381555/oauth2',
      'client_kwargs': {
      'scope': 'User.read givenName sn email profile upn'
      },
      'request_token_url': None,
      'access_token_url': 'https://login.microsoftonline.com/XXXXXXXXXX-0546-4513-8c32-3475d2381555/oauth2/token',
      'authorize_url': 'https://centeredcareexp.b2clogin.com/centeredcareexp.onmicrosoft.com/B2C_1_susi_nomfa',
      }
      }
     ]


But as soon as I try to access my superset I get this login window.Screenshot 2024-10-22 134358

And when I try my azure user flow from here
Screenshot 2024-10-22 134433

I get this window which is the correct azure b2c login window.
User's image

I need help with integrating the azure user flow with my superset app. It is getting ad b2c with my current configurations.

Microsoft Entra ID
Microsoft Entra ID
A Microsoft Entra identity service that provides identity management and access control capabilities. Replaces Azure Active Directory.
22,101 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Raja Pothuraju 7,750 Reputation points Microsoft Vendor
    2024-11-04T20:01:28.15+00:00

    Hello @Harshit sharma,

    Thank you for posting your query on Microsoft Q&A.

    Based on your description, I understand that when you try to access your application from Superset, it redirects you to Superset’s homepage instead of the Azure AD B2C login screen, as confirmed by the screenshot provided.

    User's image

    However, when accessing through the Azure AD B2C tenant, it redirects to the Azure AD B2C login page as expected.

    To resolve this issue, ensure that your application is sending a request to the Azure AD B2C endpoint whenever the login page is accessed, rather than redirecting to the Superset login endpoint.

    Could you please confirm if clicking on "Sign in with Azure" on your homepage takes you to the Azure AD B2C login window?

    User's image

    I hope this information is helpful. Please feel free to reach out if you have any further questions.

    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Thanks,
    Raja Pothuraju.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.