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

Spring Authorization Server Metadata Endpoint not compatible #2606

Closed
jsantana3c opened this issue May 31, 2024 · 8 comments
Closed

Spring Authorization Server Metadata Endpoint not compatible #2606

jsantana3c opened this issue May 31, 2024 · 8 comments

Comments

@jsantana3c
Copy link

Describe the bug

  • Spring Authorization Server 1.3.0 metadata endpoint not compatible, it generates a "Null" Path, which prevents the serialization of jackson, preventing the creation of the openapi json.

To Reproduce
Steps to reproduce the behavior:

  • What version of spring-boot you are using? 3.3.0
  • What modules and versions of springdoc-openapi are you using? webmvc-ui-starter
  • What is the actual and the expected result using OpenAPI Description (yml or json)? json
  • Provide with a sample code (HelloController) or Test that reproduces the problem -> just add spring authorization server with defaults

Expected behavior

  • spring authorization server metadata endpoint default url
    Screenshots
    the matcher is a lambda, so that's probably the reason why the code doesn't work properly
    image

so in the method
org.springdoc.core.configuration.SpringDocSecurityOAuth2Customizer#buildPath
image
no matching is being done, and the path ends up being null.

Additional context
spring is checking if it has multipleIssuers, so maybe you can guys customize the code and check if isMultipleIssuersAllowed directly and apply the default DEFAULT_OAUTH2_AUTHORIZATION_SERVER_METADATA_ENDPOINT_URI, otherwise leave it with the /** by default?

@senowang
Copy link

senowang commented Jun 7, 2024

you just exclude @SpringBootApplication(exclude = {SpringDataWebAutoConfiguration.class}) and it will be fine

@aschade92
Copy link

aschade92 commented Jun 11, 2024

you just exclude @SpringBootApplication(exclude = {SpringDataWebAutoConfiguration.class}) and it will be fine

I'm having the same issue and this didn't fix the problem. From testing locally it looks like upgrading spring-security-oauth2-authorization-server to version 1.3.0 from 1.2.4 is when the issue started, so some change in the most recent version of that dependency started the issue.

If I had to guess it was this change that's causing the issue: spring-projects/spring-authorization-server@4cfe59c

@senowang
Copy link

you just exclude @SpringBootApplication(exclude = {SpringDataWebAutoConfiguration.class}) and it will be fine你只需排除 (exclude = {SpringDataWebAutoConfiguration.class}) 就可以了

I'm having the same issue and this didn't fix the problem. From testing locally it looks like upgrading spring-security-oauth2-authorization-server to version 1.3.0 from 1.2.4 is when the issue started, so some change in the most recent version of that dependency started the issue.我遇到了同样的问题,但这并没有解决问题。从本地测试来看,升级 spring-security-oauth2-authorization-server 到版本似乎是问题开始时的版本 1.3.0 1.2.4 ,因此该依赖项的最新版本中的一些更改引发了问题。

If I had to guess it was this change that's causing the issue: spring-projects/spring-authorization-server@4cfe59c如果我不得不猜测是这个变化导致了这个问题:spring-projects/spring-authorization-server@ 4cfe59c

you can see this issues spring-projects/spring-data-commons#2937

@bnasslahsen
Copy link
Collaborator

@jsantana3c,

The check if isMultipleIssuersAllowed can be done only in spring-security context on the runtime of the http request.
I have added a fix so both endpoints are exposed by default.

@strangeundersun
Copy link

@jsantana3c,

The check if isMultipleIssuersAllowed can be done only in spring-security context on the runtime of the http request. I have added a fix so both endpoints are exposed by default.

Hey @bnasslahsen, is there a workaround before the fix released? I really can't downgrade authorization server to 1.2.4.
And it would be great if you provide the time schedule that we can get the fix in a release. Thanks!

@joaquinjsb
Copy link

@bnasslahsen I just tried the release candidate, and seems that it's still not working.

@bnasslahsen
Copy link
Collaborator

@joaquinjsb,

Not working, will not really help :)

Feel free to provide a Minimal, Reproducible Example - with HelloController that reproduces the problem.

Remember, contributions to this repository should follow its contributing guidelines

@joaquinjsb
Copy link

sure, i'lll create another issue, but seems that the exception is still the same:
com.fasterxml.jackson.databind.JsonMappingException: Null key for a Map not allowed in JSON (use a converting NullKeySerializer?) (through reference chain: io.swagger.v3.oas.models.OpenAPI["paths"]->io.swagger.v3.oas.models.Paths["null"])

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

No branches or pull requests

6 participants