Simple OKTA-SAML authentication using JAVA API REST

Hi,

I am very new to Java and OKTA (I am a systems admin).

We have an application running on WebSphere and already it’s configured to be trusted by Okta. The problem is that, in certain Workflows, we need to call a pop-up window requesting user and password to confirm an action (required by the FDA) using Java.

I am thinking of using Java and do a POST to /api/v1/authn, sending the parameters in Json format.

BUT I am not sure where to start, which .jars should I download?

I was trying using https://github.com/okta/okta-auth-java, but I have problems big time trying to resolve all the missing dependencies and I was expecting to include a simple .jar (not all the .javas included there) and call these functions:

	Client client = Clients.builder()
			.setOrgUrl("https://myURL.com")
			.setClientCredentials(new TokenClientCredentials("SomeAPIkey"))
			.build();

client.authenticate(“user”, “password”, “RelayState”, “stateHandler”);

In the name of God, I present here my help request, please help me.

Hey @TrustedAuth!

The new to Java might be the biggest hurdle. I’d recommend using Apache Maven to manage your dependencies. We have an example project here:

That said, I almost always recommend people try to see if an OIDC/OAuth2 option works for you before trying to use the Authentication API (with great power…). I cannot say if that would work for you given your FDA requirements.
We have a bunch of getting started with Spring Boot + OAuth posts on the Okta Blog:

I’d suggest you reach out to Okta support or sales, they can help you with some of those types of requirements too.

Thank you bdemers,

I recreated the project as Maven project and included the dependencies there and the .jars were magically downloaded.

Now the function works.

Thank you.