Auth0 Home Blog Docs

Code sample project for implementing the Resource Owner Password Grant using .NET Core

Hi,

I am looking for code sample project for implementing the Resource Owner Password Grant using .NET Core, which can be downloaded and ran locally straight away.

The link below contains only C# code snippet,

https://auth0.com/docs/api-auth/tutorials/password-grant

Any idea?

We don’t have a sample for that, but basically it comes down to this:

var client = new AuthenticationApiClient(new Uri("https://YOUR_AUTH0_DOMAIN"));
var result = await client.GetTokenAsync( 
  new ResourceOwnerTokenRequest  {
    ClientId = [...],
    ClientSecret = [...],
    Username = [...],
    Password = [...]
  }
);
1 Like

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.