Skip to content

Commit

Permalink
Explicitly specify scope and audience in client credentials config
Browse files Browse the repository at this point in the history
  • Loading branch information
mpgxvii committed Nov 28, 2024
1 parent c0f4baf commit f237a9a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ data class ClientCredentialsConfig(
val tokenUrl: String,
val clientId: String? = null,
val clientSecret: String? = null,
val additionalParameters: Map<String, String>? = null,
val scope: String? = null,
val audience: 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,9 +56,8 @@ 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)
}
authConfig.scope?.let { append("scope", it) }
authConfig.audience?.let { append("audience", it) }
},
) {
accept(ContentType.Application.Json)
Expand Down

0 comments on commit f237a9a

Please sign in to comment.