Trying (unsuccessfully) to use the Java API Skip to main content
How satisfied are you with the Okta Help Center?
Thank you for your feedback!
How satisfied are you with the Okta Help Center?
Very Dissatisfied
Very satisfied
Enter content less than 200 characters.
Ask Search:
Mark AmosMark Amos 

Trying (unsuccessfully) to use the Java API

I've been trying to use a simple Java app to access the Okta API and I've been having a problem. It compiles OK, but when I execute it, I get the exception listed below. It's apparently caused by the AuthApiClient call.

Am I missing something in the attached code, or is this perhaps a Java configuration error?

Any help?

import com.okta.sdk.clients.AuthApiClient;
import com.okta.sdk.framework.ApiClientConfiguration; i
mport com.okta.sdk.models.auth.AuthResult;

class AuthJavaApp {
    public static void main(String args[])
            throws IOException {
        String relayState="";
        ApiClientConfiguration oktaSettings = new     ApiClientConfiguration("", [my API key]);     AuthApiClient authClient = new AuthApiClient(oktaSettings);     AuthResult result = authClient.authenticate([a userID], [a user password], relayState);
    String status = result.getStatus();

Exception in thread "main" java.lang.NoClassDefFoundError: com/fasterxml/jackson/core/type/TypeReference
    at AuthJavaApp.main(
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(
    at java.lang.reflect.Method.invoke(
    at com.intellij.rt.execution.application.AppMain.main(
Caused by: java.lang.ClassNotFoundException: com.fasterxml.jackson.core.type.TypeReference
    at java.lang.ClassLoader.loadClass(
    at sun.misc.Launcher$AppClassLoader.loadClass(
    at java.lang.ClassLoader.loadClass(
    ... 6 more
Mark AmosMark Amos
Nevermind.... It was a couple of missing .jar's...