Skip to content
Merged
Show file tree
Hide file tree
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
9 changes: 7 additions & 2 deletions src/main/kotlin/com/akeyless/ara/client/Auth.kt
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ object BrowserAuth {
val uri = URI(
"$base$path?access_id=${encode(accessId)}" +
"&redirect_uri=${encode(redirectUri)}" +
"&is_use_short_token=true",
"&is_use_short_token=true" +
"&product=$AKEYLESS_PRODUCT_ARA",
)
return uri.toString()
}
Expand Down Expand Up @@ -201,7 +202,11 @@ object Auth {
}

val base = config.gatewayUrl.trimEnd('/')
val response = http.postJson("$base/auth", authBody)
val response = http.postJson(
"$base/auth",
authBody,
mapOf(AKEYLESS_PRODUCT_HEADER to AKEYLESS_PRODUCT_ARA),
)
if (!response.ok) {
throw IllegalStateException(
Redaction.scrubMessage("Authentication failed (${response.status}): ${response.body}"),
Expand Down
6 changes: 6 additions & 0 deletions src/main/kotlin/com/akeyless/ara/client/HttpJson.kt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ import java.net.http.HttpResponse
import java.time.Duration
import java.util.Base64

/** HTTP header used by Auth for product-scoped client registration. */
const val AKEYLESS_PRODUCT_HEADER = "Akeyless-Product"

/** Product value for Agentic Runtime Authority / Secretless AI. */
const val AKEYLESS_PRODUCT_ARA = "ara"

class HttpJsonClient(
private val http: HttpClient = HttpClient.newBuilder()
.connectTimeout(Duration.ofSeconds(30))
Expand Down
1 change: 1 addition & 0 deletions src/test/kotlin/com/akeyless/ara/client/AraLogicTest.kt
Original file line number Diff line number Diff line change
Expand Up @@ -160,5 +160,6 @@ class BrowserAuthUrlTest {
assertTrue(url.contains("/api/saml-login"))
assertTrue(url.contains("access_id=acc"))
assertTrue(url.contains("is_use_short_token=true"))
assertTrue(url.contains("product=ara"))
}
}
Loading