diff --git a/src/main/kotlin/com/akeyless/ara/client/Auth.kt b/src/main/kotlin/com/akeyless/ara/client/Auth.kt index a7d5332..fc3c28f 100644 --- a/src/main/kotlin/com/akeyless/ara/client/Auth.kt +++ b/src/main/kotlin/com/akeyless/ara/client/Auth.kt @@ -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() } @@ -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}"), diff --git a/src/main/kotlin/com/akeyless/ara/client/HttpJson.kt b/src/main/kotlin/com/akeyless/ara/client/HttpJson.kt index 0088e1a..ec27833 100644 --- a/src/main/kotlin/com/akeyless/ara/client/HttpJson.kt +++ b/src/main/kotlin/com/akeyless/ara/client/HttpJson.kt @@ -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)) diff --git a/src/test/kotlin/com/akeyless/ara/client/AraLogicTest.kt b/src/test/kotlin/com/akeyless/ara/client/AraLogicTest.kt index 2d2df3e..020332c 100644 --- a/src/test/kotlin/com/akeyless/ara/client/AraLogicTest.kt +++ b/src/test/kotlin/com/akeyless/ara/client/AraLogicTest.kt @@ -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")) } }