Skip to content

Commit

Permalink
Add support for additional parms for client credentials ktor oauth
Browse files Browse the repository at this point in the history
  • Loading branch information
mpgxvii committed Nov 28, 2024
1 parent 63f9314 commit c0f4baf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ data class ClientCredentialsConfig(
val tokenUrl: String,
val clientId: String? = null,
val clientSecret: String? = null,
val additionalParameters: Map<String, String>? = null,
) {
/**
* Fill in the client ID and client secret from environment variables. The variables are
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ fun Auth.clientCredentials(
append("grant_type", "client_credentials")
append("client_id", authConfig.clientId)
append("client_secret", authConfig.clientSecret)
authConfig.additionalParameters?.forEach { (key, value) ->
append(key, value)
}
},
) {
accept(ContentType.Application.Json)
Expand Down

0 comments on commit c0f4baf

Please sign in to comment.