API .NET using Okta.SDK Signin with username and password flow

I’m new Okta API. I can’t see any examples of using Okta with retrieve access and refresh token direct by providing a username and password without using the hosted widget.

It’s extraordinary how easy AWS Cognito SDK is compared Okta, spend nearly 2 hours reading through API still without any clear guidance how create access tokens through passing credentials using the SDK.

Also is any documentation anywhere on Id Tokens or Refresh tokens?

The only thing I’ve found is a few postman examples, which kinda work?

https://api/v1/authn
{
“username”: “”,
“password”: “”
}

Appreciate any guidance how to do ?

Cheers,
Nick

Hi there - welcome to Okta! It looks like you are trying to use the resource owner flow. You will definitely want to stick with the route of our APIs, as our dotnet SDK does not support this flow.

Here’s a walkthrough on setting this flow up using our API:

Of course this shows the call being made with cURL. I always find it helpful to download our postman collections, in this case the OpenID Connect collection. There are a bunch of code snippets here, including one for RestSharp if that is of any use to you:

I hope this helps!

Hi Cale, thank you so much for the details response. :slightly_smiling_face:

It looks like the resource owner flow is what I’m after.
Its pity donet SDK doesn’t have It. All good, as long as its possible I’m happy.

Thanks once again.

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