Skip to content

Commit

Permalink
feat: Add did resolver and method support per OpSession
Browse files Browse the repository at this point in the history
  • Loading branch information
nklomp committed Feb 25, 2022
1 parent a9f7afc commit 9378b45
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions packages/did-auth-siop-op-authenticator/src/session/OpSession.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,12 +121,11 @@ export class OpSession {
}
}

const resolveOpts = this.resolver ? { resolver: this.resolver } : { didMethods }
const options: SIOP.VerifyAuthenticationRequestOpts = {
verification: {
mode: SIOP.VerificationMode.INTERNAL,
resolveOpts: {
didMethods,
},
resolveOpts,
},
nonce: args.requestURI.requestPayload.nonce,
}
Expand Down Expand Up @@ -240,13 +239,14 @@ export class OpSession {
.suppliedSignature(SuppliedSigner(keyRef, context, this.getKeyAlgorithm(keyRef.type)), identifier.did, identifier.controllerKeyId)
.registrationBy(SIOP.PassBy.VALUE)
.response(SIOP.ResponseMode.POST)
if (supportedDidMethods) {
if (supportedDidMethods && supportedDidMethods.length > 0) {
supportedDidMethods.forEach((method) => builder.addDidMethod(method))
}
if (resolver) {
console.log(`Resolver supplied: ${JSON.stringify(resolver)}`)
builder.defaultResolver(resolver)
}
if (providedDidResolvers) {
if (providedDidResolvers && providedDidResolvers.length > 0) {
providedDidResolvers.forEach((providedResolver) => builder.addResolver(providedResolver.didMethod, providedResolver.resolver))
}

Expand Down

0 comments on commit 9378b45

Please sign in to comment.