C# get token by sending user name password

Hi Guys

do we have any c# example to get jwt tokens (id, access) by using (username, passord) httpclient call
?

some one was doing like in CURL for example

curl --location --request POST ‘https://org.okta.com/oauth2/v1/token
–header ‘Accept: application/json’
–header ‘Content-Type: application/x-www-form-urlencoded’
–header ‘Content-Type: application/x-www-form-urlencoded’
–data-urlencode ‘grant_type=password’
–data-urlencode ‘username=test.user’
–data-urlencode ‘password=p@ssw0rd’
–data-urlencode ‘scope=openid’
–data-urlencode ‘client_id={{clientId}}’

We do provide several .NET SDKS which may be of use - I recommend first taking a look at this overview as well as our sample apps:

Do your application/authZ server support password grant?

1 Like

it should support it

Hi Do you manage to get this working ?. I am looking for my console application which on launch shoudl spin up our company OKTA page where user will autheticate and console app should get the token for further processing . Please let me know