Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
DharshanBJ opened this issue Feb 11, 2025 · 1 comment
Labels
needs attention Delete label after triage Possible-Solution public-client Similar-Issue untriaged Do not delete. Needed for Automation

Comments

@DharshanBJ
Copy link
Contributor

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

@DharshanBJ DharshanBJ added needs attention Delete label after triage untriaged Do not delete. Needed for Automation labels Feb 11, 2025
Copy link

Here are some similar issues that might help you. Please check if they can solve your problem.


Possible solution (Extracted from existing issue, might be incorrect; please verify carefully)

Device code flow isn't supported for non-Entra Identity Providers.

Reference:

@DharshanBJ DharshanBJ changed the title Device Code Flow causes NotImplementedException for non-Entra authorities NotImplementedException thrown for non-Entra authorities in Device code flow Feb 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs attention Delete label after triage Possible-Solution public-client Similar-Issue untriaged Do not delete. Needed for Automation
Projects
None yet
Development

No branches or pull requests

1 participant