# Okta SDK for password flow

**URL:** <https://devforum.okta.com/t/okta-sdk-for-password-flow/6444>\
**Category:** Questions\
**Created:** [October 1, 2019, 5:33am UTC](https://devforum.okta.com/t/okta-sdk-for-password-flow/6444 "2019-10-01T05:33:59Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![dcao](https://avatars.discourse-cdn.com/v4/letter/d/9fc348/32.png) [@dcao](https://devforum.okta.com/u/dcao)\
**Post date:** [October 1, 2019, 5:33am UTC](https://devforum.okta.com/t/okta-sdk-for-password-flow/6444/1 "2019-10-01T05:33:59Z")

</div>

I need to use the password flow to request an access token from Okta. Here is the REST API endpoint I’m referring to [https://developer.okta.com/docs/guides/implement-password/use-flow/](https://developer.okta.com/docs/guides/implement-password/use-flow/). Is this supported in any Okta SDK?

---

<div class="post-metadata">

**Author:** ![abroadhurst](https://avatars.discourse-cdn.com/v4/letter/a/65b543/32.png) [@abroadhurst](https://devforum.okta.com/u/abroadhurst)\
**Post date:** [October 1, 2019, 8:25am UTC](https://devforum.okta.com/t/okta-sdk-for-password-flow/6444/2 "2019-10-01T08:25:07Z")

</div>

Most Oauth or OpenID flows are supported by the SDK.

---

<div class="post-metadata">

**Author:** ![bdemers](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/bdemers/32/23_2.png) [@bdemers](https://devforum.okta.com/u/bdemers)\
**Post date:** [October 1, 2019, 4:49pm UTC](https://devforum.okta.com/t/okta-sdk-for-password-flow/6444/3 "2019-10-01T16:49:25Z")

</div>

We recommend using an OAuth library (like Spring Security), for authentication flows.

Maybe we can point you in the right direction, why are you trying to use a password flow (in general I’d recommend against it)?

---

<div class="post-metadata">

**Author:** ![dcao](https://avatars.discourse-cdn.com/v4/letter/d/9fc348/32.png) [@dcao](https://devforum.okta.com/u/dcao)\
**Post date:** [October 1, 2019, 6:34pm UTC](https://devforum.okta.com/t/okta-sdk-for-password-flow/6444/4 "2019-10-01T18:34:14Z")

</div>

I have a REST API endpoint to allow the users to request for an access\_token with their username and password. This REST API is registered in Okta as “Native App” type. I was hoping that I can use one of the Okta SDKs to access the /token endpoint. But from your answer, looks like none of the Okta SDKs supports it. So, probably I can just use a plain REST HTTP client to access the /token. Do you see any issue if I do that?

---

<div class="post-metadata">

**Author:** ![bdemers](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/bdemers/32/23_2.png) [@bdemers](https://devforum.okta.com/u/bdemers)\
**Post date:** [October 1, 2019, 7:30pm UTC](https://devforum.okta.com/t/okta-sdk-for-password-flow/6444/5 "2019-10-01T19:30:48Z")

</div>

You could either make the call directly or use an OAuth library.  
Please note: you could obtain an access token with another flow (Authorization code with PKCE for example)  
Either way, take a look at [https://tools.ietf.org/html/rfc6749#section-4.3](https://tools.ietf.org/html/rfc6749#section-4.3)

---

<div class="post-metadata">

**Author:** ![abroadhurst](https://avatars.discourse-cdn.com/v4/letter/a/65b543/32.png) [@abroadhurst](https://devforum.okta.com/u/abroadhurst)\
**Post date:** [October 2, 2019, 7:59am UTC](https://devforum.okta.com/t/okta-sdk-for-password-flow/6444/6 "2019-10-02T07:59:11Z")

</div>

I recommend using openid instead. The users can login through okta then you can retrieve the token using the /token endpoint.

---

<div class="post-metadata">

**Author:** ![dcao](https://avatars.discourse-cdn.com/v4/letter/d/9fc348/32.png) [@dcao](https://devforum.okta.com/u/dcao)\
**Post date:** [October 4, 2019, 4:29pm UTC](https://devforum.okta.com/t/okta-sdk-for-password-flow/6444/7 "2019-10-04T16:29:57Z")

</div>

@abroadhurst Thank you for your suggestion! Unfortunately that does not fit into our use case.

---

<div class="post-metadata">

**Author:** ![andrea](https://sea1.discourse-cdn.com/oktadev/user_avatar/devforum.okta.com/andrea/32/2172_2.png) [@andrea](https://devforum.okta.com/u/andrea)\
**Post date:** [January 23, 2024, 7:25pm UTC](https://devforum.okta.com/t/okta-sdk-for-password-flow/6444/8 "2024-01-23T19:25:55Z")

</div>

Closed on January 23, 2024, 7:25pm UTC


