'OpenApi Swagger3 default clientId and Password

I'm using @SecurityScheme annotation in my Spring boot application. It works fine, I can authenticate via open api and call endpoints via Swagger, but I want to have default clientId/password, so consumers would not need to type it.

@SecurityScheme(name ="oauth2", 
                type = SecuritySchemeType.OAUTH2,
                flows = @OAuthFlows(clientCredentials = @OAuthFlow(tokenUrl = "https://someurl/token")))

Therefore, is it possible to add default credentials for the OpenApi calls?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source