spring-projects / spring-projects/spring-security
proxy with spring security oauth2
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 9.6k
- Forks
- 6.3k
- Avg merge
- 2d 11h
- Merged PRs (30d)
- 52
Description
I am not really developer, so someone needs to check this but I have the impression these are buggy. Important with testing is thus that you block every other outgoing traffic except to the proxy. Otherwise you do not notice that some request are going past the proxy.
- when running in a proxy environment only, the issuer-uri is being gotten without proxy, resulting in a startup failure
java -Dhttps.proxyHost= -Dhttps.proxyPort= etc
- when commenting out the issuer-uri, something changes in the auth process and even though all custom endpoints are taken directly from the issuer-uri. Some issue arises during Spring Security's processing of the token, likely in .oauth2Login, when it tries to validate the token's claims or associate it with the client registration.
27 oauth2:
28 resourceserver:
29 jwt:
30 issuer-uri: ${JWT_URI}
31 jwt-custom-uri: ${JWT_URI}
32 jwk-set-uri: ${OIDC_JWKCRTURI}
33 connect-timeout: 5000
34 read-timeout: 5000
35 client:
36 registration:
37 keycloak:
38 client-id: ${OIDC_CLIENTID}
39 client-secret: ${OIDC_CLIENTSECRET}
40 authorization-grant-type: authorization_code
41 scope: ${OIDC_SCOPE:openid}
42 provider: keycloak
43 redirect-uri: "{baseUrl}/login/oauth2/code/{registrationId}"
44 provider:
45 keycloak:
46 #issuer-uri: ${OIDC_ISSUERURI} #breaks startup
47 authorization-uri: ${OIDC_AUTHURI}
48 token-uri: ${OIDC_TOKENURI}
49 user-info-uri: ${OIDC_USERURI}
50 jwk-set-uri: ${OIDC_JWKCRTURI}
- I think it is also weird that an application fails on startup when some external service is not available. The default should be just starting no need to check and download stuff.
https://github.com/spring-projects/spring-boot/issues/44985#event-17107137936
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the proxy-only startup scenario using the issuer-uri configuration, then compare it with the configuration using custom authorization, token, user-info, and JWK-set URIs. Inspect the oauth2Login processing and resource-server JWT startup paths, and verify that all external requests use the proxy and that startup behavior matches the intended requirement.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java, spring
- Domain
- authentication, security
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100