diff --git a/packages/siopv2-oid4vp-rp-auth/src/agent/SIOPv2RP.ts b/packages/siopv2-oid4vp-rp-auth/src/agent/SIOPv2RP.ts index d55ab7f96..abfe76265 100644 --- a/packages/siopv2-oid4vp-rp-auth/src/agent/SIOPv2RP.ts +++ b/packages/siopv2-oid4vp-rp-auth/src/agent/SIOPv2RP.ts @@ -198,6 +198,25 @@ export class SIOPv2RP implements IAgentPlugin { if (!options) { throw Error(`Could not get specific nor default options for definition ${definitionId}`) } + if (this.opts.defaultOpts) { + if (!options.didOpts) { + options.didOpts = this.opts.defaultOpts?.didOpts + } else { + if (!options.didOpts.identifierOpts) { + options.didOpts.identifierOpts = this.opts.defaultOpts.didOpts.identifierOpts + } + if (!options.didOpts.resolveOpts) { + options.didOpts.resolveOpts = this.opts.defaultOpts.didOpts.resolveOpts + } + if (!options.didOpts.supportedDIDMethods) { + options.didOpts.supportedDIDMethods = this.opts.defaultOpts.didOpts.supportedDIDMethods + } + if (!options.supportedVersions) { + options.supportedVersions = this.opts.defaultOpts.supportedVersions + } + } + } + return options }