Giter Site home page Giter Site logo

Comments (12)

asukhyy avatar asukhyy commented on June 20, 2024 1

@bdemers latest release version 0.1.0, jdk version 1.8.0_162

It is easy to reproduce by next code snippet:

import com.okta.authn.sdk.client.AuthenticationClient;
import com.okta.authn.sdk.client.AuthenticationClients;
import com.okta.authn.sdk.resource.AuthenticationResponse;

public class Main {
	public static void main(String[] args) {
		AuthenticationClient client = AuthenticationClients.builder()
			.setOrgUrl("http://any.tld")
			.build();

		AuthenticationResponse response = client.instantiate(AuthenticationResponse.class);
	}
}

from okta-auth-java.

asukhyy avatar asukhyy commented on June 20, 2024 1
		<dependency>
			<groupId>com.okta.sdk</groupId>
			<artifactId>okta-sdk-api</artifactId>
			<version>${okta.version}</version>
		</dependency>
		<dependency>
			<groupId>com.okta.authn.sdk</groupId>
			<artifactId>okta-authn-sdk-api</artifactId>
			<version>${okta.authn.version}</version>
		</dependency>
		<dependency>
			<groupId>com.okta.authn.sdk</groupId>
			<artifactId>okta-authn-sdk-impl</artifactId>
			<version>${okta.authn.version}</version>
			<scope>compile</scope>
		</dependency>
		<dependency>
			<groupId>com.okta.sdk</groupId>
			<artifactId>okta-sdk-impl</artifactId>
			<version>${okta.version}</version>
			<scope>compile</scope>
		</dependency>
		<dependency>
			<groupId>com.okta.sdk</groupId>
			<artifactId>okta-sdk-httpclient</artifactId>
			<version>${okta.version}</version>
			<scope>runtime</scope>
		</dependency>

where

<okta.version>1.1.0</okta.version>
<okta.authn.version>0.1.0</okta.authn.version>

from okta-auth-java.

bdemers avatar bdemers commented on June 20, 2024

@asukhyy which version are you using? Do you have a full stacktrack?

from okta-auth-java.

bdemers avatar bdemers commented on June 20, 2024

(clicked wrong button, reopened)

from okta-auth-java.

bdemers avatar bdemers commented on June 20, 2024

@asukhyy thanks! can you include your pom dependencies?

from okta-auth-java.

bdemers avatar bdemers commented on June 20, 2024

@asukhyy Sorry for the delay,

The AuthenticationResponse class requires a payload when constructing which isn't compatible with the instantiate method.

You could call something like: AuthenticationResponse response = client.authenticate(...) to get a response object back.

Does that help?

from okta-auth-java.

asukhyy avatar asukhyy commented on June 20, 2024

@bdemers no really, just noticed that other responses have constructor with single argument of type com.okta.sdk.impl.ds.InternalDataStore, for example com.okta.sdk.impl.resource.session.DefaultSession#DefaultSession(com.okta.sdk.impl.ds.InternalDataStore).

from okta-auth-java.

bdemers avatar bdemers commented on June 20, 2024

The response [only] objects are constructed internally and populated with a map (based on the json response) before being returned.

For testing purposes i'd recommend using something like Mockito (or easy mock) to create objects. That said if this pattern is blocking you from doing something please let us know!

from okta-auth-java.

asukhyy avatar asukhyy commented on June 20, 2024

@bdemers I'm trying to use latest okta skds but also for backward compatibility previous not compatible on source code level okta skd is in use.

During migration period both sdks are present but only domain objects from latests sdks are exposed therefore domain objects from previous are adapted to latest one - therefore I need possability to instantiate them.
As result to instantiate latest domain objects instantiate method is used and this issue appears. I have workaround for that just using casting to have com.okta.sdk.impl.ds.InternalDataStore#instantiate where I can pass empty map.

from okta-auth-java.

bdemers avatar bdemers commented on June 20, 2024

@asukhyy that works!

I'd like to hear more about how you migrating. I'm trying to put together a quick migration doc

from okta-auth-java.

asukhyy avatar asukhyy commented on June 20, 2024

@bdemers just using standard adapter pattern where adaptee is previous version of Okta SKD, therefore to return new domain objects instantiate method is used and properties are set via setProperty method. Is it answer on your question?

from okta-auth-java.

bdemers avatar bdemers commented on June 20, 2024

Using InternalDataStore#instantiate is sounds like a good short term migration strategy. Going to close this issue.

Please reopen if you feel otherwise

from okta-auth-java.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.