-
Notifications
You must be signed in to change notification settings - Fork 457
aadauthenticationfilter - failed to initialize userprincipal. com.nimbusds.jose.remotekeysourceexception: couldn't retrieve remote jwk set: read timed out #417
Comments
Any update on this. Please suggest how to increase timeout. |
@vipinsaini434 Could you share the detailed stack trace? The stack trace of the old issue you linked is out-of-date, as code has been updated since then. Meanwhile, could you check the WIP pull request #418 and build a local package, use local built package and check whether longer timeout fixes your issue? |
Thanks for your reply @sophiaso. Yeah i made the local build and it is working fine after increasing the timeout in 'nimbus-jose-jwt' code base.I saw the pull request as mentioned. This is a good idea to make it configurable. |
Version |
Hi, thanks for your help. How can I increasing the timeout? I have a autowired AADAuthenticationFilter, but I can't set the new timeout. |
@juanegt7 The timeout is configurable through:
In milliseconds. |
Hello, I changed the values but I have the same problem yet, I'm working with a internet network with proxy. Any ideas? |
@juanegt7 Thanks for your comments, it might be caused by a bug, could you clone this repo, build a local version for branch #470 and try whether it fixes your issue? (branch https://github.com/Microsoft/azure-spring-boot/tree/timeout-bugfix) |
Yes! The issue is fixed. Thanks for your help! Do we have a new version with this? |
@juanegt7 It's not released yet, but will try to release a new version recently. Will update here once released. |
Good night, I had the same problem and resolved with the @sophiaso branch. Prevision for release of fix in maven repository ? Thanks. |
@sophiaso any plan to merge this patch with master? |
Any updates? |
@sidyes, you can use latest release on 2.1.x or 2.2.x which include this fix.
|
For me the problem were outgoing requests specifially with this lib as we also have a proxy. protected void configure(HttpSecurity http) throws Exception {
**System.setProperty("java.net.useSystemProxies", "true");**
// stateless configuration
http.sessionManagement().sessionCreationPolicy(SessionCreationPolicy.NEVER);
// Allow preflight requests
http.cors();
// require OAuth JWT token from AzureAD app
http.authorizeRequests()
.anyRequest().authenticated();
// adding userid Password authentication filter to the filter chain
http.addFilterBefore(aadAuthFilter, UsernamePasswordAuthenticationFilter.class);
} |
Environment
Spring boot starter:
-azure-active-directory-spring-boot-sample
OS Type: Windows
Java version:
Summary
ERROR c.m.a.s.a.a.AADAuthenticationFilter - Failed to initialize UserPrincipal.
com.nimbusds.jose.RemoteKeySourceException: Couldn't retrieve remote JWK set: Read timed out
Getting exception of timeout. This exception is coming in AADAuthenticationFilter
This issue was raised previously as well #247
but it is closed now.
Is there any fix. I am using latest version 2.0.5 but still getting the same issue.
Reproduce steps
and run it after changing configuration files.
It is a intermittent issue. May be it is related to server and by default timeout configuraion is 250ms but could you please suggest is there any way to increase it.
Expected Results
Should use the default timeout and timeout should increased if it is taking longer time.
Or should be someway to configure it.
Actual Results
Throwing exception and failing API call.
The text was updated successfully, but these errors were encountered: