Skip to content

NotImplementedException thrown for non-Entra authorities in Device code flow #5134

@DharshanBJ

Description

@DharshanBJ

Library version used

4.68.0

.NET version

9.0.102

Scenario

PublicClient - desktop app

Is this a new or an existing app?

This is a new app or experiment

Issue description and reproduction steps

When following the documentation at https://learn.microsoft.com/en-us/entra/identity-platform/scenario-desktop-acquire-token-device-code-flow?tabs=dotnet to acquire an access token via device request, NotImplementedException is thrown. This appears to be coming from

microsoft-authentication-library-for-dotnet/src/client/Microsoft.Identity.Client/Instance/GenericAuthority.cs

Line 43 in 235d32d

throw new NotImplementedException();

Relevant code snippets

var Scopes = new string[] { "user.read" };

var pca = PublicClientApplicationBuilder
    .Create(ClientId)
    .WithExperimentalFeatures()
    .WithOidcAuthority(Authority)
    .WithDefaultRedirectUri()
    .Build();

pca.AcquireTokenWithDeviceCode(Scopes, deviceCodeResult =>
{
    Console.WriteLine(deviceCodeResult.Message);
    return Task.FromResult(0);
}).ExecuteAsync();

Expected behavior

No response

Identity provider

Other

Regression

No response

Solution and workarounds

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions