Skip to content

Is Azure AD interactive authentication supported on mobile? #2061

Closed

Description

@thenextman

Running on .NET 6 on an iOS system and attempting to use interactive Azure authentication seems like it can never work.

The browser is launched and it's possible to authenticate, but then attempts a redirect to localhost (which can never succeed). The only way out is to cancel the authentication, making the connection fail.

On NET Core, the redirect URL is always set to localhost:

https://github.com/dotnet/SqlClient/blame/2b31810ce69b88d707450e2059ee8fbde63f774f/src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/ActiveDirectoryAuthenticationProvider.cs#L200

However, this cannot work on mobile (as per the underlying Azure.Identity / MSAL implementations). Is this supported or supposed to work somehow? It's not clear.

Activity

  1. Kaur-Parminder commented on Jun 20, 2023

    @Kaur-Parminder
    Contributor

    @thenextman Sorry for delayed response. I believe MSAL suppose to work as per documentation here https://github.com/AzureAD/microsoft-authentication-library-for-dotnet/wiki/Acquiring-tokens-interactively.
    and using localhost is prbably expected:
    https://github.com/AzureAD/microsoft-authentication-library-for-dotnet/wiki/MSAL.NET-uses-web-browser#at-a-glance
    Sqlclient is doing same:

    I had issues while trying to Repro it with browser pop-up. Can you provide simple App that reproduces it?

  2. maxbrousseau commented on Jun 22, 2023

    @maxbrousseau

    Hello @Kaur-Parminder ,

    For a test app to reproduce the issue, you can check the project that I have linked here: #2062 (comment)

    Thank you,

  3. moved this from To triage to Backlog in SqlClient Boardon Nov 21, 2025
  4. moved this from Backlog to Needs Response in SqlClient Boardon Nov 21, 2025
  5. locked and limited conversation to collaborators on Nov 21, 2025
  6. converted this issue into a discussion #3795 on Nov 21, 2025
  7. moved this from Needs Response to Done in SqlClient Boardon Nov 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions