question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Not all ouath endpoints generated in Swagger

See original GitHub issue

I have Oauth configuration like this:

public static final String OAUTH_PATH = "/oauth/token";

openAPI.addSecurityItem(new SecurityRequirement().addList(SECURITY_SCHEMA_OAUTH2, Collections.emptyList()))
       .components(
		       new Components()
				       .addSecuritySchemes(SECURITY_SCHEMA_OAUTH2,
				                           new SecurityScheme()
						                           .type(SecurityScheme.Type.OAUTH2)
						                           .bearerFormat(BEARER_FORMAT)
						                           .flows(new OAuthFlows()
								                                  .password(new OAuthFlow()
										                                            .refreshUrl(OAUTH_PATH)
										                                            .tokenUrl(OAUTH_PATH)
										                                            .scopes(new Scopes())))));


However generated documentation have only: auth-controller /whoAmI /oauth/token/revokeById/{tokenId} /tokens/revokeRefreshToken/{tokenId}

I miss /oauth/token endpoint, which is used to generate and refresh tokens. Of course oauth flow is working ok

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
bnasslahsencommented, Jan 11, 2020

Hi @kdanko and @Marx2 ,

We will add introduce the support of spring-security-oauth2 authorization server, in the next release v1.2.27: You can have a look at snapshot and test it in advance. Make sure you reference also:

 <dependency>
      <groupId>org.springdoc</groupId>
      <artifactId>springdoc-openapi-security</artifactId>
      <version>1.2.27</version>
   </dependency>
1reaction
Marx2commented, Jan 8, 2020

The problem is that “/oauth/token” endpoint is NOT visible in Swagger documentation. My service is client and server at the same time, so it should list all endpoints for oauth, and the most important is “/oauth/token”, which is not displayed. I’m attaching screenshot of generated documentation, “/oauth/token” is missing:

image

I think task should be reopened

Read more comments on GitHub >

github_iconTop Results From Across the Web

OAuth 2.0 - Swagger
OAuth 2.0 is an authorization protocol that gives an API client limited access to user data on a web server. GitHub, Google, and...
Read more >
OAuth2 authorization endpoint is not listed in Swagger using ...
I use Spring Security 5 to build OAuth2 login and SpringFox for Swagger. There is an endpoint /oauth2/authorization/my-oauth , but this ...
Read more >
Hiding Endpoints From Swagger Documentation in Spring Boot
Let's have a look at how we can hide endpoints from Swagger API ... The most common scenario to do so is when...
Read more >
F.A.Q - Springdoc-openapi
It detects the overloaded endpoints, and generates parameters.schema.oneOf. What is a proper way to set up Swagger UI to use provided spec.yml?
Read more >
OpenAPI/Swagger Support - GitHub Pages
You can customize the generated Swagger using the standard Swagger Annotations. ... You can also provide some tags for all endpoints with the ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found