OpenAPITools / openapi-generator

OpenAPI Generator allows generation of API client libraries (SDK generation), server stubs, documentation and configuration automatically given an OpenAPI Spec (v2, v3)
https://openapi-generator.tech
Apache License 2.0
20.51k stars 6.27k forks source link

[REQ] Support for a bearer token supplier for Java RestTemplate clients #19000

Closed GregDThomas closed 5 days ago

GregDThomas commented 5 days ago

Is your feature request related to a problem? Please describe.

Under certain circumstances it is useful to be able to provide a supplier for bearer tokens with using a RestTemplate based Java client.

Describe the solution you'd like

The ApiClient currently supports setAccessToken(String) method - this is extended so that a setAccessToken(Supplier<String>) can be invoked.

GregDThomas commented 5 days ago

(working on a fix for this)