Closed sidyes closed 4 years ago
use this azure.service.endpoints.global.aadKeyDiscoveryUri=i=https://login.microsoftonline.com/
Now it is using the correct jwk set uri but I still receive:
Couldn't retrieve remote JWK set: connect timed out
Any ideas how to fix this?
// Edit:
Or is the problem that I am using v2 ?
My jwt link is https://login.microsoftonline.com/<tenant id>/discovery/v2.0/keys
The default timeout is really low, increase using these settings azure.activedirectory.jwt-connect-timeout=2000 azure.activedirectory.jwt-read-timeout=2000
Ok I am getting closer!
The error has now changed to
AADAppRoleStatelessAuthenticationFilter : Failed to initialize UserPrincipal -> Couldn't retrieve remote JWK set: Connection refused: connect
Any thoughts on that?
Issue can be closed. The problem was my proxy configuration.
Adding System.setProperty("java.net.useSystemProxies", "true");
solved the problem.
Environment
Spring boot starter:
OS Type: Windows/Linux/MacOS
Java version:
Summary
I want to use the AAD spring boot starter to secure REST calls by validating the provided Bearer Token. I needed to adapt the jwk set uri. Thusi, I added the following to my application.yaml:
Unfortunately, I am always getting the following error when sending requests to the server with a authorization header:
Couldn't retrieve remote JWK set: connect timed out
I debugged the application and realized that the wrong URL is taken there: In the
RemoteJWKSet
class from nimbusds jwkSetURL is set to:https://login.microsoftonline.com/common/discovery/keys/
It seems that my configuration is just ignored here. Do you have a tip for me?Reproduce steps
Use the azure-active-directory-spring-boot-starter (v. 2.2.2) and try to change the jwk set uri property.
Expected Results
It should use the correct URI.
Actual Results
it uses the default common configuration.