Comments (7)
Great idea!
Currently you can chain the methods though, so something link:
AuthenticationRequest request = authenticationClient.instantiate(AuthenticationRequest.class)
.setRelayState("some-relay-state")
.setUsername("[email protected]");
It requires a few extra lines though, are you thinking something like:
AuthenticationRequest request = AuthenticationRequestBuilder.instance()
.setRelayState("some-relay-state")
.setUsername("[email protected]")
.build();
To customize the user-agent just implement a UserAgentProvider
similar to this one: AuthnSdkUserAgentProvider
X-Forwarded-For
is a little tricker, can you explain that use case in a little more detail?
from okta-auth-java.
Thanks, I found the instantiate
method a little later on. Might be good to add to the readme. It's a viable work-around for now.
A small thing that I ran into with that was when instantiating a subclass, the order of setter calls matters:
// Works
client.instantiate(VerifyPassCodeFactorRequest.class)
.setPassCode(passCode)
.setStateToken(token);
// Does not compile
client.instantiate(VerifyPassCodeFactorRequest.class)
.setStateToken(token) // returns a VerifyFactorRequest
.setPassCode(passCode); // No such method on VerifyFactorRequest
My app is essentially acting as a login portal / gateway...
The X-Forwarded-For
header requirement comes from the Okta API docs (See also.):
Okta supports the standard
X-Forwarded-For
HTTP header to forward the originating clientβs IP address if your application is behind a proxy server or acting as a login portal or gateway.
Similarly, I need to set the User-Agent
per request, which looks like it gets a bit tricky with the AuthnSdkUserAgentProvider
:
If your application is acting as a gateway or proxy, you should forward the
User-Agent
of the originating client with your API requests.
from okta-auth-java.
@jmalickenexient no update yet.
Your comment will help us prioritize this though, Thanks!
from okta-auth-java.
All good points.
I'll get back to you on the headers π€
from okta-auth-java.
@bdemers What is the update on this? The ability to send a X-Forwarded-* header and User-Agent header containing the originating client User-Agent is needed to follow the Okta guidance on implementing a gateway application like @mfulgo mentioned.
from okta-auth-java.
@bdemers does this new README section cover what was needed by this issue? https://github.com/okta/okta-auth-java#setting-request-headers-parameters-and-device-fingerprinting
from okta-auth-java.
From my perspective, I think this issue is addressed with the RequestContext
and the new README section.
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.