<iframe src="https://www.googletagmanager.com/ns.html?id=GTM-M74D8PB" height="0" width="0" style="display:none;visibility:hidden">
Loading
Skip to NavigationSkip to Main Content
0D50Z00008G7UtwSAFOkta Classic EngineIntegrationsAnswered2025-06-30T09:01:30.000Z2015-11-27T20:00:56.000Z2016-06-27T20:46:18.000Z
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;

import java.io.IOException;

@SuppressWarnings("serial")

 

class AuthJavaApp {

    public static void main(String args[])

            throws IOException {

        String relayState="";

        ApiClientConfiguration oktaSettings = new     ApiClientConfiguration("https://owenscorning.okta.com", [my API key]);     AuthApiClient authClient = new AuthApiClient(oktaSettings);     AuthResult result = authClient.authenticate([a userID], [a user password], relayState);

    String status = result.getStatus();

    System.out.print(status);

    }

}

 

Exception in thread "main" java.lang.NoClassDefFoundError: com/fasterxml/jackson/core/type/TypeReference

    at AuthJavaApp.main(Player.java:18)

    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

    at java.lang.reflect.Method.invoke(Method.java:497)

    at com.intellij.rt.execution.application.AppMain.main(AppMain.java:144)

Caused by: java.lang.ClassNotFoundException: com.fasterxml.jackson.core.type.TypeReference

    at java.net.URLClassLoader.findClass(URLClassLoader.java:381)

    at java.lang.ClassLoader.loadClass(ClassLoader.java:424)

    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)

    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)

    ... 6 more


  • oei2n (oei2n)

    Nevermind.... It was a couple of missing .jar's...
This question is closed.
Loading
Trying (unsuccessfully) to use the Java API