Moving from springboot java to kotlin and http4k.
I found
fun provideOauthClient(
@Named("baseHttp") baseHttp: @JvmSuppressWildcards Function1<Request, Response>,
@Named(OAUTH_CLIENT_ID) clientId: String,
@Named(OAUTH_CLIENT_SECRET) clientSecret: String): @JvmSuppressWildcards HttpHandler {
val clientCredentials = Credentials(clientId, clientSecret)
val handler = ClientFilters.RefreshingOAuthToken(
oauthCredentials = clientCredentials,
tokenUri = Uri.of("/token"),
backend = baseHttp,
oAuthFlowFilter = ClientFilters.OAuthClientCredentials(clientCredentials),
gracePeriod = Duration.ofSeconds(1) ,
).then(baseHttp)
now I would like to expose a route that returns to the caller the jwt generated from RefreshingOAuthToken
. On SpringBoot I managed using ReactiveOAuth2AuthorizedClientManager
. Is there an equivalent for http4k?