Comments (12)
@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.
<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.
@asukhyy which version are you using? Do you have a full stacktrack?
from okta-auth-java.
(clicked wrong button, reopened)
from okta-auth-java.
@asukhyy thanks! can you include your pom dependencies?
from okta-auth-java.
@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.
@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.
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.
@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.
@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.
@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.
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)
- Unable to use "correctAnswer" from AuthenticationResponse. HOT 17
- unable to find API to send MFA Enroll activation link via email/sms HOT 3
- Error while updating Plaid SDK 3.5.0 (Duplicate class org.bouncycastle.LICENSE) HOT 3
- Missing nullability annotations in AuthenticationStateHandler HOT 3
- is:issue is:open Okta authentication crashes, maybe okhttp library compatibility. HOT 4
- HttpClientConfiguration.getRequestExecutorParams() deprecated
- AuthenticationException localizedMessages do not adhere to Android device locale settings HOT 1
- authenticationClient.authenticate() does not return locked_out status HOT 1
- 2.0.5 dependencies result in build error HOT 2
- Resend OTP after 5 minutes - MFA. HOT 4
- enrollFactor method HOT 12
- DefaultAuthenticationClient.translateException() should be able to handle null errorCode HOT 2
- Failed resolution of: Ljava/time/format/DateTimeFormatter on Android 7 devices HOT 6
- Getting NoClassDefFound for BaseClient.java while using okta-authn-sdk-api:2.0.9 with okta-sdk-api:10.0.0 HOT 4
- Upgrade dependency okta-sdk-java version HOT 7
- Security vulnerability via transitive `dependencybcprov-jdk18on:1.75` HOT 3
- forgot password with trusted application HOT 9
- Primary authentication with trusted application not supported by SDK HOT 4
- Authentication Client Verify Factor throws Resource Exception instead of AuthenticationException HOT 4
- Incorrect key while retrieving correct answer from EmbeddedResponse HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from okta-auth-java.