diff --git a/akka-javasdk/src/main/java/akka/javasdk/JwtClaims.java b/akka-javasdk/src/main/java/akka/javasdk/JwtClaims.java index 9ad3309c2..5483eb9fb 100644 --- a/akka-javasdk/src/main/java/akka/javasdk/JwtClaims.java +++ b/akka-javasdk/src/main/java/akka/javasdk/JwtClaims.java @@ -26,10 +26,11 @@ public interface JwtClaims { /** * Returns all the claims as a map of strings to strings. * - *

If the claim is a String claim, the value will be the raw String. For all other types, it - * will be the value of the claim encoded to JSON. + *

Note that all values will be encoded to JSON. This means that if the value is a string, it + * will include the quotes. E.g. "\"my-string-claim\"" for a string claim. * - * @return All the claims represented as a map of string claim names to string values. + * @return All the claims represented as a map of string claim names to string values containing a + * JSON representation of its value. */ Map asMap(); diff --git a/akka-javasdk/src/main/scala/akka/javasdk/impl/http/JwtClaimsImpl.scala b/akka-javasdk/src/main/scala/akka/javasdk/impl/http/JwtClaimsImpl.scala index f86b588c0..6982b7324 100644 --- a/akka-javasdk/src/main/scala/akka/javasdk/impl/http/JwtClaimsImpl.scala +++ b/akka-javasdk/src/main/scala/akka/javasdk/impl/http/JwtClaimsImpl.scala @@ -33,11 +33,12 @@ class JwtClaimsImpl(jwtClaims: RuntimeJwtClaims) extends JwtClaims { /** * Returns all the claims as a map of strings to strings. * - *

If the claim is a String claim, the value will be the raw String. For all other types, it will be the value of - * the claim encoded to JSON. + *

Note that all values will be encoded to JSON. This means that if the value is a string, it will include the + * quotes. E.g. "\"my-string-claim\"" for a string claim. * * @return - * All the claims represented as a map of string claim names to string values. + * All the claims represented as a map of string claim names to string values containing a JSON representation of + * its value. */ override def asMap(): util.Map[String, String] = jwtClaims.getAllClaimNames