Skip to content

proxy with spring security oauth2 #16875

Open
@f1-outsourcing

Description

@f1-outsourcing

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.

  1. 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

  1. 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}
  1. 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://stackoverflow.com/questions/79551156/spring-boot-starter-oauth2-client-app-never-starts-when-oauth-host-unreachable

spring-projects/spring-boot#44985 (comment)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions