Skip to content

Commit c0f4baf

Browse files
committed
Add support for additional parms for client credentials ktor oauth
1 parent 63f9314 commit c0f4baf

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

radar-commons-kotlin/src/main/kotlin/org/radarbase/ktor/auth/ClientCredentialsConfig.kt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ data class ClientCredentialsConfig(
66
val tokenUrl: String,
77
val clientId: String? = null,
88
val clientSecret: String? = null,
9+
val additionalParameters: Map<String, String>? = null,
910
) {
1011
/**
1112
* Fill in the client ID and client secret from environment variables. The variables are

radar-commons-kotlin/src/main/kotlin/org/radarbase/ktor/auth/OAuthClientProvider.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,9 @@ fun Auth.clientCredentials(
5656
append("grant_type", "client_credentials")
5757
append("client_id", authConfig.clientId)
5858
append("client_secret", authConfig.clientSecret)
59+
authConfig.additionalParameters?.forEach { (key, value) ->
60+
append(key, value)
61+
}
5962
},
6063
) {
6164
accept(ContentType.Application.Json)

0 commit comments

Comments
 (0)