Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use x509_san_dns Client Id Scheme #815

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
Original file line number Diff line number Diff line change
Expand Up @@ -371,9 +371,11 @@ class VerifierServlet : BaseHttpServlet() {
private val clientId: String by lazy {
var ret = configuration.getValue("verifierClientId")
if (ret == null || ret.length == 0) {
ret = baseUrl
// Remove the http:// or https:// from the baseUrl.
val startIndex = baseUrl.findAnyOf(listOf("://"))?.first
ret = if (startIndex == null) baseUrl else baseUrl.removeRange(0, startIndex+3)
}
ret
"x509_san_dns:$ret"
}

private fun createSingleUseReaderKey(): Pair<EcPrivateKey, X509CertChain> {
Expand Down Expand Up @@ -885,6 +887,7 @@ lrW+vvdmRHBgS+ss56uWyYor6W7ah9ygBwYFK4EEACI=

val claimsSet = JWTClaimsSet.Builder()
.claim("client_id", clientId)
.claim("client_id_scheme", "x509_san_dns")
.claim("response_uri", responseUri)
.claim("response_type", "vp_token")
.claim("response_mode", "direct_post.jwt")
Expand Down
4 changes: 3 additions & 1 deletion server/src/main/webapp/WEB-INF/web.xml
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,9 @@
</init-param>

<init-param>
<!-- The ClientID to use. If left blank the value of `verifierBaseUrl` is used. -->
<!-- The ClientID to use, without the client_id_scheme prefix.
If left blank the value of `verifierBaseUrl` is used.
-->
<param-name>verifierClientId</param-name>
<param-value></param-value>
</init-param>
Expand Down
Loading