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

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

Open
girlpunk opened this issue Feb 8, 2025 · 2 comments
Open

Comments

@girlpunk
Copy link

girlpunk commented Feb 8, 2025

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

@girlpunk girlpunk added needs attention Delete label after triage untriaged Do not delete. Needed for Automation labels Feb 8, 2025
@bgavrilMS bgavrilMS added Feature Request and removed untriaged Do not delete. Needed for Automation needs attention Delete label after triage labels Feb 11, 2025
@bgavrilMS bgavrilMS changed the title [Bug] Device Code Flow causes NotImplementedException [Bug] Device Code Flow causes NotImplementedException for non-Entra authorities Feb 11, 2025
@bgavrilMS
Copy link
Member

bgavrilMS commented Feb 11, 2025

Device code flow isn't supported for non-Entra Idenity Providers. What IdP do you use?

@bgavrilMS bgavrilMS changed the title [Bug] Device Code Flow causes NotImplementedException for non-Entra authorities Device Code Flow causes NotImplementedException for non-Entra authorities Feb 11, 2025
@girlpunk
Copy link
Author

I'm using the Authentik. The lack of support wasn't mentioned in the documentation, is it not possible to load the relevant information from the openid-configuration endpoint? If not, could this be specified manually in the configuration?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants