Skip to content

[REQ][Kotlin] Support dynamic auth context for generated okhttp client #23835

@manujell73

Description

@manujell73

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

I am implementing a Kotlin Spring Boot app that calls another Rest API using a bearer auth. For some calls my normal API credentials are not enough and I have to use a token from my OAuth2 user context.
Since the current auth implementation uses static properties I cannot use that flow with my use case.

Describe the solution you'd like

A way to provide the auth token/credentials dynamically and not having to rely on the static properties.

Describe alternatives you've considered

Currently I am ignoring the provided solution and am using an interceptor directly in the OkHttpClient object that adds the auth header manually.

Additional context

I found this issue (#8946) from a few years ago that had this issue mentioned in a comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions