Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(prism-agent): perform percent encoding on auth header for token introspection request #780

Merged
merged 1 commit into from
Nov 9, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import zio.*
import zio.http.*
import zio.json.*

import java.net.URLEncoder
import java.nio.charset.StandardCharsets
import scala.jdk.CollectionConverters.*

final case class TokenIntrospection(active: Boolean, sub: Option[String])
Expand Down Expand Up @@ -61,7 +63,10 @@ class KeycloakClientImpl(client: AuthzClient, httpClient: Client, keycloakConfig
url = introspectionUrl,
method = Method.POST,
headers = baseFormHeaders ++ Headers(
Header.Authorization.Basic(keycloakConfig.clientId, keycloakConfig.clientSecret)
Header.Authorization.Basic(
username = URLEncoder.encode(keycloakConfig.clientId, StandardCharsets.UTF_8),
password = URLEncoder.encode(keycloakConfig.clientSecret, StandardCharsets.UTF_8)
)
),
content = Body.fromURLEncodedForm(
Form(
Expand Down
Loading