Skip to content

Device Code Flow causes NotImplementedException for non-Entra authorities #5126

@girlpunk

Description

@girlpunk

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

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

A token should be retrieved, using the device code flow

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