Skip to content

Include /oauth/token endpoint using OpenApi Swagger 1.6.5 #1481

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

Closed
AgusProg opened this issue Jan 28, 2022 · 4 comments
Closed

Include /oauth/token endpoint using OpenApi Swagger 1.6.5 #1481

AgusProg opened this issue Jan 28, 2022 · 4 comments

Comments

@AgusProg
Copy link

AgusProg commented Jan 28, 2022

Describe the bug
I'm trying to show /oauth/token endpoint in Swagger output JSON. I already include the following dependency into the project:

<dependency>
    <groupId>org.springdoc</groupId>
    <artifactId>springdoc-openapi-security</artifactId>
    <version>1.6.5</version>
</dependency>

I include the regular dependency too:

<dependency>
    <groupId>org.springdoc</groupId>
    <artifactId>springdoc-openapi-ui</artifactId>
    <version>1.6.5</version>
</dependency>

I'm using the following oauth dependency:

<dependency>
    <groupId>org.springframework.cloud</groupId>
    <artifactId>spring-cloud-starter-oauth2</artifactId>
</dependency>

When I go to the Swagger endpoint in browser, I'm getting the following endpoints:

/oauth/authorize
/oauth/check_token
/oauth/token_key

But, POST /oauth/token endpoint is not getting generated.

Could you help please?

@bnasslahsen
Copy link
Collaborator

spring-cloud-starter-oauth2 is not at all supported.
Try providing a Minimal, Reproducible Example - with HelloController that reproduces this missing endpoint. So we can know the exact problem you are facing.

@AgusProg
Copy link
Author

AgusProg commented Feb 1, 2022

Hello @bnasslahsen,

I found the solution. I created a HelloController and I realized that I had a proxy for retries (org.aspectj:aspectjrt:1.9.5).

I removed the class and the /oauth/token endpoint appears...

UPDATE: I include the proxy in the HelloController project and /oauth/token endpoint dissapears.

Do you know how I could include both?

@bnasslahsen
Copy link
Collaborator

@ZamasuG,

I don't have the elements to answer you.
Try providing a Minimal, Reproducible Example - with HelloController that reproduces this missing endpoint.

I am closing this ticket and it will reopened if you provide the relevant information.

@AgusProg
Copy link
Author

AgusProg commented Feb 3, 2022

Hello @bnasslahsen,

Sorry for the inconvenience. I have a Minimal, Reproducible Example - with HelloController here: https://github.com/ZamasuG/springdoc-hello-controller

While I was preparing the example for you, I realized that there are two dependencies that conflict with OpenApi:

		<dependency>
			<groupId>org.aspectj</groupId>
			<artifactId>aspectjrt</artifactId>
			<version>1.9.5</version>
		</dependency>

		<dependency>
			<groupId>org.springframework.cloud</groupId>
			<artifactId>spring-cloud-starter-netflix-hystrix</artifactId>
		</dependency>

If you remove one of them, /oauth/token endpoint appears. I don't know why. Anyways, I give you the example with the error.

Thanks you and sorry for the delay.

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

2 participants