Skip to content

Commit

Permalink
Merge pull request #22 from moratori/fix-bugs
Browse files Browse the repository at this point in the history
Modified to get the domain part from clientId.
  • Loading branch information
ryosuke-wakaba authored Jul 11, 2024
2 parents 91a268e + 8d78473 commit d25c7a8
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion tw2023_wallet/Services/OID/OpenIdProvider.swift
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,13 @@ class OpenIdProvider {
the Client Identifier MUST be a DNS name and match a dNSName Subject Alternative Name (SAN) [RFC5280] entry in the leaf certificate passed with the request.
*/
let (decoded, certificates) = verifedX5CJwt
if isDomainInSAN(certificate: certificates[0], domain: _clientId) {

guard let url = URL(string: _clientId),
let domainName = url.host else {
return .failure(.authRequestInputError(reason: .compliantError(reason: "Unable to get host name")))
}

if isDomainInSAN(certificate: certificates[0], domain: domainName) {
print("verify san entry success")
}
else {
Expand Down

0 comments on commit d25c7a8

Please sign in to comment.