User Authentication in Java SDK


I’m using the Java SDK and I would like to enable user login. Is there a method for that? I did not see any user authentication in the Client interface. Am I missing something?



Hey @amir!

Just creating the user or the actual authentication of the user?

For user creation (with a password):

(For actual auth, you have a few options, but let me know if that is what you are looking for)

Hi @bdemers!

I want to authenticate an existing user with username and password.

We recommend using OIDC/OAuth 2.0 when possible as this avoids your application needing to handle sensitive credentials.

If you are using Spring, this is the easiest option: (you could use Spring Security as well)

For Android take a look at these samples:

Lastly, if you need to deal with credentials directly (and understand the associated risks) you could use:


I wasn’t aware of the okta-auth-java library.