diff --git a/modules/openid-federation-client/src/commonMain/kotlin/com/sphereon/oid/fed/client/mapper/JsonMapper.kt b/modules/openid-federation-client/src/commonMain/kotlin/com/sphereon/oid/fed/client/mapper/JsonMapper.kt index 5cd3c302..d99c2c48 100644 --- a/modules/openid-federation-client/src/commonMain/kotlin/com/sphereon/oid/fed/client/mapper/JsonMapper.kt +++ b/modules/openid-federation-client/src/commonMain/kotlin/com/sphereon/oid/fed/client/mapper/JsonMapper.kt @@ -34,8 +34,8 @@ fun decodeJWTComponents(jwtToken: String): JWT { throw InvalidJwtException("Invalid JWT format: Expected 3 parts, found ${parts.size}") } - val headerJson = Base64.decode(parts[0]).decodeToString() - val payloadJson = Base64.decode(parts[1]).decodeToString() + val headerJson = Base64.UrlSafe.decode(parts[0]).decodeToString() + val payloadJson = Base64.UrlSafe.decode(parts[1]).decodeToString() return try { JWT( diff --git a/modules/openid-federation-client/src/commonMain/kotlin/com/sphereon/oid/fed/client/trustchain/TrustChain.kt b/modules/openid-federation-client/src/commonMain/kotlin/com/sphereon/oid/fed/client/trustchain/TrustChain.kt index 05fec6f0..93165a0d 100644 --- a/modules/openid-federation-client/src/commonMain/kotlin/com/sphereon/oid/fed/client/trustchain/TrustChain.kt +++ b/modules/openid-federation-client/src/commonMain/kotlin/com/sphereon/oid/fed/client/trustchain/TrustChain.kt @@ -272,7 +272,7 @@ class DefaultTrustChainImpl( if (result != null) return result chain.removeLast() } - } catch (_: Exception) { + } catch (_: Exception) { // TODO distinguish between remote HTTP errors and internal errors return null }