Skip to content

Commit

Permalink
fix: fix incorrect addition of the localhost parameter in CredentialO…
Browse files Browse the repository at this point in the history
…ffer with the URL Builder
  • Loading branch information
chsavvaidis committed Feb 20, 2025
1 parent 7ae152e commit 14ed83c
Showing 1 changed file with 15 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,21 @@ object OpenID4VCI {
credentialOfferEndpoint: String = CROSS_DEVICE_CREDENTIAL_OFFER_URL,
customReqParams: Map<String, List<String>> = mapOf()
): String {
return URLBuilder(credentialOfferEndpoint).apply {
parameters.appendAll(parametersOf(CredentialOfferRequest(credOffer, customParameters = customReqParams).toHttpParameters()))
}.buildString()
val queryParams = CredentialOfferRequest(
credentialOffer = credOffer,
customParameters = customReqParams
).toHttpParameters()

val queryString = queryParams.entries
.flatMap { (key, values)
-> values.map {
value -> "$key=${value.encodeURLParameter()}"
}
}
.joinToString(separator = "&")

return "$credentialOfferEndpoint?$queryString"

}

fun getCredentialOfferRequestUrl(
Expand Down

0 comments on commit 14ed83c

Please sign in to comment.