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
21.65k stars 6.53k forks source link

[REQ] Support for a oauth access token supplier for Java RestClient clients #19943

Open twonky4 opened 1 hour ago

twonky4 commented 1 hour 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 oauth access tokens with using a RestClient 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.

Additional context

This was already implemented for RestTemplate OAuth or RestClient HttpBearerAuth.

twonky4 commented 1 hour ago

(working on a fix for this)