Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Make token issuer validation optional #1096

Open
wants to merge 1 commit into
base: 1.9.x
Choose a base branch
from

Conversation

Afanas10101111
Copy link
Contributor

Description

Make spring.security.oauth2.resourceserver.jwt.issuer-uri optional

  • Comment property in application.properties
  • Add on/off switch to the kube config

Related issue(s)

Copy link

This pull request has been automatically marked as stale because it has not had recent activity 😴

It will be closed in 30 days if no further activity occurs. To unstale this pull request, add a comment with detailed explanation.

There can be many reasons why some specific pull request has no activity. The most probable cause is lack of time, not lack of interest. Microcks is a Cloud Native Computing Foundation project not owned by a single for-profit company. It is a community-driven initiative ruled under open governance model.

Let us figure out together how to push this pull request forward. Connect with us through one of many communication channels we established here.

Thank you for your patience ❤️

@github-actions github-actions bot added the stale State due to inactivity label Mar 23, 2024
@lbroudoux lbroudoux changed the base branch from master to 1.9.x April 3, 2024 15:09
@lbroudoux
Copy link
Member

Changing base to the 1.9.x branch that is the development one.

@lbroudoux lbroudoux added keep-open Explicitily keep open kind/enhancement component/install and removed stale State due to inactivity labels Apr 3, 2024
@lbroudoux
Copy link
Member

Hello,

I've tested this one locally by just commenting the spring.security.oauth2.resourceserver.jwt.issuer-uri property in application.properties.

The problem is that I can no longer start the application because it complains of a missing JwtDecoder bean:

16:21:02.505  WARN 4453 --- [      main] ConfigServletWebServerApplicationContext : Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'org.springframework.security.config.annotation.web.configuration.WebSecurityConfiguration': Unsatisfied dependency expressed through method 'setFilterChains' parameter 0: Error creating bean with name 'configureAPISecurityFilterChain' defined in class path resource [io/github/microcks/config/SecurityConfiguration.class]: Failed to instantiate [org.springframework.security.web.SecurityFilterChain]: Factory method 'configureAPISecurityFilterChain' threw exception with message: No qualifying bean of type 'org.springframework.security.oauth2.jwt.JwtDecoder' available
16:21:02.528 ERROR 4453 --- [      main] o.s.b.d.LoggingFailureAnalysisReporter   : 

***************************
APPLICATION FAILED TO START
***************************

Description:

Parameter 0 of method setFilterChains in org.springframework.security.config.annotation.web.configuration.WebSecurityConfiguration required a bean of type 'org.springframework.security.oauth2.jwt.JwtDecoder' that could not be found.


Action:

Consider defining a bean of type 'org.springframework.security.oauth2.jwt.JwtDecoder' in your configuration.

So I think we should at least also adapt the SecurityConfiguration right?

@lbroudoux
Copy link
Member

In the case of my local application, it can start correctly if I add the spring.security.oauth2.resourceserver.jwt.jwk-set-uri property instead. I have to refresh my understanding on OIDC/OAuth2 to understand why...

@Afanas10101111
Copy link
Contributor Author

Hello!
I really missed this when describing the problem, sorry. Of course, we must have at least one issuer-uri or jvc-set-uri property to configure the resource server according to the manual.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants