{"_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator","_rev":"307-e375424a31ef73a18d57c0db178a0cda","name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","dist-tags":{"unstable":"0.9.1-unstable.104","latest":"0.11.0","next":"0.10.2-next.11"},"versions":{"0.1.2-unstable.135":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.1.2-unstable.135","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"^0.2.3","@sphereon/pe-js":"^0.5.1","@sphereon/ssi-sdk-core":"^0.1.2-unstable.135+6db9863","@veramo/core":"^3.1.1-next.15","@veramo/utils":"^3.1.1-next.15","cross-fetch":"^3.1.4","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.3.3","@veramo/cli":"^3.1.1-next.15","@veramo/did-provider-key":"^3.1.1-next.15","@veramo/did-resolver":"^3.1.1-next.15","did-resolver":"3.1.3","nock":"^13.2.1","typescript":"^4.5.2"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"6db9863785185c1b983e9af708e8506024e6414a","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.1.2-unstable.135","_nodeVersion":"14.18.2","_npmVersion":"lerna/4.0.0/node@v14.18.2+x64 (linux)","dist":{"integrity":"sha512-XsUntfT+e9lGJX1IVg7e/Wu01b1hCjzeVCm3qKleq6gKbGedV2L/PEcAIGnkeiSpbeUzfzySIjPcVvNQ1g6iIA==","shasum":"4fae4ad66ee554ccfe6f97d7d7bb1dab0d737deb","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.1.2-unstable.135.tgz","fileCount":24,"unpackedSize":94628,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhu1R1CRA9TVsSAnZWagAAa3AP/jc4QDI/JKhMRcnTpKgE\nlYifHz1BlLzNXrjZFEpA3ULVy9NlV674fgsMLawFjP6P5c+ngaaM5GLUaZdr\nyd1GpYIoOaEXE59qZzM3huO6PnZGEuYRDbf0mxI/rq6ONqjfdqiy5Rh4t+F7\nTgaqYhLLdMT/hm60HrEklw/G6kXXgjfQVNBANCZtiio6scJlnDD0ZTUnq/ry\nqhmVc3KX2eEmXJozEPKLRw2WOUpcgQWgejsda/BnOQCQQEIdYF6RtgzeO1kv\nLzw58CU+YsQ9OpGJoXniNBfD+8VeNln+MxDyIP/CrFSCCoN2iahITUHa36kf\no2qQto61HoCgrS33bEL8QAOxm2JosTLQSZ9QfaTL0HsE0jftweCiP/CXEcPY\naER/KJcFD3xOU6gPHu2hbCxAuE+toYpGSejkZDPDRYofLFq7S3nPvO0lz3Lc\niQOxNqysTJBjSJPYRcUpm8YJLk1t2x7TIQQJeeEdfQ1/+XXOtyvCTWQAwDOD\nRvg6u/+JaoBPjm7AEZ+CF5Sp6YgIiFCRTlyGpCx3mZkdNmKfdZLNX+2eRprP\nf+iHiPzcfh0nlTMbLx158CaBcBsN7WrbZV4TeQQz5DwKvdDZHAPnIdth1Uev\nypJ8082gQkRjdopOZxs3NA2CtEdU6CFzEgHD2QNST10IIKFj8x2rPPaypaTR\nRcID\r\n=GJJ4\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIH3Kf7znh4KAu9SAmffAfpBerP9J/LpYvvRoQb2d0orhAiAoVcWFt5X97JsQlE3RFbv5NOTpWBCTS+KXpgE7wztLTQ=="}]},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.1.2-unstable.135_1639666805837_0.10673174513476824"},"_hasShrinkwrap":false},"0.1.2-unstable.136":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.1.2-unstable.136","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"^0.2.3","@sphereon/pe-js":"^0.5.1","@sphereon/ssi-sdk-core":"^0.1.2-unstable.136+a5aefde","@veramo/core":"^3.1.1-next.15","@veramo/utils":"^3.1.1-next.15","cross-fetch":"^3.1.4","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.3.3","@veramo/cli":"^3.1.1-next.15","@veramo/did-provider-key":"^3.1.1-next.15","@veramo/did-resolver":"^3.1.1-next.15","did-resolver":"3.1.3","nock":"^13.2.1","typescript":"^4.5.2"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"a5aefdee1043e17556d176b86894c6a8c7347546","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authentication request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst createAuthenticationResponse = await agent.getSiopAuthenticationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authentication request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationRequestDetailsResponse = await agent.getSiopAuthenticationRequestDetails({\n  sessionId,\n  verifiedAuthenticationRequest: createAuthenticationResponse,\n  verifiableCredentials: [credential],\n})\n```\n\n### Verify authentication request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthenticationResponse = await agent.verifySiopAuthenticationRequestURI({\n  sessionId,\n  requestURI: createAuthenticationResponse,\n})\n```\n\n### Send authentication response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationResponse = await agent.sendSiopAuthenticationResponse({\n  sessionId,\n  verifiedAuthenticationRequest: verifiedAuthenticationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.1.2-unstable.136","_nodeVersion":"14.18.2","_npmVersion":"lerna/4.0.0/node@v14.18.2+x64 (linux)","dist":{"integrity":"sha512-TJXNjtvqaRjMDB3t0AnmpV0bYha3F0SRQzdZz99As6+rTuqUoeHgDX3fLbN2mHGAr431VY2Um1/txUvNVzd6ZA==","shasum":"253cb3ffc8cfb674234edac51b6afa388cb82038","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.1.2-unstable.136.tgz","fileCount":24,"unpackedSize":94628,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhu1elCRA9TVsSAnZWagAA0z8P/iQrn9krhand4gytd+eB\nFsR47rK3N7/u4XqjG2RjlFHhbf1hSvxp+IlB68+xD4u9bDve+TLheHx9Mr6N\nyMihbaluM2sSsPcFJI8udVXhLLDJnoUMWSXF3Gx0nga+7RZMJKgTY3ZHU7/m\ntDyurdLkDD3IdXTqecHD/qjzQP4C/YVeNtSLmB/CztCIerN/V0LxgZALVN07\nlcgx04d/FBpIFE3ptAxskCqbui46WIfs52UJiRUZUEBgbGekMCMEx+ZQ+Ysa\n9dKhpONxmfnK3veoWECoIB07Pn2LKip4A0xTNt7r5L9RIAmLyS+bOIe07su1\ncepRy7gckMGLrgoE1CugFglL8smYi+N86L3KCxzGWE2DEh7CJZoMKg9HqPO0\ne8Yl8mXSDUrmrXEYU5mIcKr0rAfzRLihBGT/rbj+FE2JYFQ7frqY6sQPHsnY\nn9OOrLq6Hm7LcN3Y9dmYvvLtUbsHgfdt1hc654RmWAvWot/YHko0AKTcheLM\nyqRUxMU9LZ8ybAOEfMH/XzplcNUHw8zncwqnrJEeDR6r0CmGrtQ5nhvm1fts\noViGT/oglv6JY7XIbJxffQYUGYm1Jcf4P/2cPq9dCMwGwDvTaZD9MAw8Jkwe\n1cqs7K5c2FvAFGy1TAF7552It8037+IeDfrUaxAKnajPkZWdjupcZWGrDyGo\nXbvo\r\n=pOK8\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCID5sM1b1vDyhisP0u1xW4usj47HC2BUGLw+pmIEnQ9JKAiAR4whyHgDnDzRpVAcu00n/ide5jt0uKQd2tq7wWwUpLw=="}]},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.1.2-unstable.136_1639667621354_0.7914623843089308"},"_hasShrinkwrap":false},"0.1.2-unstable.139":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.1.2-unstable.139","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"^0.2.3","@sphereon/pe-js":"^0.5.1","@sphereon/ssi-sdk-core":"^0.1.2-unstable.139+d9a410a","@veramo/core":"^3.1.1-next.15","@veramo/utils":"^3.1.1-next.15","cross-fetch":"^3.1.4","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.3.3","@veramo/cli":"^3.1.1-next.15","@veramo/did-provider-key":"^3.1.1-next.15","@veramo/did-resolver":"^3.1.1-next.15","did-resolver":"3.1.3","nock":"^13.2.1","typescript":"^4.5.2"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"d9a410a2cfd576afc885c6882e448c6d9e15f137","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authentication request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst createAuthenticationResponse = await agent.getSiopAuthenticationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authentication request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationRequestDetailsResponse = await agent.getSiopAuthenticationRequestDetails({\n  sessionId,\n  verifiedAuthenticationRequest: createAuthenticationResponse,\n  verifiableCredentials: [credential],\n})\n```\n\n### Verify authentication request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthenticationResponse = await agent.verifySiopAuthenticationRequestURI({\n  sessionId,\n  requestURI: createAuthenticationResponse,\n})\n```\n\n### Send authentication response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationResponse = await agent.sendSiopAuthenticationResponse({\n  sessionId,\n  verifiedAuthenticationRequest: verifiedAuthenticationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.1.2-unstable.139","_nodeVersion":"14.18.2","_npmVersion":"lerna/4.0.0/node@v14.18.2+x64 (linux)","dist":{"integrity":"sha512-8py0y2lPtm9U5D+q9ggQnzBCz1fHC/9V69jybTe6aWCqaXyQaNjS3ojEKRtHf4x3sMS1x/pOzwUBhO9brMw/Ag==","shasum":"9fa12124f51af6833cf4ffbcf8af2d53b8b549f0","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.1.2-unstable.139.tgz","fileCount":24,"unpackedSize":94628,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhu1kpCRA9TVsSAnZWagAAFuMQAJfvH4p59K4Cehm9t8i7\nIsQbw+7nz00WcEXZZ7wRFAAfyA/KzaT9RtqOR8kZycWrA1gMtAQ9n/7wmjcE\ntsaGcoNQK0JbUpKClly1QzivVsiMbg7wri4GH5xQWiqDK7JqS2hnW0JdS9ie\niayDHrbuYinKHBlsAK4xih5wBeVgKXINjs1RM/hlEmmXRmevaMaBV5uIVqXe\nyinqvsv7M/Qn8o57KPlkEaiLuSicDigKLRkDnITwMC0FXrN7B6mqWMQvFOWz\nKEUJfZh9qrvz+2vu3uUqKvGFgrp91BT6xFD6GU2MOR/E+5lc+qr5G0iISnBY\nQmS6k3BXQbA8eVDwowQssNQ+UpXfT7qNu8zMS/tCywkpwu0oIDAJt4OT9pKW\nmMMfq8hXZgfSa5tU5Qkfo0tQyJV8o2TOFMtNxWJ2DV3mj4h1UnwCKb+KndoR\ndLTHz4p3Z6Emie/f8m/ivd0GOBzr6gKKxIUEZ5bd2iHhHVuQa2YySGHHcRSf\nPfcYVNMUZcP3SYZXLtxEt63/d98PrnWgotRo54oB6ernwNaLbB4Hhb1lZerv\nY7Is5OY89WgRZFQP5ndr8ArtGS5B6K/cXV0rUMQ/VwrNnGaRTcb81Z4OWO+9\nxR929f1JVQvFk3OdWu3Hk3iT6UkOeguXXIBz7n7JjQe5EY6HS2/57hLeoDve\nmwmv\r\n=Azff\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGW+I1D6wgr1sPAfIIawjLsOwgA4dklsM7VAb6t7D/KAAiEA7XtZI7BbYQiSlQo8VYKSIRAhST16R3YUxE+/m3VyBvA="}]},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.1.2-unstable.139_1639668009481_0.2738558062936858"},"_hasShrinkwrap":false},"0.1.2-unstable.141":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.1.2-unstable.141","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"^0.2.3","@sphereon/pe-js":"^0.5.1","@sphereon/ssi-sdk-core":"^0.1.2-unstable.141+5324fe7","@veramo/core":"^3.1.1-next.15","@veramo/utils":"^3.1.1-next.15","cross-fetch":"^3.1.4","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.3.3","@veramo/cli":"^3.1.1-next.15","@veramo/did-provider-key":"^3.1.1-next.15","@veramo/did-resolver":"^3.1.1-next.15","did-resolver":"3.1.3","nock":"^13.2.1","typescript":"^4.5.2"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"5324fe703aaa188c2df9c0d318e197bf7bd8936b","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authentication request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst createAuthenticationResponse = await agent.getSiopAuthenticationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authentication request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationRequestDetailsResponse = await agent.getSiopAuthenticationRequestDetails({\n  sessionId,\n  verifiedAuthenticationRequest: createAuthenticationResponse,\n  verifiableCredentials: [credential],\n})\n```\n\n### Verify authentication request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthenticationResponse = await agent.verifySiopAuthenticationRequestURI({\n  sessionId,\n  requestURI: createAuthenticationResponse,\n})\n```\n\n### Send authentication response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationResponse = await agent.sendSiopAuthenticationResponse({\n  sessionId,\n  verifiedAuthenticationRequest: verifiedAuthenticationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.1.2-unstable.141","_nodeVersion":"14.18.2","_npmVersion":"lerna/4.0.0/node@v14.18.2+x64 (linux)","dist":{"integrity":"sha512-I8kO5VaJCaQPvsNzbHwzCjI3rVrowW3EFT2R7G2CLRz53VIYKCDCwekdo2aa2vGkjzn7IY5FNV5jJlnpYFst0A==","shasum":"7bd82fd35d5ec1a784922772dc79ef30b27cd405","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.1.2-unstable.141.tgz","fileCount":24,"unpackedSize":94628,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhu1yCCRA9TVsSAnZWagAAPe8P/1nDPDN4CcFG0uAsN+zY\nMP2DE6xAO/E4euvp3ryZSJhfLmHEVIhPKqs+ZW/ZVjxKGMzqH5Dsab8ozFEv\nd+DZXTD7xlbeYelqkfgvjaxYdhiMMRslc66JfWDcKHvEQzphz9/C4MOiV8zC\ncPVpxz+XmhbRJLmXoZYPioOb6hVV6QtsvZo0pDtqLchkuEYSYK1+gz7KNZwh\nwSbjcVSeabVly/XqzWH2W/xW8Ng0s11q51tS7N+wmHOPZdA2fGZG98GadCPk\nyVzWmZTX2Ya2Q6nUrJgAkbXF4rt7SErEFQCilaRlp5GXa4qAicH2UJQ2FCjT\n81oG+68OFT+6OZY/264cVQGoxMWI9vznkps7QLg/Di45UX+U0cErXI/TkYm5\n6Z+lN4DSXKTyivKvgvt9Tr3/0etsKvd4sXBxdownL5vpU+Xu9RceOuhGzqqS\nD9xWsC8IYryKeX7WFKxaLJ0tJgV7vYDcjeiadPa2LnP3RxhC+88Us5OMbE2J\nfstvNKSz1BogidBLJI6D0UNgHj6s9KuXuEUMJ4peJZ52RgRkG6YcVfACRmLI\nQYmNZAZO5c2uEeVyOKbeTC1jGhfH7/tKxi5XiH+aff2uT8d4iq7ENl4IP6XK\nl55C6u+5i0PwI9tkgwaTpAygT9CJhxgu+NrdtIIHcm/puiCwP4TsXJjotNXY\n2p32\r\n=IWP+\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCwe66KXl5lmcUn6B3G4QfvxS26Mm46OnQmKSYNeuWbUQIhANDA4imlfs7KVB2TfCOrQ37g6qls5/zHSgkuvoSI9CqU"}]},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.1.2-unstable.141_1639668866703_0.9518199061871484"},"_hasShrinkwrap":false},"0.1.2-next.142":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.1.2-next.142","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"^0.2.3","@sphereon/pe-js":"^0.5.1","@sphereon/ssi-sdk-core":"^0.1.2-next.142+cb95029","@veramo/core":"^3.1.1-next.15","@veramo/utils":"^3.1.1-next.15","cross-fetch":"^3.1.4","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.3.3","@veramo/cli":"^3.1.1-next.15","@veramo/did-provider-key":"^3.1.1-next.15","@veramo/did-resolver":"^3.1.1-next.15","did-resolver":"3.1.3","nock":"^13.2.1","typescript":"^4.5.2"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"cb950294843834372da480bbf6da7b5a22dad9ec","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authentication request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst createAuthenticationResponse = await agent.getSiopAuthenticationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authentication request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationRequestDetailsResponse = await agent.getSiopAuthenticationRequestDetails({\n  sessionId,\n  verifiedAuthenticationRequest: createAuthenticationResponse,\n  verifiableCredentials: [credential],\n})\n```\n\n### Verify authentication request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthenticationResponse = await agent.verifySiopAuthenticationRequestURI({\n  sessionId,\n  requestURI: createAuthenticationResponse,\n})\n```\n\n### Send authentication response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationResponse = await agent.sendSiopAuthenticationResponse({\n  sessionId,\n  verifiedAuthenticationRequest: verifiedAuthenticationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.1.2-next.142","_nodeVersion":"14.18.2","_npmVersion":"lerna/4.0.0/node@v14.18.2+x64 (linux)","dist":{"integrity":"sha512-eNvQ5udhXnsICFde6e+VDFKPLsP7HV6k0gyfiA8FSTPsf+eZa7DZyEoB8Z+dNGd9QcMp58DDBVJNZnZ40ToaDw==","shasum":"d8b27353acef546fcd5e010421bed4334fb3fcfa","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.1.2-next.142.tgz","fileCount":24,"unpackedSize":94620,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhu2hXCRA9TVsSAnZWagAA7GAQAJm7ph9rvWfdP9AwjlAy\nlb4ZYbb9yB1WUG/1JjyuSUTlAcTwau9vOMYku7/JVWsodew4NA36075fdESs\nGjf5/MP/UnMLO1RghG+l6L3DVMb8hbpvhd841fe/kEbQuycYiGn4xcHjLRxp\n38mLMHq1ijkGzQu5xekZLwUXe/QrP9dGQm0597B1UMCKLpyqDIAQBh2tljnn\nhjAtbkBkaAhUdYXkhw49qczvEtyL8nd/Y2lwDe/EPtutUu/+q4Sk1J5FDweL\n590h2szSdh6ji3PnWz80AorqM7MAMExc1hw7ub0lfUeOZK1sp2Hseq7XFP+i\nhDNdSYHLDvpH2REQmEk1rXJMT1RlsTOZCADzGvlN0yF6dgvXEd7DKRY4Tcpa\nnBIAlSjdIpcAHr3HP4ZobgUAu29Fb1P20Mro4JCJW8/iklZ9iw6dCcd7t7R9\nDNvgZnYZ3G46PaX8Wityjr6lRSqLzRICZ15uSr1VPER3ntxW/iIFXUlsK05Q\nwzzfYJdiJ973nXHtxUB/TGVDmMF0hOr0AGRJtb4/qiRWpYvyvszwb3Aoa+Mw\nmuor1SCERRRmedgDxffzFVky3tjWJcc3+XyrakC9OfRACkFhh+71BBWGndse\nkVFGoCopBaINT9gSGWHDiOsKFDeU6gvLNHXMr2R634tR3pQ/Rkarg/4NGMRD\nDXxb\r\n=IhKJ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDTfxZJWM+hJ9W+0phqk3gf3ScO+xjcCAm2twovb1XcvwIgcu0I5NKYMnuAkelbvMPJG/sSTztZVQsHoSiluIbvruA="}]},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.1.2-next.142_1639671895072_0.8413650845458831"},"_hasShrinkwrap":false},"0.1.2-next.143":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.1.2-next.143","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"^0.2.3","@sphereon/pe-js":"^0.5.1","@sphereon/ssi-sdk-core":"^0.1.2-next.143+eebe68f","@veramo/core":"^3.1.1-next.15","@veramo/utils":"^3.1.1-next.15","cross-fetch":"^3.1.4","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.3.3","@veramo/cli":"^3.1.1-next.15","@veramo/did-provider-key":"^3.1.1-next.15","@veramo/did-resolver":"^3.1.1-next.15","did-resolver":"3.1.3","nock":"^13.2.1","typescript":"^4.5.2"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"eebe68f346a300db46c6fbd2733814235071abf0","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authentication request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst createAuthenticationResponse = await agent.getSiopAuthenticationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authentication request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationRequestDetailsResponse = await agent.getSiopAuthenticationRequestDetails({\n  sessionId,\n  verifiedAuthenticationRequest: createAuthenticationResponse,\n  verifiableCredentials: [credential],\n})\n```\n\n### Verify authentication request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthenticationResponse = await agent.verifySiopAuthenticationRequestURI({\n  sessionId,\n  requestURI: createAuthenticationResponse,\n})\n```\n\n### Send authentication response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationResponse = await agent.sendSiopAuthenticationResponse({\n  sessionId,\n  verifiedAuthenticationRequest: verifiedAuthenticationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.1.2-next.143","_nodeVersion":"14.18.2","_npmVersion":"lerna/4.0.0/node@v14.18.2+x64 (linux)","dist":{"integrity":"sha512-vz0AaYbqYOnMvHgvptPXFZ4v8Be31C/CPsVuCZS3QmXasSDjcjtiANau+iwc+kGaYHWiHQB/3dZz2Gm5shRpGg==","shasum":"1374d8e3a06d4a87bb0e55e892328b2d4aed3d78","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.1.2-next.143.tgz","fileCount":24,"unpackedSize":94620,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhu26uCRA9TVsSAnZWagAAgb4P/A+gZ8TcSBbA886sgPe+\nvp02I53z/Qa8haBWCBhx8yKw3NxnkxMpuCHZgqI1RvHyFVRVjgrkE6IMNYkr\ng1xw8udhmiMffIrhUWYQauGYsWYwaJvKGP/MyWceDG563YYezyrPUXCMFD0N\nfxp8PafG1SPgDzCp7yF8wNBxICyBu1qm4uMp90JY9KOZyr0Swe4wtUqVCElo\niEsFE9cd+ce1Y/QTRVriSO3RkpAiN6Mq3+QGDsmEL7vUjCXnH3SEAyxkjqFJ\nWZlUQvSId7toRzBcgyb+YuP4HQbyV749hDGXEW5fvylQFqyjjE0SAuJRPxv4\nYdc1CvdtaUMG8VNjX20bfcBd0LH9GPuW29QDJHUWvs+RY+wUB/IiTZUcchmK\nCBbORRjzFlpMY9QtQ+KUAMBbQrFgRNZpFf7gaDiXhQk5YBCJsmiytgJxCqxH\nXLCPgeoYeleuzl0vl1i49WPLkx4tGIzYgTlhQ6LhVN8PCVT3iGVnZqqBm2KV\nKJzn/MUeRfPqZypF0ST6cyAOcMEvZjwlS/UAw0A73xLTAVIv7D61l2WPbDMH\nSBTGqM00OGIS8jU6FNIWCEjaa6/aZebRl7BoABlXDlovh7Ldc+kMCDjMOO9Y\nWQIrteMRbLCQXYz7RWrJdvFkpkYwlwMxyzof4EeOkcujpstU2nWf1qfqxK9T\n/Maz\r\n=ZTdj\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDCQJYoyM/eJiEgPBD5tHzqTWDvuY/NREH7VBWUh1BZewIhAKBhLkfA7qTgynrl0XyJ+9Qgp1+NT1x4p3HTCX+juwia"}]},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.1.2-next.143_1639673518065_0.6298654392262069"},"_hasShrinkwrap":false},"0.1.1-next.105":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.1.1-next.105","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"^0.2.3","@sphereon/pe-js":"^0.5.1","@sphereon/ssi-sdk-core":"^0.1.1-next.105+1d91d51","@veramo/core":"^3.1.1-next.15","@veramo/utils":"^3.1.1-next.15","cross-fetch":"^3.1.4","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.3.3","@veramo/cli":"^3.1.1-next.15","@veramo/did-provider-key":"^3.1.1-next.15","@veramo/did-resolver":"^3.1.1-next.15","did-resolver":"3.1.3","nock":"^13.2.1","typescript":"^4.5.2"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"1d91d51b59ce9f804770cd3338e4a686a3ca6538","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authentication request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst createAuthenticationResponse = await agent.getSiopAuthenticationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authentication request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationRequestDetailsResponse = await agent.getSiopAuthenticationRequestDetails({\n  sessionId,\n  verifiedAuthenticationRequest: createAuthenticationResponse,\n  verifiableCredentials: [credential],\n})\n```\n\n### Verify authentication request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthenticationResponse = await agent.verifySiopAuthenticationRequestURI({\n  sessionId,\n  requestURI: createAuthenticationResponse,\n})\n```\n\n### Send authentication response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationResponse = await agent.sendSiopAuthenticationResponse({\n  sessionId,\n  verifiedAuthenticationRequest: verifiedAuthenticationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.1.1-next.105","_nodeVersion":"14.18.2","_npmVersion":"lerna/4.0.0/node@v14.18.2+x64 (linux)","dist":{"integrity":"sha512-j7O7o1lB8mKt9u4XRIezn6Dlsp8PXqwI0T2yJGRaQSXxppXvgwuKFD2V83NlAzYFAeV5BEsYjAZnaS4BuozwsQ==","shasum":"faead9eaba44216a585289cb3917097d95776c80","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.1.1-next.105.tgz","fileCount":24,"unpackedSize":94620,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhu3ENCRA9TVsSAnZWagAAVVMP/3QmBzpya6tc1t1lOAhx\nAXq4L3GPWkb9rDaVp6r8dM4iKccH/B9TSxz83jr+dtWoQ635TQZG548Rdw+Y\nMaxqYuaPjgjvBALmo3Znl9nifUlj8FhxzlYpZMwWOfmxY/rZgH6c3vHOQjEx\nHYhOzZudZKUALB5sYG+Az8MM7Wpcp3ap6Leyw5BP9Y5sE8tD5TFPcggcQyzo\nS/YF5dwJgtr+M2Ot4uM1aNCzOAjUSwvFD29hBSHWv+Z7MjdcCzVKrKodKUNm\nWwFIEqdOmmUboEw3iGsskVlgHBZjMrUknMyuARFMkW+SYuCz1gWBK8xTN0ks\n5CP6imVT949DTt3npylnjph0ulJpKakglQRfpH1NqyzrgGDVt1sqM2R86VqM\nHdf612mQM+RanOjIMZ2BKVMsRM3gEMNIc+RH8ujTlnGktWp9oHlaBS4c+vhl\nD4o13ySmZSBnQM+CmDD075okYSqHIEPZjN9bOFZoKQte1T1+0dVh+w12inL4\nk9ty9boN2ELEmS+FXJASQRJERvldM6LUM9K99j8U1CIPbrlLOUZGmhGvdi/a\nttWQFrtZJpQWckcfIDNEKX+q0Mmwh1n/XqAK/dYKdHtUL7OEHskQIPPZVtEd\nVOZM9a3jYtmzjcrs5NWUE7faOM5YVHwbgZ8TV6qMhvvYipapSrExqqWB70mr\nPbBC\r\n=0Wsp\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAztny5gSFTQnvL4mGW37xcRyanusLJIDvALU8ohMov+AiEA1rP5vljtIzbR6k9OUEKjKuMYGDwRmGzf13jEo5f9A2M="}]},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.1.1-next.105_1639674125819_0.0636439486416096"},"_hasShrinkwrap":false},"0.2.0":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.2.0","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"^0.2.3","@sphereon/pe-js":"^0.5.1","@sphereon/ssi-sdk-core":"^0.2.0","@veramo/core":"^3.1.1-next.15","@veramo/utils":"^3.1.1-next.15","cross-fetch":"^3.1.4","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.3.3","@veramo/cli":"^3.1.1-next.15","@veramo/did-provider-key":"^3.1.1-next.15","@veramo/did-resolver":"^3.1.1-next.15","did-resolver":"3.1.3","nock":"^13.2.1","typescript":"^4.5.2"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"b6472505d7be84db6964d37c1d3ada44862c40b0","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.2.0","_nodeVersion":"14.18.2","_npmVersion":"lerna/4.0.0/node@v14.18.2+x64 (linux)","dist":{"integrity":"sha512-8dl3E0fGD8y6djj1kSUwZCs7mtD+1Xd4wHutOSGsrZbaer2Zz+E5Njavm6sM/G1rdRVhiPcwVxsKohzS+QRgwQ==","shasum":"ca8a52b35d3b0122dfcc402a605ac30bfdc85f61","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.2.0.tgz","fileCount":24,"unpackedSize":94586,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhu3JnCRA9TVsSAnZWagAA3LkQAJgPoRZ244+8FoSqPy5F\nV0f9iVktwGLrHQO7tcr4SpbJAkr9yeTFigFdIwm4spmt9HRvuK3kI5kDh3PJ\n5jA6KR/ODBI8yuVFMST+9XqmKST8alpY/w9E3lsjVqkCXtlniT4+YgfoIeJ6\nQZwg9Lc5HQ2AJCTbRsBBlCX2mGQ6QUiHY+uBWcOYs5mZEqQwcmK7VYiNexpS\nQwJBBPh1J7RhdapvEKJ1U0ynvN4JFTNJmF+t20boSkT8eQr83YkEUcClr71A\n7q3cppebjdj3o/mmoUa545PvfxzrQly3FJax1w70ypDkUtZy+isdQxkggTPI\ny42jmSUFI06haJSERxcxT4ig08bzZxrfQaI8YMOdBsqSwcmQ5VzDdSb6gzL6\nsgFBq1L/vNQhi+WxZTwkVkZ2JEZXLuYqmSeVHNP0pEdGvQx2v06evfNq1OUj\n7F5ivSvoxx5HBEyCR8moWmyMnKYcE5b09fGSv76mxfDhjoQWMNT0utUx4RNP\nX91IOrXVnbSAsvm7WcneUz39uVGbHtHielFRMRZEA6ewJryJMikL0o4cLQmq\nZLgrWaEXuodfZjRaeqeJjzEgGT2RHFjzZCUK8LpXJTrAhJiP2TbD0MsGlxyC\nqfmBKQK4JvP+Jd8foDpezOB9PbXrtwV8ynElZm46zzBKYmFYEymv2pS6q6ZB\nwvu0\r\n=tjRG\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBSeaf84xvGcddxbWczzeNCRd1b8V27hfAkG2vTZMVZaAiEAxBZCPd1EQDqBCzkNnwufaLxwUX5SgFUxH0HeJuE2uYE="}]},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.2.0_1639674471291_0.797857470003625"},"_hasShrinkwrap":false},"0.2.1-unstable.1":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.2.1-unstable.1","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"^0.2.3","@sphereon/pe-js":"^0.5.1","@sphereon/ssi-sdk-core":"^0.2.1-unstable.1+7347914","@veramo/core":"^3.1.1-next.15","@veramo/utils":"^3.1.1-next.15","cross-fetch":"^3.1.4","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.3.3","@veramo/cli":"^3.1.1-next.15","@veramo/did-provider-key":"^3.1.1-next.15","@veramo/did-resolver":"^3.1.1-next.15","did-resolver":"3.1.3","nock":"^13.2.1","typescript":"^4.5.2"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"73479148d6b02c194182370c14a15613dca6fcf2","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authentication request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst createAuthenticationResponse = await agent.getSiopAuthenticationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authentication request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationRequestDetailsResponse = await agent.getSiopAuthenticationRequestDetails({\n  sessionId,\n  verifiedAuthenticationRequest: createAuthenticationResponse,\n  verifiableCredentials: [credential],\n})\n```\n\n### Verify authentication request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthenticationResponse = await agent.verifySiopAuthenticationRequestURI({\n  sessionId,\n  requestURI: createAuthenticationResponse,\n})\n```\n\n### Send authentication response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationResponse = await agent.sendSiopAuthenticationResponse({\n  sessionId,\n  verifiedAuthenticationRequest: verifiedAuthenticationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.2.1-unstable.1","_nodeVersion":"14.18.2","_npmVersion":"lerna/4.0.0/node@v14.18.2+x64 (linux)","dist":{"integrity":"sha512-FZ00iPeC6g/w0UuwdiTuOqjQ24p1rsPsTuSV0zZ28QOf2LzCYmVe++a75f93lQGahR8TdgNEEeLwNXk8qXLiQw==","shasum":"2a58113a693d12433a09da62305649755a90de15","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.2.1-unstable.1.tgz","fileCount":24,"unpackedSize":94624,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhu9p3CRA9TVsSAnZWagAA7d0QAIXWIz8crUfoGdyejdUj\nkRtlH2csGVAZNciKJ3C4WvFMThIBBZx+d/dYySwbRDCE3zOutm/86aXDWl6/\nVXVrMseuZuiO6KvadRqg8BIrMvW/MytfjfOmflRJvd3m8W88os3Kw6o9X3+4\nEy9UdFO6qC5uzEJpoPZ52/DN7qs8+qvZRHV8FypkmBEUuRpvgFIkMUnj/raH\nHUe627M8Y8SHTZiYvCOm7wuxa3A54csVkJxupi79se02fIhjHxffCgRh8DMG\nbkEIo61aiH41aPizRdhR0/IhVq0BD132j6VW2a0qMlXuJ7oo6EvQR6KXa0h9\nPyfXyGNc6SEgKBybKyK1ZEB4EuTDA9tmiAaoPziar1APyPTE+bfjqm2sqOsN\nEgEFqk2yKYsqE3K2F6KelG3jZPNdEgBhd4IU1qBqIrUvkYFQ8/vSwyvaIRQ/\nHKddc0iNQnoIr5HJvcOToqqv4fEOVd5h2rPki68W0z17Jd1I7r50tAkroMnU\n1WWoafkVWodF6gYqjQTeLwMVvzV7ONRPfdWACttvh69dgabtdMa+/+FFo2Bc\nOGmAAzlrYBt4RzU2p+XKmR0BbsYSkbXhVbb8XfNa7+1oKdTEYWoh2gXz/wtI\nvNGlR7gRdU64uYRqN7mxhPbtFAsvQjmyOEx9lIK7LOzZPMFekhjH1gFCbf2q\n96VP\r\n=AHp5\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHfFby79kifDM4u8xOcbU75xGEGVkM3qbwEL24YIE3gTAiB8AGHrAUderiTYZJnzRS1qqUQsvbShWEnfPEZXHPXklA=="}]},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.2.1-unstable.1_1639701111331_0.6400593488403115"},"_hasShrinkwrap":false},"0.2.1-unstable.2":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.2.1-unstable.2","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"^0.2.3","@sphereon/pe-js":"^0.5.1","@sphereon/ssi-sdk-core":"^0.2.1-unstable.2+c0df2ce","@veramo/core":"^3.1.1-next.15","@veramo/utils":"^3.1.1-next.15","cross-fetch":"^3.1.4","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.3.3","@veramo/cli":"^3.1.1-next.15","@veramo/did-provider-key":"^3.1.1-next.15","@veramo/did-resolver":"^3.1.1-next.15","did-resolver":"3.1.3","nock":"^13.2.1","typescript":"^4.5.2"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"c0df2ce8bc67f2e407ef21b65aae6d364c47a6b9","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authentication request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst createAuthenticationResponse = await agent.getSiopAuthenticationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authentication request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationRequestDetailsResponse = await agent.getSiopAuthenticationRequestDetails({\n  sessionId,\n  verifiedAuthenticationRequest: createAuthenticationResponse,\n  verifiableCredentials: [credential],\n})\n```\n\n### Verify authentication request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthenticationResponse = await agent.verifySiopAuthenticationRequestURI({\n  sessionId,\n  requestURI: createAuthenticationResponse,\n})\n```\n\n### Send authentication response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationResponse = await agent.sendSiopAuthenticationResponse({\n  sessionId,\n  verifiedAuthenticationRequest: verifiedAuthenticationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.2.1-unstable.2","_nodeVersion":"14.18.2","_npmVersion":"lerna/4.0.0/node@v14.18.2+x64 (linux)","dist":{"integrity":"sha512-Pt7vj3V9W71uoeSCTEg8gVd87WhTs9HPfOHRrsu1PC4R1UiaO0TxOeSYstI6h81XhFp0Ur5yIsNLAU3F61Qv6w==","shasum":"a033c21afdaf829c841f37939fabdfac53a55ae0","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.2.1-unstable.2.tgz","fileCount":24,"unpackedSize":94624,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhu+Q7CRA9TVsSAnZWagAATxcP/250FzB96Z+Mtepobtrx\n6U9CWIZSKmBIHXnQO2fTYM89YBRwcJuaN0twPAoLOTvh7XBYVFtzs1+XO/LE\nOP3DHOPNSpOM+ZmCPzj9uSq+43oR5gBYO2gYABPDpos+t1juPBDMSCxj2Gaw\nVKZK2hgAsBey1giIQXF7VKqXzjlL7oncwVGEOm672YuAgZfijM/nAl7dHYvR\nU9SxsMChg0qdHtYO+A6MOOwS3uWQDH33nSGFk4diL+xUQtWKR6yFeY8n3VoG\nFh/e2fOeTPmnP/lss820aCFYwkp3ynbPgSOZVNvOjWyyhuBJLOhSb8Ro7da3\njfc/mj8Q104OkjrLtcqsYIY1fXh3TZmR0qJrusyi7YWsKbStuu37w3ph61Md\n0ONgxyeRhPc+B+M5ORIYBwogF5FY39pfNFRFtr8oQRDlwqj7INjUVcDdQfoZ\nFIRCr7c13Hnw9Z3quBaIi5NC0GQa1SSvGAhO+2z1txpPTCdWY2C5aS+L7nxL\neJM+5p5Jvsw+1h1xbOFC0MudCE0WZpH4zZdpazyyfyLuPkwQ3JsEePzxnMxq\nAM9rVPfohMOklkUJjEcCZCFA//ZoMY6PLuIRLm1/mx/agSMGv59Fc6hD/MRL\ndoFnrR0WHl4R/XDApn4xZvEAD1HGjIOPQj1fb4okHooX4zFvnN9FJaWbC1Ud\n76YJ\r\n=gO6U\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAQVn6XFfXJWlw0ynNz68LQdB7iXnnGw/fLPSu1WLjR5AiBuPRrzEjMfs6jIyc/fkkK34gr74IH7ioDs6Zax6CfeKA=="}]},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.2.1-unstable.2_1639703611844_0.29199234764119053"},"_hasShrinkwrap":false},"0.2.1-unstable.3":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.2.1-unstable.3","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"^0.2.3","@sphereon/pe-js":"^0.5.1","@sphereon/ssi-sdk-core":"^0.2.1-unstable.3+6364ccb","@veramo/core":"^3.1.1-next.15","@veramo/utils":"^3.1.1-next.15","cross-fetch":"^3.1.4","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.3.3","@veramo/cli":"^3.1.1-next.15","@veramo/did-provider-key":"^3.1.1-next.15","@veramo/did-resolver":"^3.1.1-next.15","did-resolver":"3.1.3","nock":"^13.2.1","typescript":"^4.5.2"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"6364ccbe74ec4c96841d4fc7436da81d89cf014e","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authentication request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst createAuthenticationResponse = await agent.getSiopAuthenticationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authentication request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationRequestDetailsResponse = await agent.getSiopAuthenticationRequestDetails({\n  sessionId,\n  verifiedAuthenticationRequest: createAuthenticationResponse,\n  verifiableCredentials: [credential],\n})\n```\n\n### Verify authentication request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthenticationResponse = await agent.verifySiopAuthenticationRequestURI({\n  sessionId,\n  requestURI: createAuthenticationResponse,\n})\n```\n\n### Send authentication response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationResponse = await agent.sendSiopAuthenticationResponse({\n  sessionId,\n  verifiedAuthenticationRequest: verifiedAuthenticationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.2.1-unstable.3","_nodeVersion":"14.18.2","_npmVersion":"lerna/4.0.0/node@v14.18.2+x64 (linux)","dist":{"integrity":"sha512-UtmtkDHdyR04yuUxxA4rtabxYMZGJ7Kmy77qNmSMvc/ki0u+4PDPJ+WE+6A4FR70wTiuUQefdv6bY5qwFOUuGw==","shasum":"df6d5684065b402b85f3f04e23e047a2e366f584","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.2.1-unstable.3.tgz","fileCount":24,"unpackedSize":94624,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhu+mXCRA9TVsSAnZWagAANx8P/3H0saCyNKdpeTonDPwM\n85nBx0oXrXqOOrwm/L6dSDswquDhMbeuCrgv94DivGO1VpOGWdgWwGqd4OXa\nEjctQENTCODd3Rf8JvU5iNhdK/S4Wb0ra0QrXnNLg793fJQ+a/tjqiSu+vrT\nRk33h9UNiHwW44PWNNnu50jN6S8VcJgKtkW452ocn8YdICH8JckMCLjuzTdR\nk0I0u0H3HTmEQe5miLZWD5+JIcdk12FHhWmNbQzihtshL9cdS5heDNnSLwom\nxIfd//+Cy1K6omEkas5ids0P6L9ZO4l6RPho+cLvYJJK+lNOhRlzUBjq7kf4\na+dVaNkZ0RvQPzIS1LCTklXMUv8FzaCp7eXOvvOHVSjaEaW8AfJThO/tIvbM\nVNL1s9TASg/1IjEq9XzFRxbx1usE1zwfq53XxpSkucSYoYGJV7t1xZD7PwpQ\nPkjFMhbMSuLdPLIIZrB3vxaQF8WYCk4d3Wpt+VkbxTxEspSiyTMRhl02ERou\n0C4ewT08Pj+6AQDQK9yMQxUBqKLyVwT2boeqrzsIB0C6lkYhVT3umlSOf9O9\ngYyZKf+5ETg0TnV5ZoT07v3c1BrwbbIK+860cDs8AohlzycuGhkUHMhV/fN3\nycZRpPQ2aA7rOK7mkyoUE1wySjVUtTtwIKxbDT7whXtnqNLmzYPwgB0vhYxb\nl/Ow\r\n=8BzH\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICNOBKd/F51y4YH/If99tz15cqbpHJGzy4W7c1KdyftjAiEAp+Z3CiZMqmKyzB79pGVUVTxHW0zUFxkTZKl9WY3JI20="}]},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.2.1-unstable.3_1639704983483_0.8188390297326267"},"_hasShrinkwrap":false},"0.0.2-unstable.85":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.0.2-unstable.85","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"^0.2.3","@sphereon/pe-js":"^0.5.1","@sphereon/ssi-sdk-core":"^0.0.2-unstable.85+0df0596","@veramo/core":"^3.1.1-next.15","@veramo/utils":"^3.1.1-next.15","cross-fetch":"^3.1.4","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.3.3","@veramo/cli":"^3.1.1-next.15","@veramo/did-provider-key":"^3.1.1-next.15","@veramo/did-resolver":"^3.1.1-next.15","did-resolver":"3.1.3","nock":"^13.2.1","typescript":"^4.5.2"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"0df0596eb756ceca212c4ff97f43d490f29a0d2d","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand  [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n* getSessionForSiop\n* registerSessionForSiop\n* removeSessionForSiop\n* registerCustomApprovalForSiop\n* removeCustomApprovalForSiop\n* authenticateWithSiop\n* getSiopAuthenticationRequestFromRP\n* getSiopAuthenticationRequestDetails\n* verifySiopAuthenticationRequestURI\n* sendSiopAuthenticationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n* authenticateWithSiop\n* getSiopAuthenticationRequestFromRP\n* getSiopAuthenticationRequestDetails\n* verifySiopAuthenticationRequestURI\n* sendSiopAuthenticationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n});\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [{\n    kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n    kms: 'example_kms',\n    type: 'Ed25519' as const,\n    publicKeyHex: '1e21e21e...',\n    privateKeyHex: 'elfcvtswdbn...'\n  }],\n  services: []\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => Promise.resolve()\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authentication request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request) \n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst createAuthenticationResponse = await agent.getSiopAuthenticationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authentication request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationRequestDetailsResponse = await agent.getSiopAuthenticationRequestDetails({\n  sessionId,\n  verifiedAuthenticationRequest: createAuthenticationResponse,\n  verifiableCredentials: [credential],\n})\n```\n\n### Verify authentication request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthenticationResponse = await agent.verifySiopAuthenticationRequestURI({\n  sessionId,\n  requestURI: createAuthenticationResponse,\n})\n```\n\n### Send authentication response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationResponse = await agent.sendSiopAuthenticationResponse({\n  sessionId,\n  verifiedAuthenticationRequest: verifiedAuthenticationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.0.2-unstable.85","_nodeVersion":"14.18.2","_npmVersion":"lerna/4.0.0/node@v14.18.2+x64 (linux)","dist":{"integrity":"sha512-f97dKCW6YIhBmgzM+xvUMaLQVbG7M7EuS2a6LXap4niwGRmf311mcD2aVUru51sbiPSNz/1AJOcm/GxHiS64gA==","shasum":"0cc951308cfade087f738e1d290953a8beaa861c","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.0.2-unstable.85.tgz","fileCount":24,"unpackedSize":94979,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhvLQVCRA9TVsSAnZWagAACUAP/j5XRVhTMIRxwIWaOqLV\nt/3FVYKIZV1HB48ZDXzWWznkZ/BWpS0SIzKp2/qa6hFMSGTNtlesWNNcCq7o\nu3l2qVTbITwPCB4ZXJDelmrGUHIKDa2khSFptsa9qINuZ2l4YTR6SddoZXCw\nDLA4ESJrRY+o8Qt89rHYCUbPo7vs+9xHlgPwuZiQXrEMjKr32SZDw+NZ1MbS\nt0OkNcv0gubGCOH9B5BWij8VUuvn+bK8wGUZBouHLs/RsxY5FMBS90O/zaLZ\n7FYrMap2cdVhmrLPVmevkwkmAH7u3sGx/VHkAQ0A0V0ea2SZlTRXL0F+gypz\n7RhbbXSXYZ5wCUqskuy3fcmyitgoK4ONn0vCrergznZU5Eif/XHNL8XWBJX8\nKVjbiOKOHxwvlZV2rSAhG/cjCseeq6ULw7+faFtU2Y4hPEKpr/3mPT4ywGTb\nzhTaP7hB9gWk9VYp/06nU22/x+QS8+rQDZI+JEWY255pGHk8NQL5hX/dL2/m\nMUuicMWeQw3RprUenKutS7y/UkDrONdYUrJwBYxOCoFFlIoWvwEb+MSlzUhC\nMBDUaaFrTxiQzhvisWAQOmEvrAj3pOELy4Mr1cbBVnG8lRaW5CHwhjW57VAd\nin8m6Wl/WnoZ/1yHDFXgwNVlinWtDG/26K/T3y+W7u9pYG87kniPEQ/V6pNH\nHJfv\r\n=FXvd\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICKWNL5BOxtXMql31fuj7Vdu5IgB9XUH5+qE1SFLWVvNAiB01uNZzJm6eT/qPGsPPDVJyosvHUdxd9oOP+BVf8tFaA=="}]},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.0.2-unstable.85_1639756821507_0.6627669081900052"},"_hasShrinkwrap":false},"0.2.1-unstable.9":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.2.1-unstable.9","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"^0.2.3","@sphereon/pe-js":"^0.5.1","@sphereon/ssi-sdk-core":"^0.2.1-unstable.9+8d5440e","@veramo/core":"^3.1.1-next.15","@veramo/utils":"^3.1.1-next.15","cross-fetch":"^3.1.4","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.3.3","@veramo/cli":"^3.1.1-next.15","@veramo/did-provider-key":"^3.1.1-next.15","@veramo/did-resolver":"^3.1.1-next.15","did-resolver":"3.1.3","nock":"^13.2.1","typescript":"^4.5.2"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"8d5440e80b9c770c3bb5c02f9747f114eaf8cb4f","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authentication request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst createAuthenticationResponse = await agent.getSiopAuthenticationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authentication request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationRequestDetailsResponse = await agent.getSiopAuthenticationRequestDetails({\n  sessionId,\n  verifiedAuthenticationRequest: createAuthenticationResponse,\n  verifiableCredentials: [credential],\n})\n```\n\n### Verify authentication request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthenticationResponse = await agent.verifySiopAuthenticationRequestURI({\n  sessionId,\n  requestURI: createAuthenticationResponse,\n})\n```\n\n### Send authentication response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationResponse = await agent.sendSiopAuthenticationResponse({\n  sessionId,\n  verifiedAuthenticationRequest: verifiedAuthenticationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.2.1-unstable.9","_nodeVersion":"14.18.2","_npmVersion":"lerna/4.0.0/node@v14.18.2+x64 (linux)","dist":{"integrity":"sha512-7j6c5kJUMRBr6eg5jLkhT8dg7Gr51wySrIoZ8gp0+pxUyL/zTQCBtRs1WhN2IGtLHBqRTiyrnvyc0i+FzxLg3w==","shasum":"6681449c4cb4b5759d157075efdfe4fce559a0ba","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.2.1-unstable.9.tgz","fileCount":24,"unpackedSize":94624,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhxawOCRA9TVsSAnZWagAAV5kP/jBO0b2vX4i9HxFMftcx\nZplvreIpt+aoko48fgj/E8CChLKqeg2r76lFCg7LggGn1BK4T2YK1oalrxx9\nwxDFXl0hUDiFwHnen2US9AKVNZin8fMCgoUXKWN+6KD6cEeIkCCC4qTZF3b2\nr2iKoE7OGRID6x/Q5at6fPVfXArcDDIiQtbxGRQdgcdP6x3fRDnupU5tBzWw\nSjeEnI5i77g21SYWJ72jCyQOxMRYcqqvEfRYAzuLIyX5t/+x4N4Vvi62CFwi\nFBuqebjNcOWtwgz4fm/DUDyoIK/V7n9u/m3t7aUvO5TfrpJijgVaQaWntZVq\n72bMbv/laVRgtmUzu42glgqSL3z+GqaViw0AQ51vow9HCPCDQfXTq+nALKhx\nZoKEPzzmQ0uAFh/BIBbATL62+9zcoUsG23SecW84VUzeCJKte8Qxd4XgmCbS\nA4FcsmtXu7piuzLVEvLn4PHsaMnRkcyLDSpvc0yu++rHt3rXdFiSPooPXCNS\n92yq0AcVCZQ8hMHH1tJAgyvTdRmEG79DxugpCAPYS8BmWeNOL0FibuetX49U\n8L6WBhwygbGhBTyfgHE6PoetVZTiw46fggJYMmb7H4Pb6vhcnuCblrolvM/h\nMg9fxKoGAPiX0MAGhLZSo7IaltXbC7ElYDIOynBiui2fMKXtXI7KwxdIioQf\ntxfk\r\n=ZpaZ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCyeI7AymUcv+EVqB7oQ/TPm6pDkkiBpPd8WcOZbmAYAQIhALhQNDuSAeOl0RVI4+sDhw5vT3tDGJ8JhVeZGeGMn5/j"}]},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.2.1-unstable.9_1640344590271_0.3997891197416761"},"_hasShrinkwrap":false},"0.2.1-unstable.12":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.2.1-unstable.12","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"^0.2.3","@sphereon/pe-js":"^0.5.1","@sphereon/ssi-sdk-core":"^0.2.1-unstable.12+b701a0f","@veramo/core":"^3.1.1-next.15","@veramo/utils":"^3.1.1-next.15","cross-fetch":"^3.1.4","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.3.3","@veramo/cli":"^3.1.1-next.15","@veramo/did-provider-key":"^3.1.1-next.15","@veramo/did-resolver":"^3.1.1-next.15","did-resolver":"3.1.3","nock":"^13.2.1","typescript":"^4.5.2"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"b701a0fdeeea2acdd77e4f18ebff3f12162efe72","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authentication request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst createAuthenticationResponse = await agent.getSiopAuthenticationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authentication request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationRequestDetailsResponse = await agent.getSiopAuthenticationRequestDetails({\n  sessionId,\n  verifiedAuthenticationRequest: createAuthenticationResponse,\n  verifiableCredentials: [credential],\n})\n```\n\n### Verify authentication request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthenticationResponse = await agent.verifySiopAuthenticationRequestURI({\n  sessionId,\n  requestURI: createAuthenticationResponse,\n})\n```\n\n### Send authentication response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationResponse = await agent.sendSiopAuthenticationResponse({\n  sessionId,\n  verifiedAuthenticationRequest: verifiedAuthenticationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.2.1-unstable.12","_nodeVersion":"14.18.2","_npmVersion":"lerna/4.0.0/node@v14.18.2+x64 (linux)","dist":{"integrity":"sha512-lTPeWbNE4smaZkvpF1ZipxUAP7YcRm9ua56f1Ox+Uyd1fLp4f3f4+11czve7ItuAme/hHts99019rj61d5ZYBw==","shasum":"d9337d5e594cdf9a5fc467fa1b0d52e5346d8f43","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.2.1-unstable.12.tgz","fileCount":24,"unpackedSize":94626,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhxbqYCRA9TVsSAnZWagAAaIMQAI+TWdpUAIQ5R8A51Pox\n6j3VVyXo/ky8LGU2NNht9zgNybA6vELRIsFaLANWYi8N0FtXk6V9uzNc+lEt\nI2nnx+lexe4Z7iMJgWoEph6lyOgQ23G+6mFxejRPUbKE84pR69nO07hV40J2\nA6kogMpSA3YOJa/gvuYeOnYlIF+kZeK8xscXYgaEcBLPLL8b80Xau8ytbn1+\n5h7pnnOowGCsp2Pr2n63UUti1dwQ0FaCfNekOVb/7l2vb9F4HGNh3Eri/SBL\nGpRb4TIZpjg3ZIOYQfL9ws/ILc4e/8RPHs6OB2Sfs4/4I2Az/25N1jPTb/n8\nzooA5/CHsbCL8JASV0rz8VjqOINQc1jcXJSPoc8OAeJimRiHUsnLVejJm9+i\nUHyAeFTA3E6Se+C2Hi7oK+hxE5XhCjwVK17Jyvm2j862hb06XLa/EPq0pAVh\nT0sRb+19bD512TeLOYSmPGlxS4MbI7iI0r1M4yoQmlcR/j9rDksCer/cz5Rb\nWlbwpWRdbb1flke4EaBw9CGotjTf+jE3bq06Bc8+oihRRNEzG/1bD6e0e+db\nyp/3BYH+gtqGySGqq/9OO2SUz4l8TDv9zokirKCOcape+jBCLh/Oeg1nkdt2\nPBC09PtxzKq/nNXNHnatryLwiQy+f2FcDWuTJECIqG0mhHEWbL+QqysAlom+\nk7Pp\r\n=VXvl\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCarScvEAl3oWfhvlig3Pw1KhKVfBTNuijwT9vtTiSBdgIhAJY5gxwFLGfrNx+P+H3f5MOhWUmLuIW360NoVfsXr0aU"}]},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.2.1-unstable.12_1640348312149_0.3942974080279531"},"_hasShrinkwrap":false},"0.2.1-next.13":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.2.1-next.13","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"^0.2.3","@sphereon/pe-js":"^0.5.1","@sphereon/ssi-sdk-core":"^0.2.1-next.13+5d679a1","@veramo/core":"^3.1.1-next.15","@veramo/utils":"^3.1.1-next.15","cross-fetch":"^3.1.4","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.3.3","@veramo/cli":"^3.1.1-next.15","@veramo/did-provider-key":"^3.1.1-next.15","@veramo/did-resolver":"^3.1.1-next.15","did-resolver":"3.1.3","nock":"^13.2.1","typescript":"^4.5.2"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"5d679a17a9ca718f38ff79eb4d7aba5c04c185b7","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authentication request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst createAuthenticationResponse = await agent.getSiopAuthenticationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authentication request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationRequestDetailsResponse = await agent.getSiopAuthenticationRequestDetails({\n  sessionId,\n  verifiedAuthenticationRequest: createAuthenticationResponse,\n  verifiableCredentials: [credential],\n})\n```\n\n### Verify authentication request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthenticationResponse = await agent.verifySiopAuthenticationRequestURI({\n  sessionId,\n  requestURI: createAuthenticationResponse,\n})\n```\n\n### Send authentication response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationResponse = await agent.sendSiopAuthenticationResponse({\n  sessionId,\n  verifiedAuthenticationRequest: verifiedAuthenticationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.2.1-next.13","_nodeVersion":"14.18.2","_npmVersion":"lerna/4.0.0/node@v14.18.2+x64 (linux)","dist":{"integrity":"sha512-KjCBv9R3/1jS4JAHDXU8aHIXbpZMRF+DyQ42XFYaTZJzhkmqoew09Kg6KcUfImVJ92/LAhWDT7JlJbZzmR/bLw==","shasum":"e9a3a9325fd4e244959f3c7f6ed183a483d983e3","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.2.1-next.13.tgz","fileCount":24,"unpackedSize":94618,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhxb1lCRA9TVsSAnZWagAAHoUP/3rTRtzi8WYokmx0kWjQ\nUtishOhfBCaJMd1CBlZ5yT64Q5UzHSxZ3B7KdDwa1TNdoVYHDz/9ZS4yuGPl\nSY0OIZgEXlJPrNvvLsDDC8co7rVlFs2qCdcWOyBYgrjATV3UZM0uVUwBxNeg\nUDEnAjv5wuswiaYrgW9DvpjHRrTecoqrcPn34Ey62vwOUuKxLjWE/ijiI8wa\n9YDemlSo+KftlVkRS7sdPPc1ZiAeDLsYtIxYw5El70at4FyLcZK2Byt+FZfq\nMTtHAwoqKX1okOyBEnjatB+Q7T6JHitrlk2oQXon4n0dlnLinGtzsS3dwygZ\ncENoHrW2fm9HyhTLxdNPxY0hz8/9pIT6wLo7aFh2u66xqTdSpfWGCAK+f9NK\nSvCqCdQhrcBciUbdYeeJLVYKdyWIFsjVsWIoWAjZrxkL6P3U6CO1Ts6fhSU+\nu5b1D0jlU0r8WMkfI3TjjYwEvN0q7k9SjoISXaZ3E4KDUZWq3Q1DSl7IBhuK\nyfutUxY09ZOL1TER3nX+QdPlSca2asSRmc0mieD5yVnLsWAigRttO3wuQmev\nifKulhvwRhIA97Ssqp97uJWP0dZV+WqiOcs0qvmqp3l9X95FEONbXqhsdPN0\n6Ijzv6YUQKXKWPZddij23+W1gJeaCou2fM85r8rzdoYgG7/dOUXRDHNJ26fj\nQlfR\r\n=fJt7\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCcLYgNj61W2Sv60v1qNFtqscuRVfw3uGK+gjT5xDtpGQIgOJ+KF2cSgtp9tCGotjLsvwo/02NZP4Szym71/zwWriI="}]},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.2.1-next.13_1640349029132_0.37869178647077484"},"_hasShrinkwrap":false},"0.2.1-unstable.5":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.2.1-unstable.5","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"^0.2.3","@sphereon/pe-js":"^0.5.1","@sphereon/ssi-sdk-core":"^0.2.1-unstable.5+616ed76","@veramo/core":"^3.1.1-next.24","@veramo/utils":"^3.1.1-next.24","cross-fetch":"^3.1.4","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.4.0","@veramo/cli":"^3.1.1-next.24","@veramo/did-provider-key":"^3.1.1-next.24","@veramo/did-resolver":"^3.1.1-next.24","did-resolver":"^3.1.5","nock":"^13.2.1","typescript":"^4.5.2"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"616ed7644638125695bd0f31e0b1513d32b951d5","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authentication request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst createAuthenticationResponse = await agent.getSiopAuthenticationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authentication request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationRequestDetailsResponse = await agent.getSiopAuthenticationRequestDetails({\n  sessionId,\n  verifiedAuthenticationRequest: createAuthenticationResponse,\n  verifiableCredentials: [credential],\n})\n```\n\n### Verify authentication request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthenticationResponse = await agent.verifySiopAuthenticationRequestURI({\n  sessionId,\n  requestURI: createAuthenticationResponse,\n})\n```\n\n### Send authentication response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationResponse = await agent.sendSiopAuthenticationResponse({\n  sessionId,\n  verifiedAuthenticationRequest: verifiedAuthenticationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.2.1-unstable.5","_nodeVersion":"14.18.2","_npmVersion":"lerna/4.0.0/node@v14.18.2+x64 (linux)","dist":{"integrity":"sha512-dbi8So4oTWFqWEhU+YVySZINuzmUlozedITvAvanZ+1nN0C3g60cZ4+o+jBww8vmv5yEGqa+Bb1XAoDl+AN2aA==","shasum":"a3d72d0e8605cc727be8da115989bb831f1baa72","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.2.1-unstable.5.tgz","fileCount":24,"unpackedSize":94625,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh13LsCRA9TVsSAnZWagAAF7UQAIPnjKJE6QveTIck+hMv\nXZHIvioDoPIz33YHXV/aKbbysV8s657iYuvUi3dvDrigrAhw7nUdOaG/rF8k\nd4Hh9wVzaTHo1TsljR5L1g6Zr1ZmbbjlFKOs1OA4Joq61SlVRwvpnExH/vWb\n6Y9MXPLYeE4CxNTVgaYghbojvfTsF+J79i/WeC/r0MBF0d18bcqHdjyvXO0B\nnV73lHQuXybtciyskYJHopWYY/+s4FcNQhRBpY8facxQ1DW/Wdv7Km8I1aXO\nlKZIskrIgb7TFNGmGMmSTmv3r9Bdsn9x/l3frngtXk2PUCE9g+gO1ynz7XuX\nSbhH98elGBUXHIFlG3g73M/wRqdhAtAybuAJANlmX76cCs7vWWvH0pvh5kIj\nTHJxgXXL+XMtGFwVqH7NOu/0LWjDcK/Or2TWFIzSAs7EgGbkteEC5MPqiKBH\n5YAaA2RunwSzgQ2Kv+d62jRfDt4AWf2aV/SakdD37i2k64yOVn1qd2UAws3w\nnkyBazIOP/U/lhpTicpDrvopN/z/Ki1IBi8pJ2xABIKDspEh5FkU+xlaHymw\nr2pdo/iN9yh2aZD8SwNhJrDgY46LnyGLUpBM8YOvx3W1sdsYKLB1BfnwR+3Y\n22oSmaRjv5RR4JDDz0WZoUb3Jl8yptl+m6zhKft9OJbardY157yh7y+hXFKd\nlmUm\r\n=NVkG\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBQ85GPmFXrp5w+/NI1Jg3kmjKrxF29ZdoMPiWSGJeJuAiEA38VTy/7uLCfJI4cl/R7jlz6r1SoX53EWybLiDBmlEz0="}]},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.2.1-unstable.5_1641509611255_0.9290552790365629"},"_hasShrinkwrap":false},"0.2.1-unstable.6":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.2.1-unstable.6","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"^0.2.4-unstable.1","@sphereon/pex":"^0.6.3-unstable.1","@sphereon/ssi-sdk-core":"^0.2.1-unstable.6+4c9817a","@veramo/core":"^3.1.1-next.24","@veramo/utils":"^3.1.1-next.24","cross-fetch":"^3.1.4","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.4.0","@veramo/cli":"^3.1.1-next.24","@veramo/did-provider-key":"^3.1.1-next.24","@veramo/did-resolver":"^3.1.1-next.24","did-resolver":"^3.1.5","nock":"^13.2.1","typescript":"^4.5.2"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"4c9817a0c57d5e37c2c53674628ebc11eb63e321","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authentication request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst createAuthenticationResponse = await agent.getSiopAuthenticationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authentication request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationRequestDetailsResponse = await agent.getSiopAuthenticationRequestDetails({\n  sessionId,\n  verifiedAuthenticationRequest: createAuthenticationResponse,\n  verifiableCredentials: [credential],\n})\n```\n\n### Verify authentication request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthenticationResponse = await agent.verifySiopAuthenticationRequestURI({\n  sessionId,\n  requestURI: createAuthenticationResponse,\n})\n```\n\n### Send authentication response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationResponse = await agent.sendSiopAuthenticationResponse({\n  sessionId,\n  verifiedAuthenticationRequest: verifiedAuthenticationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.2.1-unstable.6","_nodeVersion":"14.18.2","_npmVersion":"lerna/4.0.0/node@v14.18.2+x64 (linux)","dist":{"integrity":"sha512-YITplR7sfVvFPIh/1Tskb+pwT0swQUtnlZPOKBYVu2h2hJqaYc7Ixn1YcMJemAiaAayfdFGzOlq6kMO+gpEKfw==","shasum":"ba0f0c331927d2eec00c46fa80e78272deada9c5","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.2.1-unstable.6.tgz","fileCount":24,"unpackedSize":94651,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh14MkCRA9TVsSAnZWagAAyn0P/1GOhpj/PRvMjhBJU1G4\n18gvLc6u3Fhwyc6RS50vQvLWw0K+t3OqD0Cezah+ujPfYGjiiWHE+CdQgTDR\nPyMFpbzsij+2lipOvnjzsqsStqC05NgfOWYobg2BElpkF9CkTibbz9uh8g0H\naECkSiBCVxfzMF7dHTQxHpOjwKch2VjYXCMTElFTVgCLQm4TspOetRvU7cGI\nVcbvPvinACQBZQ+rPEsB++qj3j0IEVXCjQrcBuG+al7rIkDosOlEGWA2rIRv\naZ8nEKtbSSWkMDmwJoEzxdA+MeaUoTtm4a99jKslf45U24mzXE6g0KTeeezw\ndMT+vkrGwoTB5cP8rZj5iwqc2UioXw+C4/tbbD1rWeCIV96ZuyGeeFK8WI8S\n+4EhkuRRseugsa1051gom86SMDZ3CXlFgnR685a22xn17Dr9TYJDLeiBluzn\nsBiL2IDzDuzfm+qvI1/KTUa0UP8xFh/NaG2QXE3rtd0s8rxrPK1o9PbzaHp1\nMRhCsgFh/jzRW4dUyPRNmqf06Zr2ZflhU6hft0dZWrnxcEtX+1UH5uqchjve\n4sH0wWK/nNhhOFTDC8Nz/Muxj0iOp8a05arO74HOhlM+pxaG3DJ7rtybQhfk\neuA0J9kcZw1hAgX9Ubnz1x7/1Y2jSzdU446qgMZaIngWlfOlS0V+YRNCEDD0\nGES2\r\n=O5kA\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEUkmvvYrq4CXUS828UEqDCn2PsWioBgtpLZ7orVXRHNAiBo6ms4INCDVRmRJJ+LjEE0Yy9cEz/ieKAX3am3lKLIlg=="}]},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.2.1-unstable.6_1641513763905_0.17954579247636482"},"_hasShrinkwrap":false},"0.2.1-unstable.7":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.2.1-unstable.7","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"^0.2.4-unstable.1","@sphereon/pex":"^0.6.3-unstable.1","@sphereon/ssi-sdk-core":"^0.2.1-unstable.7+b272044","@veramo/core":"^3.1.1-next.26","@veramo/utils":"^3.1.1-next.26","cross-fetch":"^3.1.4","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.4.0","@veramo/cli":"^3.1.1-next.26","@veramo/did-provider-key":"^3.1.1-next.26","@veramo/did-resolver":"^3.1.1-next.26","did-resolver":"^3.1.5","nock":"^13.2.1","typescript":"^4.5.2"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"b27204453e288b6ae7e4090ceaed1885e7bd0870","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authentication request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst createAuthenticationResponse = await agent.getSiopAuthenticationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authentication request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationRequestDetailsResponse = await agent.getSiopAuthenticationRequestDetails({\n  sessionId,\n  verifiedAuthenticationRequest: createAuthenticationResponse,\n  verifiableCredentials: [credential],\n})\n```\n\n### Verify authentication request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthenticationResponse = await agent.verifySiopAuthenticationRequestURI({\n  sessionId,\n  requestURI: createAuthenticationResponse,\n})\n```\n\n### Send authentication response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationResponse = await agent.sendSiopAuthenticationResponse({\n  sessionId,\n  verifiedAuthenticationRequest: verifiedAuthenticationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.2.1-unstable.7","_nodeVersion":"14.18.2","_npmVersion":"lerna/4.0.0/node@v14.18.2+x64 (linux)","dist":{"integrity":"sha512-cxsvjoFqqX+4Z8vIKrl9G3CEoHaFhlz5418ZmQcIz3B0VXE/JMaT0QU891Q8J/iRPUnDkcPuNqbVcScQ4o97vQ==","shasum":"9738224d6d3ff1f643c683f17467f2ee9a09b24d","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.2.1-unstable.7.tgz","fileCount":24,"unpackedSize":94651,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh3UCMCRA9TVsSAnZWagAAxW0P/2aVU9Om8hx6ytpchC+b\nA2z3fZZXLs8KhB/oWG5bMpqJopUxO3L1qFybLlxuxfxyyQ8YsX9lCJCSPfWs\nwrHv6plZrh+Q8ANBaD4Od4M79Y+KZa4IR5fF8mTINnd7ENt4tdAkVQCAVm/u\nolDWA9fVCsiP2n+efE1uD0E8Q4/lwmW2DYnyASsY/mvde9sT8qS9wmlD2227\nuhWFttdJPgyc9/mlvUc+I4Wc27yPiMazi10XDEtDjzf9vQV+sZpBLK6M67vp\n9Zxkx7XQefRqFiiJkS/owXGjW13SCpHb2UF/tC5qcP8ZyLtYBBH0MOQjHU5N\n9/VnqMa5wThwu7r731GDyE7QVNDYLnGuvL5D8lH/0FqsEzl4i8mkJk42utfd\nlm1UTlQ3blr9Omude6UVfUBfVYZMVHcWAqiVVKWKc5qYlYMEZTG9DBO19I3h\n4cH1sgEQRZca2RyXzcDX7PHwQ+RyBMK/cmVb1IRMRyj6xMWjQ4V+uslsfFqf\nyrq/jn4sarYmBFvGnInNQPGnFJdU2MkkT8wO/5gIrALykm9tfRyt345jhjx1\nvniPexJbEtIdpGl3iuvYpqbh4wI6uv47XoduMG7Jatbt+kSHV6CrvT6e5TVx\nei6Zw0HQ3XllYifdrOdCd5l+wp9USiFJ9nHeyL0wGQpTgSto7X3+EYJLvtB/\nCkJz\r\n=9YfH\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCqcCva8j4w04nU/6/xMBl6DyixNbCfyNvgD/c9UxJXKQIhAKUe8+7ZWpe/q0+cuJitYhyOU8D+0A6rnLMVfis5EMRt"}]},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.2.1-unstable.7_1641889931979_0.6805775358640498"},"_hasShrinkwrap":false},"0.2.1-unstable.8":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.2.1-unstable.8","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"^0.2.4-unstable.1","@sphereon/pex":"^0.6.3-unstable.1","@sphereon/ssi-sdk-core":"^0.2.1-unstable.8+346d9c2","@veramo/core":"^3.1.1-next.26","@veramo/utils":"^3.1.1-next.26","cross-fetch":"^3.1.4","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.4.0","@veramo/cli":"^3.1.1-next.26","@veramo/did-provider-key":"^3.1.1-next.26","@veramo/did-resolver":"^3.1.1-next.26","did-resolver":"^3.1.5","nock":"^13.2.1","typescript":"^4.5.2"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"346d9c21ac38b6073a51fff9aba952e8e7031d94","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authentication request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst createAuthenticationResponse = await agent.getSiopAuthenticationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authentication request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationRequestDetailsResponse = await agent.getSiopAuthenticationRequestDetails({\n  sessionId,\n  verifiedAuthenticationRequest: createAuthenticationResponse,\n  verifiableCredentials: [credential],\n})\n```\n\n### Verify authentication request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthenticationResponse = await agent.verifySiopAuthenticationRequestURI({\n  sessionId,\n  requestURI: createAuthenticationResponse,\n})\n```\n\n### Send authentication response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationResponse = await agent.sendSiopAuthenticationResponse({\n  sessionId,\n  verifiedAuthenticationRequest: verifiedAuthenticationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.2.1-unstable.8","_nodeVersion":"14.18.2","_npmVersion":"lerna/4.0.0/node@v14.18.2+x64 (linux)","dist":{"integrity":"sha512-9xOTlVkE03G+ZdHPVmO6nmQMdu/e+C0vdII5WWA7B+2ufRfPKIxPRWFEvLzU/U4zxPxFIuIF3vfrl2JAToJaEg==","shasum":"c40ae675b60561e4c6b39840d230d17daa7db91e","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.2.1-unstable.8.tgz","fileCount":24,"unpackedSize":94651,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh3VhGCRA9TVsSAnZWagAA2NYP/A5KTbDsxJ6pDbXnz8J3\nFaXAeKlrTywCFSd5xSGRR8vXmjwlqLelLY3SZJo0IBBSiIZ67sE2Yq5RANSg\nxrZGlnZXjC/X3fm+c238tBZ4JU9OZHienvLRWOXxjyFDL/+IeUz5Wr57/s2k\nG+vb7KwLpiCDE0Nj//lrtTeI81bm6eXnhCcr6jlc5J5ZsT27t4cQ5fQbR6Po\njZoRQCpYRelG5c1RpC78uAOFublZAsXrS0OqRtEsRC23Q3BOeIq7Zt8ev+7w\nsaZV8ssCcXxMqdkVc3NzxOXYgCsIcXLt26LRsAtzQL0s7KedZiAqzFmw9nkD\nluXCaSQnd+thbVNgIAknnwCGpbDL05fz3j2FSjyuJtBKaj6derszaQbvKP3n\nHRdwImtpkWnk1+PPuE/6LDr1LE2BF93QgbzevdabUHGbIvUeDfvl313vpICT\nLTwHdnsovkxOsCrWCDFQZ+MLjXrMAY4LUnRU0kKqAFCkASId2xyZrDCDTkIy\nNXZvMYjK+ptWyMpICO3GindrU0h7ACvNn0vBlVqF6bru37VaDXMiBJ2YpGKI\nTfyJnKqhCqV9sIDnLLTTu05yiHbD4qgjVCe+ORAk4n38+deJAwgE/IjtoXsB\nwwyGFYUerJsNWN/5r+1TtsEQBl+NrtC5x/EyH81mXlmOLVWWfvsgrW5IdaR4\nFbes\r\n=f37F\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEM8bUTlzmvaF99t9zvuV3DXBZoq8+R1FhJ1mLcEqsSvAiEAtUtSnGHMC7Ip0Im3iQuJqpa5fhPiLTHV5Xfq1nbNnUU="}]},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.2.1-unstable.8_1641896006290_0.09884602982755197"},"_hasShrinkwrap":false},"0.2.1-next.17":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.2.1-next.17","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"^0.2.4","@sphereon/pex":"^1.0.1","@sphereon/ssi-sdk-core":"^0.2.1-next.17+f14f380","@veramo/core":"3.1.1-next.26","@veramo/utils":"3.1.1-next.26","cross-fetch":"^3.1.4","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.4.0","@veramo/cli":"3.1.1-next.26","@veramo/did-provider-key":"3.1.1-next.26","@veramo/did-resolver":"3.1.1-next.26","did-resolver":"^3.1.5","nock":"^13.2.1","typescript":"^4.5.2"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"f14f38091a809114c0f7dfb1c18538dcdd9e1c44","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authentication request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst createAuthenticationResponse = await agent.getSiopAuthenticationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authentication request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationRequestDetailsResponse = await agent.getSiopAuthenticationRequestDetails({\n  sessionId,\n  verifiedAuthenticationRequest: createAuthenticationResponse,\n  verifiableCredentials: [credential],\n})\n```\n\n### Verify authentication request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthenticationResponse = await agent.verifySiopAuthenticationRequestURI({\n  sessionId,\n  requestURI: createAuthenticationResponse,\n})\n```\n\n### Send authentication response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationResponse = await agent.sendSiopAuthenticationResponse({\n  sessionId,\n  verifiedAuthenticationRequest: verifiedAuthenticationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.2.1-next.17","_nodeVersion":"14.18.3","_npmVersion":"lerna/4.0.0/node@v14.18.3+x64 (linux)","dist":{"integrity":"sha512-iSCy4cs2P+oozScyZLcLflemX3FcP9QsQ0dmLqMCR5C4NFYB7IoZRcGCejLCNJpJ1FrqvfA6fgNo4Q6VONYW7g==","shasum":"50dbb6fa16ca69402092c7a66989de0d2c518094","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.2.1-next.17.tgz","fileCount":24,"unpackedSize":94618,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh4La8CRA9TVsSAnZWagAAi1IP/1Aq9//Ea62a3RRTNj9Y\nmqhmqx8UP7bopsoBb5QOGmJ8p72J3tK4hvIIEEk9HvrmKhL3xT52EFc0A945\nSpIhGCJiRIsHvkTrz36/fhfiU+E+rAZP1wrehz9iv3l88/SPcD2nqyA6ocl7\n/A1imXcu+cbqiFJKvEtXIV+guvMAfPgUvZeEcASvr+38+GkYWMj/fkEftT8d\ntasfgScTRU0HO7EGiVrcezmeIh5LD3WHN26eq2/USQ+3Ip+yyG0IOe81wSw/\nb0FJilwHmT6E27eUDUjtZvn9n6EcMFOt/ejf6Yqh+ZUc/ANhDGwd9YB2kv9k\n6S8p+0BQ8QhZJWB/MD4+189QLqF3oQdMfCcl6v/klorrVxGJPikSWsMXFFyK\nylmI4d64ZTou86DiuvgJvdGs/QFP2IIBg16FjBr34n59DHcTMW7DhKiL/KCi\ns6Lo/BEa4Xr9T4+3oblQqpF4S6cABdTHj8BlL0oFlApNjKids9whJF6gT5O9\nkQMRaCE1jRi6oB1OeKMwXcoS7DoHHTSyL9/bhW0jM9z9dvjUKbrnLzXyToqB\nP7MkRzKZJE+XPGX43AtiwJvvfkooyrqvD5Z3jEG4e4gQDNk9kmTCXcTRFbOt\nH1EpggVnUvwPTwC/nplZwdLbJND581gzvsNnZZxuD8owlX+3bovxSPoqgYD3\nQtF1\r\n=xhBT\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCT6oIP+m418B3yf+z++TlUh1j/RFwCntbDU9PKHbGUagIhALAPiL6Q0Zati4Etto42GlFFP6BpLRFXYvh9h0LajOav"}]},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.2.1-next.17_1642116795838_0.07327210808992679"},"_hasShrinkwrap":false},"0.2.1-unstable.11":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.2.1-unstable.11","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"^0.2.4","@sphereon/pex":"^1.0.1","@sphereon/ssi-sdk-core":"^0.2.1-unstable.11+9a934cf","@veramo/core":"3.1.1-next.26","@veramo/utils":"3.1.1-next.26","cross-fetch":"^3.1.4","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.4.0","@veramo/cli":"3.1.1-next.26","@veramo/did-provider-key":"3.1.1-next.26","@veramo/did-resolver":"3.1.1-next.26","did-resolver":"^3.1.5","nock":"^13.2.1","typescript":"^4.5.2"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"9a934cfb507af3d5cc8629bb0e8f6fd70f785092","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authentication request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst createAuthenticationResponse = await agent.getSiopAuthenticationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authentication request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationRequestDetailsResponse = await agent.getSiopAuthenticationRequestDetails({\n  sessionId,\n  verifiedAuthenticationRequest: createAuthenticationResponse,\n  verifiableCredentials: [credential],\n})\n```\n\n### Verify authentication request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthenticationResponse = await agent.verifySiopAuthenticationRequestURI({\n  sessionId,\n  requestURI: createAuthenticationResponse,\n})\n```\n\n### Send authentication response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationResponse = await agent.sendSiopAuthenticationResponse({\n  sessionId,\n  verifiedAuthenticationRequest: verifiedAuthenticationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.2.1-unstable.11","_nodeVersion":"14.18.3","_npmVersion":"lerna/4.0.0/node@v14.18.3+x64 (linux)","dist":{"integrity":"sha512-06dpP8/9aazRaHD7v7Aih70C3v7lRL4e3H9gv4DmOSgR+8r0bjL3dMKZjv5lUu9bkXftr/FgKRmwcUq4jnFlcQ==","shasum":"1ac2e75aa493b5ebe78adca0f7417a1e2828ec2a","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.2.1-unstable.11.tgz","fileCount":24,"unpackedSize":94626,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh5A3VCRA9TVsSAnZWagAAazsP/2ot+0LMKIVzKQRqEjIq\nMFj33LBe3bMluoaq9wjg1PpRWbD1ry0QAwRgPK7lh6m7Fe1lefRRywj2JJY4\nTA4ynT3PAB1+NotVyOIitylGm5Hkmy+AX05RDl6XuDWaJb+pywnLqa5Wb37g\nZknTtYubPOGnbOlrUF99BXprZ+/LTk54koq9XmajEGZuj6UN7uFKNCOJ1lMs\noXf86ctCuxbUgQPHkihv/9KTJC8LGsej9MXPvxT5ycZ8vWYj71rRCGUL6KpG\nVKJ9dPWoFRMaoBm+LfYhmlH7ijdpEi6CpcxyYJ0pyEuVEi8LBVXykLq8yVeE\n95JfiwU8EJkRkxSQnC3G/4GuvZW3mPv0Nl6AV3QzhaaMZmYaWxpsecHYxFeX\nZuwZzuqo5dJ0fa5++J3gA6mrrlITyuOpvLLVH8U8p7N/eakvcgSCRCy0scPk\nYwu1Cz3u1zy5Nbz/sSGnq9uNKjEBEZyIDXeYMLigP0yPrT02BI7i7/Rxnb9b\nU+7/b0Av1y9sBqenIlWkb26TSdPb/RnQB5XGYrR55NBJZdhx/KmJngQJfV2w\nqPW18rbmyopzx6MllL27MfgfN+f19k+x2Sy7ikyg5TvocIbELne5EyvnXZIu\nGQuIybj3lhofu40D0a0yf7RaWmGuI0n30yL2/HHBU5Qqz0462ZMb7lmQ/sPc\n9erK\r\n=03Yf\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCTOKlGJBldDGsLM6DG/h9PSN3CW+kczscuumS5e2M6MwIhALsX4hRxFeu2S9pa46WjDvE/tleBnUA7ZsS9ZPAf0WgP"}]},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.2.1-unstable.11_1642335701617_0.7589906084983264"},"_hasShrinkwrap":false},"0.2.1-unstable.31":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.2.1-unstable.31","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"^0.2.4","@sphereon/pex":"^1.0.1","@sphereon/ssi-sdk-core":"^0.2.1-unstable.31+14f14f2","@veramo/core":"3.1.1-next.26","@veramo/utils":"3.1.1-next.26","cross-fetch":"^3.1.4","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.4.0","@veramo/cli":"3.1.1-next.26","@veramo/did-provider-key":"3.1.1-next.26","@veramo/did-resolver":"3.1.1-next.26","did-resolver":"^3.1.5","nock":"^13.2.1","typescript":"^4.5.2"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"14f14f2cf57c29608cc43c8ff114b2309ab73782","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authentication request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst createAuthenticationResponse = await agent.getSiopAuthenticationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authentication request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationRequestDetailsResponse = await agent.getSiopAuthenticationRequestDetails({\n  sessionId,\n  verifiedAuthenticationRequest: createAuthenticationResponse,\n  verifiableCredentials: [credential],\n})\n```\n\n### Verify authentication request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthenticationResponse = await agent.verifySiopAuthenticationRequestURI({\n  sessionId,\n  requestURI: createAuthenticationResponse,\n})\n```\n\n### Send authentication response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationResponse = await agent.sendSiopAuthenticationResponse({\n  sessionId,\n  verifiedAuthenticationRequest: verifiedAuthenticationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.2.1-unstable.31","_nodeVersion":"14.18.3","_npmVersion":"lerna/4.0.0/node@v14.18.3+x64 (linux)","dist":{"integrity":"sha512-KVN9UwRUn9fNEl8ys7ANFxGvpOwARCmCcOe9xmSHvCI+4ncEyFmi1Nw5hdNTwSL+4/gl5dlVPBsg0M+Dy8tYVw==","shasum":"9b2d6f6444e6606905d6d07eb1797b059d375d05","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.2.1-unstable.31.tgz","fileCount":24,"unpackedSize":94626,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh5EKDCRA9TVsSAnZWagAA+l0P/j83kLEuXX6Y6SJKOiEC\nSmvnUS5T7gMtX6T5WuOqFXWSY6mEogNruotpcvTV4V56oFEfJ+EwUqGHZkSv\nOy4cDAUdSdR66Bd+vD84deNT2WfW0TRbzanQ7F95Kjdh85f3E6vDwpByw0pq\ndqucSz/kt7YVaPGhwdQo4OO4Y5Df5jQWX1WvcDGna2eT1EU1bLAlAzxXG3Ma\nFxfpNkJRdRn/ybw4Vx2+D+eWIPE30cS1qOnfaykhY3mWpcWprfHi7X2fs9Er\nlBQDadiZKE4xsPhoKBFbMTb0Anx0/EuyYxGnNb+CyApPWvYv4FsssS+1JvBS\npglqiJreAOdGuRNxAVMuHgvo+3NM+FxKXdp6/OrQJiTBiKI6upCCllVeJZSb\nuw+cECQtv2D2r8wQO2nC9cnbODoLO0mZ2IIKoYs0ahmctqAgLCtmXe+yu7Qc\n6xKzhXnBSX8BFyckEZvEp9sMQ+gjFHQ6qKL3fgTryR9XjcSniKkxO10rfcZY\neLEC63/VeQr0M3BxQkrDADPRuwhJdcCYPfJqfPKVXgDdDGSq/Lutv7oxgBUx\njcJ9NP2yjQFNPHWpoR9ovWW9jaEPC1Uu34vZKq3leJgsJ+FaEgoFswYVD/uJ\nGRJNc3V6/BpXTzieDO1Y2JYsXNjjoaAgUp0xEiZ4ky8/VkDKhB/jssbOb5kK\n6O75\r\n=SGSp\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD+lP/TrWW+RrPAA/vZoLn9RGk22avrc9xQtZ94xuPKvgIgGmQD0S2GZIgzIhTl9A/GWnufsyNF+ufcC8gcYZ2cvG8="}]},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.2.1-unstable.31_1642349187343_0.20660682599985813"},"_hasShrinkwrap":false},"0.2.1-unstable.32":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.2.1-unstable.32","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"^0.2.4","@sphereon/pex":"^1.0.1","@sphereon/ssi-sdk-core":"^0.2.1-unstable.32+2e3f4a1","@veramo/core":"3.1.1-next.26","@veramo/utils":"3.1.1-next.26","cross-fetch":"^3.1.4","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.4.0","@veramo/cli":"3.1.1-next.26","@veramo/did-provider-key":"3.1.1-next.26","@veramo/did-resolver":"3.1.1-next.26","did-resolver":"^3.1.5","nock":"^13.2.1","typescript":"^4.5.2"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"2e3f4a13f759620cfec29f544f2210256910a9e6","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authentication request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst createAuthenticationResponse = await agent.getSiopAuthenticationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authentication request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationRequestDetailsResponse = await agent.getSiopAuthenticationRequestDetails({\n  sessionId,\n  verifiedAuthenticationRequest: createAuthenticationResponse,\n  verifiableCredentials: [credential],\n})\n```\n\n### Verify authentication request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthenticationResponse = await agent.verifySiopAuthenticationRequestURI({\n  sessionId,\n  requestURI: createAuthenticationResponse,\n})\n```\n\n### Send authentication response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationResponse = await agent.sendSiopAuthenticationResponse({\n  sessionId,\n  verifiedAuthenticationRequest: verifiedAuthenticationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.2.1-unstable.32","_nodeVersion":"14.18.3","_npmVersion":"lerna/4.0.0/node@v14.18.3+x64 (linux)","dist":{"integrity":"sha512-n2y+A/CwwEIfcs2yB0tqugziZfpAE6uMv9BoXTBuR1TBS0qyWchRDqX9hUMNeurMm5OwvQa+jio3pIP3fySQEg==","shasum":"994628f7685ab0c7b24febce985747cde3fbf7a8","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.2.1-unstable.32.tgz","fileCount":24,"unpackedSize":94626,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh5EfPCRA9TVsSAnZWagAAoacP/i08oCuTo8ZFgHwCMBPS\nJ6mmCQafa8ypwltiVmjHw3+7HFdCXF24TeXECs4KAoJpIbrdoNb3pFop5OGk\nzqmIo9SEQLtpiYnb0l8j8WIcNL4jWWJwt05eCGRll4KRupRVeomaHg73y2iW\nhCwd++cK1EmGmbm4zSOchMV2U1TSrnhhUjphaiSkBz6MLfkWd7W1A4Or7xeV\ny5rBOyeXvhd8CvptQmVLo/VwY1mtxl93qOyMiNvWGiraIA5rEqPdNY6f3pZ3\neb1aJZDvqoAkK19zb5JCTvXH9k9pISZyOgtooNle/8PUNWuWAbaZwWYCOFOP\nMG0Z7tnB3McPQmg476MaxaW5W/xVwIN/ZTJ+qGduFb/fxrlEHXcOQz0GpSVs\nckCA2ADlQL5CG7qTqdJiFEca4LLjVTrGkttHxFGjyOOL7FFEzJAIpaC0iStJ\nneDvuO+zP1N+yrHtTUYpUG/B6LxmoUbqDiT4ZsRg/cJ5OlCkizp6pkMptH4Q\nS99M0RAQ8ZIB0kzSKfcMDDeD9PfWuvyb6TMJvFA5QdVxff8VIV1YbOFNt3vE\nqcvoCnGe8wsIP+m0p/BdniRLsfUq/R4Fx8frQD3jbwTWaB9/KYMM6QKdbRoz\nIi7a7LkAoKZHiGSJMoz5yip6PBlMMdmE4AdKZvMvIAKjw/B+4bHILgZIVGHx\nccAF\r\n=AAn8\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIB3PlDE2jIllqKYQCwrsMFGPqa9qQizV4B8mczhTAt48AiBWBO+S4BziRN3bA7ot3QhbDjNaa3QOf6EIRpZPRharTg=="}]},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.2.1-unstable.32_1642350543496_0.7923177396330079"},"_hasShrinkwrap":false},"0.2.1-unstable.33":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.2.1-unstable.33","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"^0.2.4","@sphereon/pex":"^1.0.1","@sphereon/ssi-sdk-core":"^0.2.1-unstable.33+4a3b8ce","@veramo/core":"3.1.1-next.26","@veramo/utils":"3.1.1-next.26","cross-fetch":"^3.1.4","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.4.0","@veramo/cli":"3.1.1-next.26","@veramo/did-provider-key":"3.1.1-next.26","@veramo/did-resolver":"3.1.1-next.26","did-resolver":"^3.1.5","nock":"^13.2.1","typescript":"^4.5.2"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"4a3b8ce93e36c55b3b17884e262db9d91c4459e6","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authentication request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst createAuthenticationResponse = await agent.getSiopAuthenticationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authentication request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationRequestDetailsResponse = await agent.getSiopAuthenticationRequestDetails({\n  sessionId,\n  verifiedAuthenticationRequest: createAuthenticationResponse,\n  verifiableCredentials: [credential],\n})\n```\n\n### Verify authentication request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthenticationResponse = await agent.verifySiopAuthenticationRequestURI({\n  sessionId,\n  requestURI: createAuthenticationResponse,\n})\n```\n\n### Send authentication response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationResponse = await agent.sendSiopAuthenticationResponse({\n  sessionId,\n  verifiedAuthenticationRequest: verifiedAuthenticationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.2.1-unstable.33","_nodeVersion":"14.18.3","_npmVersion":"lerna/4.0.0/node@v14.18.3+x64 (linux)","dist":{"integrity":"sha512-fvD5N4s+ML8+l/OlEe3cnoRK7EgVIghYezljm6CRbtJaxmUNWqKo2+Q0djvzgZcpGOAcTwoHbdxHgxR/coTeuw==","shasum":"1db07cb021b2bcf6f8c93f79e678f2f2b89a27ae","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.2.1-unstable.33.tgz","fileCount":24,"unpackedSize":94626,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh5FRmCRA9TVsSAnZWagAAokkQAKHBey5pXUqWSpEP2hco\nOC0DmneHZhSQpL1rJopGpFOh+qrCQndJVznm33LQyCgYe4i5fK/UVrMvIlSJ\n+I0Uj6MZjVt0Q74FEgVBpAzOAL/puH4Uy1GrUmKhWnG7YunfAGDgkVWjEsPD\nJmnzSXP6La9QRcUqwRZjekplrDLjqaTJj/u3xRARDiCNOogDzloIMT0/bTfU\nE+CBA6KG2k8VlbACJsTtEhdhxht1NO3vYwKHnIK+MyibIHcHGBMCzNYKqUBo\nSYq8AkFXCfj9msM107u4XxOwM+3wlwgTvg0nhcRx660buubuqhwzUsBcu/uV\nyNDMgjKrN7HtQYSNEcdUJU8jy1xJcFpR1G2KkrAo2f2//p7NeLy9qd7NkHfr\nMogODdXyaDIM+UCvlxHRu7ZBbTsnzLBrjHYDErM0SiliEYuuTjoicnIfNhMn\ncwUNtiZcQyPu+ee5aLTnJ482nQCvSGUsNFpT+4dNi/qHhz9cXixtgcVyTcte\nVNL5q4g2xdW+0tDTUXiSGKZcZGvKSTd6+KnOwxa1mguwTnnrZ95OQec4RKJS\nP0JxPNQZNKpna6hl49XGKlGiPdl1gPbL6TerFSkMdTnK/Obyd5zzDcLHMYjA\nbT6KovktNGlSXAAtvgoQBLjTg3n5fcko+AiKm8pV3Pvgss10sG0JJMSlzOAk\n0lMi\r\n=IAra\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBiB5/duVhhfHwPiUa0G/qxNaBsfSialrdYj8/3ql5COAiEA0gRwkiAnhqGVgpkl1bTOqgjGEXByCYgwb7s9szur3IM="}]},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.2.1-unstable.33_1642353766745_0.6640996176150409"},"_hasShrinkwrap":false},"0.2.1-next.33":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.2.1-next.33","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"^0.2.4","@sphereon/pex":"^1.0.1","@sphereon/ssi-sdk-core":"^0.2.1-next.33+4a3b8ce","@veramo/core":"3.1.1-next.26","@veramo/utils":"3.1.1-next.26","cross-fetch":"^3.1.4","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.4.0","@veramo/cli":"3.1.1-next.26","@veramo/did-provider-key":"3.1.1-next.26","@veramo/did-resolver":"3.1.1-next.26","did-resolver":"^3.1.5","nock":"^13.2.1","typescript":"^4.5.2"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"4a3b8ce93e36c55b3b17884e262db9d91c4459e6","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authentication request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst createAuthenticationResponse = await agent.getSiopAuthenticationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authentication request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationRequestDetailsResponse = await agent.getSiopAuthenticationRequestDetails({\n  sessionId,\n  verifiedAuthenticationRequest: createAuthenticationResponse,\n  verifiableCredentials: [credential],\n})\n```\n\n### Verify authentication request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthenticationResponse = await agent.verifySiopAuthenticationRequestURI({\n  sessionId,\n  requestURI: createAuthenticationResponse,\n})\n```\n\n### Send authentication response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationResponse = await agent.sendSiopAuthenticationResponse({\n  sessionId,\n  verifiedAuthenticationRequest: verifiedAuthenticationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.2.1-next.33","_nodeVersion":"14.18.3","_npmVersion":"lerna/4.0.0/node@v14.18.3+x64 (linux)","dist":{"integrity":"sha512-zoCl6rJnlEX+oguQo36BpZnT76X1fDUgIlCDUKR9Wl9ndzqyhDGSAWsBL6WJBG/RtIsvM55qiJbtpniQcO5NPQ==","shasum":"85f78a70f08569649155a15f738285ec67168638","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.2.1-next.33.tgz","fileCount":24,"unpackedSize":94618,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh5FX8CRA9TVsSAnZWagAA4FYP/iJD9p6du6QuiwKcDOyt\njUcl8SS5fSHjKvoD7yyuJDEbq2lVr6MPfSCFO78R4UtqKdvlEn8s7L5jll9f\najVpizYvCVOZGdzPv+Pr1dCSESLpHzsAiYkiLIhi/YLg4pxCkTkIxlVBQ8va\nrxwVHh97ydXvUdKIxR3ukwNX2XItJCN8Q11JFGuANarMANwQkSvLu/EMQoNE\nfAIwGYf+ADfiUmYWkNGuEAa3WF/d5D/CZGYNAIoXdmAXlmt9RXuq6YVKYiPj\n64cj6alaMvE50f5+POjAj606gKkIw05RHqK1q8X1lZSXivcizdu5BXOYmizV\n/WfrHWW+IiklEWniVnTsqP6F3dyBzsCGb0pk92KZwA+WqAY3efDLih1B1rUT\n2KiNCjgPDMkuR7InRWemtNklf2Cg2txfzcNKO4aG+5nuUWxe5U61kMcLsuv9\npg4JMb7YglR+lEE47HM43K7eirJItw2lArG9pw+iK7rlv2AnJO5PdJWTzjV1\n5S0jgFIXXHGoOJGd5OB6u3yOAcHFeO/E2BcqpOAql9dV5PegMowWtwJ4oa9Y\nSqwW+R7yZdnF+b3Kpuoutqt/J2wn9FeHWAkFIYxIGtCQ/Q6ZcTjN6rWBZ73u\nfP00TWYB9LOw1IthEw/W2imj+DHAiuER18eHI2Uutbcpq3ZOVT8Jqs6pSBPf\nRuHc\r\n=pXkJ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCLQA0Pg3XoM+BGSkQaVJ89G3vntFarKoPV+Dt5h34dogIgUxasuI5G5J4G7M33rdNxq5/61sLypuOzxlQyo+bJQVA="}]},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.2.1-next.33_1642354171944_0.2125873168860517"},"_hasShrinkwrap":false},"0.3.0":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.3.0","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"^0.2.4","@sphereon/pex":"^1.0.1","@sphereon/ssi-sdk-core":"^0.3.0","@veramo/core":"3.1.1-next.26","@veramo/utils":"3.1.1-next.26","cross-fetch":"^3.1.4","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.4.0","@veramo/cli":"3.1.1-next.26","@veramo/did-provider-key":"3.1.1-next.26","@veramo/did-resolver":"3.1.1-next.26","did-resolver":"^3.1.5","nock":"^13.2.1","typescript":"^4.5.2"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"858e37466062d9ea20e7d6a049c1e6d1bed411d1","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.3.0","_nodeVersion":"14.18.3","_npmVersion":"lerna/4.0.0/node@v14.18.3+x64 (linux)","dist":{"integrity":"sha512-bZM81iroM8XQth054nFror8PoFj+VsiEaS3Dpx16YHl62MlzuDmdylxboUf5MHzhkUiSqWfzrU9v8Ww5qI3zhQ==","shasum":"004b4b437f0b1b0808ef7001e89e0fb00ccb402d","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.3.0.tgz","fileCount":24,"unpackedSize":94586,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh5FdYCRA9TVsSAnZWagAApFkP/iqzEgaPV5vRNS0Gdidy\n01ZZM/NVB6hOG52PVs1sOs1Bd7211gU08QmmOuqQcZqypTDi5V9B4jXANWvB\nR1Mi8rjDEVDMsT6FuS+84Zl6CIzHY6h9KAaZPvtVsjIQY7AQJl41eNKT2cfh\niAhGPa5yjcslgigDZtK+qO8+4DNbXIgKV/x1kvsC7Q9wzCePdw2Irngr5kjm\n/kKSijuFJQUD27NfKoq5HpnCBXxnenrNeXIQPA0axhc4FMfqNkccKoOZuv46\n+eUJlC6Ydjty3kZTSfzJiHxAHo6c4aMaxooQ8fB/N1qbx6JbERwyQPgsSwQi\n9Uf2Zivblo9luMgWWtH8ulm6H1RVJ2lQp4LkukKNPKG3Is4vQayxlFTH4jOV\n0IDNQZY58VxJZREZrC9N/37SeQO4wCIyKmAhcl9lnjYXNfSZsFLKKabnPPv1\nqwLQdA6MOFarEix1mZoC1DcREeveqkWy8egMA+kb6LNp4xBnjRX/6qz78/eG\nfbAhYnCwDxeAfGQjhdbuUnvbINFtyVUrYACBmq454nfV5kMw91UhwhsttI8B\nwxes/ZXvt55Tk2NyuxthQHwTFSZgimLFF2EHkaFMYzEU0BF0Xr6aZeo+JYUy\nB3hdYaRw0XZ3yvvv/vKjBPYN154yV/R4eTGhcGJ4JyCX451UCMYuWTq+D91o\nAMHJ\r\n=EWRv\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBrBEjKra8rEqAzTXqW3xF4l0Kp8CgZAjrdartqKvU9+AiEAkKRaF5tPRAKLmMWN5Im6SjLq1JXtNqh1YCRLulX3fBM="}]},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.3.0_1642354520527_0.0005638997162156212"},"_hasShrinkwrap":false},"0.3.1-next.7":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.3.1-next.7","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"^0.2.5","@sphereon/pex":"^1.0.2","@sphereon/ssi-sdk-core":"^0.3.1-next.7+3ee1702","@veramo/core":"3.1.1-next.26","@veramo/utils":"3.1.1-next.26","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.4.0","@veramo/cli":"3.1.1-next.26","@veramo/did-provider-key":"3.1.1-next.26","@veramo/did-resolver":"3.1.1-next.26","did-resolver":"^3.1.5","nock":"^13.2.1","typescript":"^4.5.2"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"3ee17026880711f3ccdc08f83afe2a5884b89c83","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authentication request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst createAuthenticationResponse = await agent.getSiopAuthenticationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authentication request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationRequestDetailsResponse = await agent.getSiopAuthenticationRequestDetails({\n  sessionId,\n  verifiedAuthenticationRequest: createAuthenticationResponse,\n  verifiableCredentials: [credential],\n})\n```\n\n### Verify authentication request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthenticationResponse = await agent.verifySiopAuthenticationRequestURI({\n  sessionId,\n  requestURI: createAuthenticationResponse,\n})\n```\n\n### Send authentication response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationResponse = await agent.sendSiopAuthenticationResponse({\n  sessionId,\n  verifiedAuthenticationRequest: verifiedAuthenticationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.3.1-next.7","_nodeVersion":"14.18.3","_npmVersion":"lerna/4.0.0/node@v14.18.3+x64 (linux)","dist":{"integrity":"sha512-Xgebu+uRX4fOLrYletjuJ4K2IlIzTNcgycvqzk2r26/TQ7k7DNONS1yxVyT37/fxDoUE1N5IenwBNDmho1IScw==","shasum":"1b26934dc5e2c0c22ec5e8e14adf25c9b1b2bc13","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.3.1-next.7.tgz","fileCount":24,"unpackedSize":94616,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh89KVCRA9TVsSAnZWagAA5jsP/jbrMPqkSuc4/lIyM4z0\n4jnUKlSlSSa7nvu9ntqtZsZF4qcGunADwlWGyjfhClzpdQzdr1dxCjEtwriM\nowYrUHUTX8LmQCm9kkLAltYunIQg17GRWrLRTISDuhCOGe1NV5nW9OpxcFBr\noDcNiZ0TaPwps7pjAkst6gpI5X9qcHlcm5wFz86ecxPXywDMHu3saCZU8/nf\nF98KZOlmNLF4BMv4JnPrUKRKCw392k6v2cEtALc/bSevg8cMdSULyrMxi90u\nWKVGFm7l/RTMKxUmlx88vx7S3Id2upmV9/8IrUZGtamCQ7H5teDjIgOWUHkY\nZFe/MZrUxsnI/AYZO+rmp0hJ/vDfls0utZkYRTsC9LXTLKrIyc7WnyFtFYdH\nU9h/Y/KDWh2eupMPXVXGDlVdhFAHBXU7VCP3MWtIZYgibXoa4PI8Ix7bpl9/\nmlV4Ia7gFrw4//882lNdKuFjU5F/KtZLgp29Ij5ACuww2ZQKDMXq5IiNQyGh\n9VW6X3VG+ufL/GmSHyY5RLoPqKUhQHW1oIYbSFF2vS4WYCPE8Ipb5o1WbG6r\nXaog6OVTbTcZV8WImzV++ODcFR9+OD/T61VA9gtTpZvbCirx0/xBBoR8VZlI\nrkUDziwzYRYKVkxrO7Gvg79etTZxPwAonJ3YTOQvc+FVgNXPzypK424pnMu3\nICti\r\n=rNlj\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD2B9kFCgEsuHr1AydMaTlco2cljWjZ5QjNzB+OC8W7lAIhAPdt8Mt8cV1TtpezHNaGbVM3/yqXt+slOozw3NTt+Hef"}]},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.3.1-next.7_1643369109811_0.6648560059323474"},"_hasShrinkwrap":false},"0.3.1":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.3.1","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"^0.2.5","@sphereon/pex":"^1.0.2","@sphereon/ssi-sdk-core":"^0.3.1","@veramo/core":"3.1.1-next.26","@veramo/utils":"3.1.1-next.26","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.4.0","@veramo/cli":"3.1.1-next.26","@veramo/did-provider-key":"3.1.1-next.26","@veramo/did-resolver":"3.1.1-next.26","did-resolver":"^3.1.5","nock":"^13.2.1","typescript":"^4.5.2"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"bf3b6e46ff08259d3b2612e11531cc02c372fc21","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.3.1","_nodeVersion":"14.18.3","_npmVersion":"lerna/4.0.0/node@v14.18.3+x64 (linux)","dist":{"integrity":"sha512-9canzdGbfFDKhNMz4gT7LykE12c77jVGnzyXhikeQ2YBJiigQdNi1y/Kn+P8QKqMj69stB2Vh4tknZp56DY0Eg==","shasum":"739cd82de2267f07b3eff842982ccb709f443715","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.3.1.tgz","fileCount":24,"unpackedSize":94586,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh89QpCRA9TVsSAnZWagAALmkP/R0/NjzUB868HOltAD2N\nfNIx35Fj+wXJXHVXXds1BPoR+kZNLH3RqzkG3uOGh0lfrJzWBPXGxCiRjDAh\nrFx9dO6zT+rOoC18fBb5x+j18/4l3dxB6eChDPzk0KQYptXdeVe4wlvUQTNj\nqTXavPozmg4cDpIfg33iI3ElssfO8702/t8oXTvE5qjvEA5RJmrh7I96Kr7U\nuzXuo6bjWOcdrHRFoBXrE9KHFYUTVW5r4KGU+oqE+igXceSRmHBXfyMvVBT/\nv7yK8MFA+PmDF1wjgYarFdfpe0DQbwnfeDwQz5oJhBUGRUUfvd8DaRZcgsP9\nVQ3l5t0gmXCLzEupKdXl6OQnUEp+mAZqjz8PkbLtLYUVdTDokFSY37H8ufmx\nmaRFi3dbgYjhnJJgMW9wK7fi0w8QpsbVwvsmu7/I0zjCmu0h8dQD2u2loAHL\nZG8WGlWYe5TwZMi+J6XPavjbu9TWwJuWf9lyM4yMLYokwDe4DSxMGG8wiunc\ng9u+LxWgZBUYDPFDCocAGwaFFoXxRjyw47tJSkl+wOPnjFIDy7uJDUyiuxj2\nQ0XJAdfequTewbHmMNIbQjiGVku6Pxb3WVVFeycjHSP3m3Nuyxf6hFLxzyJN\ntCg84iWHOr3Wd6e+OvyRJ+jZpfQlczucOdwFWFhx2rybWaWl/bOVV02Wxmq5\nEGxj\r\n=WfuK\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCg5ZIocm1xX+T4qLihdEU0Bbv3DOzM0JfnCdNHomYtBAIhANQktTNRujdZt/FifrJNvEFK5UZaXjeI5nNeSy5zBilC"}]},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.3.1_1643369513814_0.23124057633634298"},"_hasShrinkwrap":false},"0.3.1-unstable.30":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.3.1-unstable.30","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"^0.2.5","@sphereon/pex":"^1.0.2","@sphereon/ssi-sdk-core":"^0.3.1-unstable.30+f0cabf0","@veramo/core":"3.1.1-next.26","@veramo/utils":"3.1.1-next.26","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.4.0","@veramo/cli":"3.1.1-next.26","@veramo/did-provider-key":"3.1.1-next.26","@veramo/did-resolver":"3.1.1-next.26","did-resolver":"^3.1.5","nock":"^13.2.1","typescript":"^4.5.2"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"f0cabf0671d679c5a320f5c6643e8ce14430ba6c","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authentication request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst createAuthenticationResponse = await agent.getSiopAuthenticationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authentication request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationRequestDetailsResponse = await agent.getSiopAuthenticationRequestDetails({\n  sessionId,\n  verifiedAuthenticationRequest: createAuthenticationResponse,\n  verifiableCredentials: [credential],\n})\n```\n\n### Verify authentication request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthenticationResponse = await agent.verifySiopAuthenticationRequestURI({\n  sessionId,\n  requestURI: createAuthenticationResponse,\n})\n```\n\n### Send authentication response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationResponse = await agent.sendSiopAuthenticationResponse({\n  sessionId,\n  verifiedAuthenticationRequest: verifiedAuthenticationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.3.1-unstable.30","_nodeVersion":"14.18.3","_npmVersion":"lerna/4.0.0/node@v14.18.3+x64 (linux)","dist":{"integrity":"sha512-EFjIMi3FojzPVp0/vH0DXiJNdqUklGGXSA3RjvuE7etRxOzB3VGATJlTe60KjyQNKwcXXs7ZffNRF9djXbwsjA==","shasum":"c25543686ddf983a2454790c91b3da327f1b9290","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.3.1-unstable.30.tgz","fileCount":24,"unpackedSize":94626,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh+n9GCRA9TVsSAnZWagAAb68QAJ7lCHYfFnorlN8v6N2i\nXUpfUPS3EfsMgxc4EqrnUQfJqOUX7Q8axGeKyXWfW3E3Bj9gCVJXXtlM/ifu\n34xm0JDsDteV4X3K5K/2+rcE0SnTkskHvPSpUDdLvSV812oRyLxwLaB0412a\nu1J/evIWZrLrkixq3oxDlWzZnsql3TWi+qdfe7UiEhSO2nmwWnN4V12YNATk\n8ft4JDK6bK2VR6yAVC2pN78h5gcz17YJcnAGTJKOGd3fcxhfw5xgY1YJTz5H\nqbNB9u3/4zXd0Hyw2xXJiWHJrms7cjSAW8XoRGlHChsSLoEYwQf9+mSwYz0H\n8Mw4G9ZfquAVcNS/B6bJOJYZH9IE04OPRlVfjrXO2d80pPwFczS5hFeQFZ+I\nQg4UPmxgY87CecIXYkJzqszjKoKdj2TC0fdEWZkEUfaCIKdziae5PG+LD2+A\nWEjdlouyZvcRRvh5xAz+m8QxO8HaOVnTgxRhBqzC0xQ8wJpLSQ88+VAu8S5A\nstgM1mZ4FHO5okks5RJWA/tFIOz41lHW9Z3KiAk3LmcOqARaYd8Ij3ItW8VZ\nwjfZhXNfwU59lcOcFewORAN/heE32fxhc0FP/U3bwt5WTQz7vIY6PMKbMli6\n9LsG5UCDZSO2+S4xo+w2dOLj4KAIhMq17VvyKAYhWgfqehLndw7ymgzj3wMW\n3Ti6\r\n=NSEK\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIF6i8tZCLvaQStNvzRa6/ZGTIVngVEAZsVi4D/cDIIIXAiBX0/PeVYVtiztDiRgFIUTbokQEgZUuFPQTJyZ3Wp8BKQ=="}]},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.3.1-unstable.30_1643806534548_0.8223059187665616"},"_hasShrinkwrap":false},"0.3.1-next.10":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.3.1-next.10","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"^0.2.5","@sphereon/pex":"^1.0.2","@sphereon/ssi-sdk-core":"^0.3.1-next.10+cdbfcab","@veramo/core":"3.1.1-next.26","@veramo/utils":"3.1.1-next.26","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.4.0","@veramo/cli":"3.1.1-next.26","@veramo/did-provider-key":"3.1.1-next.26","@veramo/did-resolver":"3.1.1-next.26","did-resolver":"^3.1.5","nock":"^13.2.1","typescript":"^4.5.2"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"cdbfcab114531947e6d0092e0bdb7bc9f818ac88","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authentication request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst createAuthenticationResponse = await agent.getSiopAuthenticationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authentication request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationRequestDetailsResponse = await agent.getSiopAuthenticationRequestDetails({\n  sessionId,\n  verifiedAuthenticationRequest: createAuthenticationResponse,\n  verifiableCredentials: [credential],\n})\n```\n\n### Verify authentication request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthenticationResponse = await agent.verifySiopAuthenticationRequestURI({\n  sessionId,\n  requestURI: createAuthenticationResponse,\n})\n```\n\n### Send authentication response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationResponse = await agent.sendSiopAuthenticationResponse({\n  sessionId,\n  verifiedAuthenticationRequest: verifiedAuthenticationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.3.1-next.10","_nodeVersion":"14.18.3","_npmVersion":"lerna/4.0.0/node@v14.18.3+x64 (linux)","dist":{"integrity":"sha512-YfJyWiUorY7vztu4SvgVKPqbEEMyOPvri2vjuZ/6MLK9lf6q4FN1OjZ12sZjuvaz/n9riytROA6XUMZmYoMfag==","shasum":"b7a8a262b58a42a1d73822a5062a893cd960097a","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.3.1-next.10.tgz","fileCount":24,"unpackedSize":94618,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh/TNZCRA9TVsSAnZWagAA8GcP/0IQggxYYSffGxZPA4SU\nKqKOljTlNDevMIPsTG6LIC6+DZbDKI+81CBb+yi13J97oXFQn2VURRt3BtS6\nYMAhiFFMuKQ6ISy1+/PXiOfg/67435Jpm4MXw3XxtvnNUJFQqBzGEJUr6Ijg\nLP0KQNwJXTzPKjXgzVlVkfJGnvWDcvr4lk0ZqSlFELpxwyGDLlIasov4wOOF\n/JFpCgl+Ed8qEcBqihMTJpDQ7djW1uyk4Lg9fXDU+KpLVl0gjnKjYhxIEyxY\nvB8If0F6KwFUUYfGDz3umeznBvhetycBU5fAcaUMT2F4CGI/dd8UTe7qLDnZ\nolMohY93wTeDICkCRbrtxXeqmB9puGFwphDOjJlYokCBgTdTr1bwW055faO7\nHZ3wJyUPOZnqQj6pNb9OUoc9sxERnDvp0CVKGGAIBZVRVqzeo94Q4/pDVDvw\n1I8f+YcjB7FLt+kwu7f+s5rksTLyOo20CliNsrZeGYCFiJvlWZSlim+RZzwq\nqvC99Hj2yImFguK7JhuygWA859TheCorga6mbXHYjalZGJ/l1IJdFhQgkOTn\n7fEj8k22H49FdYp2UO0Qy0PI9TZsICuOrCNC/fKonQQ2ViZ2XqluqaN2Wun3\nUuyHKMzFcYi2lrs02dnnSDrT8lEkFD5obMjWtOB9/AE48ifOEUPsm/moQN4T\nTlgJ\r\n=7iCK\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBaFMFG/Sv6gzvr7LrUeYz/FbP2Uoy3/04SKqCQ8fKL4AiABhVAs6qwg0cCDecgv6XgI72XSgYC6BASmRzV1VsKOCw=="}]},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.3.1-next.10_1643983704919_0.08493677257810739"},"_hasShrinkwrap":false},"0.3.1-next.11":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.3.1-next.11","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"^0.2.5","@sphereon/pex":"^1.0.2","@sphereon/ssi-sdk-core":"^0.3.1-next.11+5d647df","@veramo/core":"3.1.1-next.26","@veramo/utils":"3.1.1-next.26","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.4.0","@veramo/cli":"3.1.1-next.26","@veramo/did-provider-key":"3.1.1-next.26","@veramo/did-resolver":"3.1.1-next.26","did-resolver":"^3.1.5","nock":"^13.2.1","typescript":"^4.5.2"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"5d647dffd9002ffca2a15a5c1ba56e33acec6716","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authentication request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst createAuthenticationResponse = await agent.getSiopAuthenticationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authentication request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationRequestDetailsResponse = await agent.getSiopAuthenticationRequestDetails({\n  sessionId,\n  verifiedAuthenticationRequest: createAuthenticationResponse,\n  verifiableCredentials: [credential],\n})\n```\n\n### Verify authentication request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthenticationResponse = await agent.verifySiopAuthenticationRequestURI({\n  sessionId,\n  requestURI: createAuthenticationResponse,\n})\n```\n\n### Send authentication response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationResponse = await agent.sendSiopAuthenticationResponse({\n  sessionId,\n  verifiedAuthenticationRequest: verifiedAuthenticationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.3.1-next.11","_nodeVersion":"14.18.3","_npmVersion":"lerna/4.0.0/node@v14.18.3+x64 (linux)","dist":{"integrity":"sha512-vqjz1kYQrP2Jw4F1FBQC3xHGC8v5NPEZWZ6QJqJcb8MqXHbsCw+Nk4GQnwkVgtPKZDvaTOb85TPEuAev0tjAAw==","shasum":"a64b9df26073f23d67bf111dbdd94f51a0b91641","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.3.1-next.11.tgz","fileCount":24,"unpackedSize":94618,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh/T1ICRA9TVsSAnZWagAArbwQAI4EbTBKnrka0u84C/uP\nIosDIm5o907ZOSgbxiksf6z1eaOMBIqyOa76obaD3I31vU+lU0LW7f5dxh5R\nx+8Ejx7sMcQC0B/QCBxay7axgKd/Bsvtfmzl9KcKnvKY37Xzftx/PEgHFmcV\n8t0iwQ5Y9jxRMgaFrCv7c22QqUfy+Wy7p2ZADVWm0yxqtQthGKvEhJaqbVZJ\njCCOW3xaktmk618jHEMOX91n29ry29FUfQIAIdB6VAYYtJgai6E9LKQfy5tl\nMnZMRQfwjfsmDKJCHSSSCJvImFz7Psy66ZXLovuMUreFI5t1TE+3LU0xZA7y\nFXXp8vdyYmY5F9//NWaTn1zq2EIVp0YN5zutZyFXAUiYpxC4HVkf+NZ6YBr9\nCrPo7BwyWOfpK3a2L7zi5RLgLKiLUaIk3v+8bDMGKbqIsyljnjq5x8MMYU0Y\nO3q5ek0j2xKfSk0DiNUJKTkfvuyIKG6GvcX8b/g1WNuNv0VSRx5/wVMAUwzZ\nk8fwuz22I5CM3KnBYXYVpxkO5gEuUigZCkXj/lze13OuZ9YJLLeu+BdCxch1\njrmzXogbWLizVMTCFlrGLVfB+ryHOKxGlwt+VOusz7x4EEzvkp3S/j98yCb2\nlRn2kjTuEh6F2HZxX1JqSIoN6Uzx1dW90u1vSB3FRuHr67fibTPKC2bi3+hj\nDYPG\r\n=f8Fw\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBiE0kyS82x0Opi1LD6SDJQv4LShv5seR/CcaI5oPWTKAiA7V8w+nr7PTwirWwV3zcTJKAEEIgGHf47qht7nzoT9TQ=="}]},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.3.1-next.11_1643986248196_0.7062622805628382"},"_hasShrinkwrap":false},"0.3.1-unstable.31":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.3.1-unstable.31","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"^0.2.5","@sphereon/pex":"^1.0.2","@sphereon/ssi-sdk-core":"^0.3.1-unstable.31+d6aa38d","@veramo/core":"3.1.1-next.26","@veramo/utils":"3.1.1-next.26","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.4.0","@veramo/cli":"3.1.1-next.26","@veramo/did-provider-key":"3.1.1-next.26","@veramo/did-resolver":"3.1.1-next.26","did-resolver":"^3.1.5","nock":"^13.2.1","typescript":"^4.5.2"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"d6aa38d017bb30eeb05f5c1d43c28219d682dacc","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authentication request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst createAuthenticationResponse = await agent.getSiopAuthenticationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authentication request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationRequestDetailsResponse = await agent.getSiopAuthenticationRequestDetails({\n  sessionId,\n  verifiedAuthenticationRequest: createAuthenticationResponse,\n  verifiableCredentials: [credential],\n})\n```\n\n### Verify authentication request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthenticationResponse = await agent.verifySiopAuthenticationRequestURI({\n  sessionId,\n  requestURI: createAuthenticationResponse,\n})\n```\n\n### Send authentication response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationResponse = await agent.sendSiopAuthenticationResponse({\n  sessionId,\n  verifiedAuthenticationRequest: verifiedAuthenticationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.3.1-unstable.31","_nodeVersion":"14.18.3","_npmVersion":"lerna/4.0.0/node@v14.18.3+x64 (linux)","dist":{"integrity":"sha512-6VeNxiDRyGMXqMxuRK/TbZBT+OCjTR8za5y7kDXOqYBK6mJwidjpU0SDud6C/Vda6CfFrCASE5lVQV9JxH8fwg==","shasum":"cb8cf13591dd90b89077d5afd5505b47459b9cce","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.3.1-unstable.31.tgz","fileCount":24,"unpackedSize":94626,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJiAjIkCRA9TVsSAnZWagAAVMAP/3fcrCVhiybdrWI87SBi\nIm1iuU+Q/0DYuqApfpEFrYvLSYEYH4YHU9roPF9xRnohX3gcI9II0F9EeAOR\nMX/HRTNSe7PJbpaSL+Jeo5U06lnDKX16xZjHH9cL5GIBFcnytHtY7EvcqxqD\nPlWjdu5S5BIoI9lnwY58swq+FNsFKvOs1EX5Bvvk9MzfKVT/hEOtd1RqGv65\nWQNzXQJnN5JnQ4o5GWowSs2VMxbUUS8OJzVw6VNAJWiSQ7KrjBQTa3oB3R1Z\n5Gib9JHtkmJpOcXqsUcmKTjotEj0UvWMx4dGYSe6EmgYxXCWfQGNJSir/CAy\nakn9Ow6+wtKF0JzXwJJLpz9s/PzoOr3TEQuqWOF6MdJHkEgytWGjuyiZhbaC\nwdHrigyjZVYiZwhwuzRIR8OAOmN29D9P9z5aCnVZkTuivWxGx6cyznn0HmH3\nFkbVdrOlKKsJHdq3U5Nl2z0QHLUFSWfhe6sNaEuHQnp2vtgslpNezbYzQKR3\nlsweOyd/p/qt9Uml5f92qs8ghEqtuchE645XwcM+N32IvhgQZRpcUbWhz387\nZh9fz7O0a5xTve8LZIN/R8Tb6rDivpIFBdrEA2BMcNvRs05Vvhy1AuJTqYGQ\nHGTi4PMTJobN5l3NoHBVDVFinSOXbUCL2vRJwCseLriPuKaVYKdSDsxQvtEY\nxASm\r\n=DZi8\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIF+5qGFEZQP2L6iPJ0D8IhhrXDySC3VAFMy3qSS+XkLOAiAo8rM1fcPolQvPB1iV2XWW7kJBzTBFAVOC0jw3XfpClw=="}]},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.3.1-unstable.31_1644311076401_0.6593554888827293"},"_hasShrinkwrap":false},"0.3.1-unstable.34":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.3.1-unstable.34","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"^0.2.5","@sphereon/pex":"^1.0.2","@sphereon/ssi-sdk-core":"^0.3.1-unstable.34+2388fb7","@veramo/core":"3.1.1-next.26","@veramo/utils":"3.1.1-next.26","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.4.0","@veramo/cli":"3.1.1-next.26","@veramo/did-provider-key":"3.1.1-next.26","@veramo/did-resolver":"3.1.1-next.26","did-resolver":"^3.1.5","nock":"^13.2.1","typescript":"^4.5.2"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"2388fb78d980fca0d200158f4974d1a138b06d15","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authentication request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst createAuthenticationResponse = await agent.getSiopAuthenticationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authentication request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationRequestDetailsResponse = await agent.getSiopAuthenticationRequestDetails({\n  sessionId,\n  verifiedAuthenticationRequest: createAuthenticationResponse,\n  verifiableCredentials: [credential],\n})\n```\n\n### Verify authentication request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthenticationResponse = await agent.verifySiopAuthenticationRequestURI({\n  sessionId,\n  requestURI: createAuthenticationResponse,\n})\n```\n\n### Send authentication response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationResponse = await agent.sendSiopAuthenticationResponse({\n  sessionId,\n  verifiedAuthenticationRequest: verifiedAuthenticationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.3.1-unstable.34","_nodeVersion":"14.18.3","_npmVersion":"lerna/4.0.0/node@v14.18.3+x64 (linux)","dist":{"integrity":"sha512-RPVDn6uZFlsP04muNxHCVWZliWOsLGS6NXFRMAsrYZWLn6vSx3pf8SXqOKS+x9GJhHt1UDTWro2eHlNyZqleEg==","shasum":"44a8312d136a5667a536997b73eaf8a0a1277bad","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.3.1-unstable.34.tgz","fileCount":24,"unpackedSize":94626,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJiAu2oCRA9TVsSAnZWagAAghIP/0sjlnCALaBNhCeuUBg4\n+O9gNJ/AJ2UrkbhfZMYaQeTUISnZ7VszS0tuOOpwl6JbP7vQDkmbx1bGiqpb\n4XMivgMdlMfMJkpeoG1LcAcGuNLFrkKepcbM7eJOxnhOPqYbI2v1X8jbkMjQ\noh8ON5FuJqrme8IdkVMOIRFwSj3ZSUBIKM1F8eRzn23Bug0kzfPUOalEfA2q\n07tIrqzWtW+kDBJj0SIE+Cfp4mG42aj0deRdxp5DP73xORjoCSBO/hO/mObZ\nsLDHDR7B/FKm3J7gPcs4PW5d1l1mvm75SrS/pxv5PbLYBT5kL4Co7fht9hAH\nX1bAFpo7jWX7w9I7YI77fTp/RUg/0Y69GyII3WnZu9Ys8k8KnTcS+vfF7nAo\nzr0xL0DE91YGEIGZSgbyLL4rLD92SHziWRQJc5K1HJR2Ep/V3PARkAPN+sTA\n9K0/vAkZMcrFBw8+m2sXX2LkyxiHxFVBIirCPnLjfnGL+z60vZkHCRVghL14\nZUl5a9huieD34v/no9MELHPlV+G3KFNR3YPA7tF/h85znlAhxUzedi6c/MgO\nMf6nr5pDLspybbDxRv0JbkUChU5UBmAebWKLFoba7eOIuk0nSEnZ+q2WeGvi\nMDV1tsKRmFRD+vhwTFK11+V1DGop4y5Znvv4KcEFRD+J9NNdzzD+tvCJ3S/3\ne2P4\r\n=akDU\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD4RihAsQjl90TyNaM1p7ew5CcRXZLX2RyznBrJg4XeUQIhAISxx8JaRmI1eIoEyiXWCkLAiWjTum6Kzd+0tLMr8zKm"}]},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.3.1-unstable.34_1644359080575_0.2752720837997047"},"_hasShrinkwrap":false},"0.3.2-unstable.30":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.3.2-unstable.30","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"^0.2.5","@sphereon/pex":"^1.0.2","@sphereon/ssi-sdk-core":"^0.3.2-unstable.30+7ae753c","@veramo/core":"3.1.1-next.26","@veramo/utils":"3.1.1-next.26","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.4.0","@veramo/cli":"3.1.1-next.26","@veramo/did-provider-key":"3.1.1-next.26","@veramo/did-resolver":"3.1.1-next.26","did-resolver":"^3.1.5","nock":"^13.2.1","typescript":"^4.5.2"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"7ae753ca78785a3b13f8a84cc4e713a70daf4db2","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authentication request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst createAuthenticationResponse = await agent.getSiopAuthenticationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authentication request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationRequestDetailsResponse = await agent.getSiopAuthenticationRequestDetails({\n  sessionId,\n  verifiedAuthenticationRequest: createAuthenticationResponse,\n  verifiableCredentials: [credential],\n})\n```\n\n### Verify authentication request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthenticationResponse = await agent.verifySiopAuthenticationRequestURI({\n  sessionId,\n  requestURI: createAuthenticationResponse,\n})\n```\n\n### Send authentication response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationResponse = await agent.sendSiopAuthenticationResponse({\n  sessionId,\n  verifiedAuthenticationRequest: verifiedAuthenticationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.3.2-unstable.30","_nodeVersion":"14.18.3","_npmVersion":"lerna/4.0.0/node@v14.18.3+x64 (linux)","dist":{"integrity":"sha512-Q5PMGb/BZN1x4FgWekxp2Wcel/w3hplzoT/sZc6snW4K0H9+kn8X9J4RX2DpDf0TeytbPhTxQCAq0AYP8I6gMg==","shasum":"7d45d3e056f017b9cba72022bcf6b4947c157653","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.3.2-unstable.30.tgz","fileCount":24,"unpackedSize":94626,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJiAu9eCRA9TVsSAnZWagAAzX0P/iuvOqM8R4SlfC267Yfv\nRdLo171Rav/YinYL9VXVmzux2Skdx1T1O2NEu3+imribzigdK+WosOTJ0Ron\nG131xVfkNy6AdBpR+yHEHjHj4ifVSF7Xbgy0NrxaLMup6E39sfQ9XcEAjCkq\nNeaZiDrQdjv+vi/cRJyw9SZ5Wh6Nf8djJVm0tq0moZhBlMdNZEVX8+kDPJUN\nXKeCzie/nZ39WXSGf+CIjp30pXpv+Y+K5Z97GdfLX+x977+B+hMUEZvOaQj6\nZu7POXwHGsoLz2KQjBNasbGpakIWbxrJEsIlyfVaeaIjBhZpj0aV1c3lfzrE\nrVr0bP6O93Nf7Qoe/g2TxjINQi0GrLIW4LHy2sDlBJQTumj09/wAP7P7N97P\noXToDehZp6ntwD7ZKOrdl2ZmobwsZsujE1Xk9v4kGTtQoFn+Mj9KPpIaPZ9B\n7CDJtiHs9la+L98cDYeaU/KXUsULHzN+mKcusnCs3UgvFNGEZU91pE61q3DC\nf5kHsPn3WNLl2Nr7aCrjEn1DAZiOTawYmKFmvh1teG4SSWgXesWgc5cV6dY+\nHkfpiMB5Kom3kbgv4AyQxQzFjQ0RLp9DslR6T1cik909qPaJ5722U1ceENCd\n25PZpSfj345kKi5MKx01OjBYSvCDc16CxlyEfbfAYSUaPq4wPYOZXUr52t6E\nkdf7\r\n=MvXU\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDL/Os28H3k2FrbmReXpI3TDzgIy0et/UPTLm0HQPuXmQIhAMTorbG9rjdlCokzlf5bLBvRdk27A6DTUNht6k7+WsoZ"}]},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.3.2-unstable.30_1644359518791_0.0395377951574436"},"_hasShrinkwrap":false},"0.3.2-unstable.31":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.3.2-unstable.31","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"^0.2.5","@sphereon/pex":"^1.0.2","@sphereon/ssi-sdk-core":"^0.3.2-unstable.31+8cddd9f","@veramo/core":"3.1.1-next.26","@veramo/utils":"3.1.1-next.26","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.4.0","@veramo/cli":"3.1.1-next.26","@veramo/did-provider-key":"3.1.1-next.26","@veramo/did-resolver":"3.1.1-next.26","did-resolver":"^3.1.5","nock":"^13.2.1","typescript":"^4.5.2"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"8cddd9f55912c1b26734214ad5dff2e79921cb79","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authentication request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst createAuthenticationResponse = await agent.getSiopAuthenticationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authentication request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationRequestDetailsResponse = await agent.getSiopAuthenticationRequestDetails({\n  sessionId,\n  verifiedAuthenticationRequest: createAuthenticationResponse,\n  verifiableCredentials: [credential],\n})\n```\n\n### Verify authentication request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthenticationResponse = await agent.verifySiopAuthenticationRequestURI({\n  sessionId,\n  requestURI: createAuthenticationResponse,\n})\n```\n\n### Send authentication response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationResponse = await agent.sendSiopAuthenticationResponse({\n  sessionId,\n  verifiedAuthenticationRequest: verifiedAuthenticationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.3.2-unstable.31","_nodeVersion":"14.19.0","_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","dist":{"integrity":"sha512-JmnXBNuXjOZO0mbEmTUU2uqUQf4TyWphyP17oKpvRpF65PpLYSupFFfPRw8Q9+QjcGqbK7uykwiNso3n2DA2YA==","shasum":"620bc0a9be7ab69837bb94ecac5b1fce98bed72f","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.3.2-unstable.31.tgz","fileCount":24,"unpackedSize":94626,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJiBOFYCRA9TVsSAnZWagAAA4EP/jEbaKUHUekJAmGwF504\nxaXFTmYGbcBlxcD7x7AzMWVYht5L6UPo1b3L6V0miByb8HOIhBSP33LywOyY\n0srORc3uDxutQ8HBbvhkYXCyKzYc1yu7OlFgvsZ5SeVqKMlIanJl1oW74u3t\nRcRU18K+Xg8Jl4dRS7sGK+TnCKODWDKq+Pp4yScXOACnJBaYmhIXTzu+KMGm\nRzsBROlDcjUK8ui8GzKvMBdCJkD7bhOw/o6k0kutra7OvZN+xWiz2q139RBa\nTlHvbY/2Pvu/T18exxQmQ0uAFEVwjAQd8T5FJjgvDbe+er5MaeLHS7stfjkv\nY9CxjHZD6N1gJT1ElanZ5jBEwCZyMDxNiVYwgDwGsUGZ3cFRwix1NCh708Zf\nMT8bHKXX4rLS0iZ8VJ798SdhVkDSTiDjharjiC4i+yoseNhWD/i6rvCjhbLE\nL8W0+Kw1oBzeZMpqpqWwBQpRTBfBuJ6TAKn3Ykp6uxGUeT4RO7OTUOM43dOH\nl9BbR4IzX9lCB53b3rIXLueGEZuoGwdvDJX12Y+7dkXBAu3f2PpLQdiSJ7Ow\nmr8qZYL7XZ6Y/PcmRRbJD2FJ0tjOYbAcp0iv2Idff/REyyTuGqEtqXhOZ1B/\nmMl5GDzxZ12rp5xVqDqP6qzk/cGLWK/dZBJcIufevDJLtLgFhzCPZZl/gmVx\n5o7d\r\n=k6tn\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCID3zqgRsL4nZQbRcY7igzaByhEZU3ZNXIq0rMo78/WmlAiEA86fcqrj8bNVK6NT+Yfh/JsxnO59hqSvsMS/i4+HbCk8="}]},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.3.2-unstable.31_1644487000623_0.6630786180856865"},"_hasShrinkwrap":false},"0.3.2-unstable.33":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.3.2-unstable.33","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"^0.2.5","@sphereon/pex":"^1.0.2","@sphereon/ssi-sdk-core":"^0.3.2-unstable.33+4bb66fd","@veramo/core":"3.1.1-next.26","@veramo/utils":"3.1.1-next.26","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.4.0","@veramo/cli":"3.1.1-next.26","@veramo/did-provider-key":"3.1.1-next.26","@veramo/did-resolver":"3.1.1-next.26","did-resolver":"^3.1.5","nock":"^13.2.1","typescript":"^4.5.2"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"4bb66fd221c490d6b6b76ea5f080940da4805a05","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authentication request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst createAuthenticationResponse = await agent.getSiopAuthenticationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authentication request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationRequestDetailsResponse = await agent.getSiopAuthenticationRequestDetails({\n  sessionId,\n  verifiedAuthenticationRequest: createAuthenticationResponse,\n  verifiableCredentials: [credential],\n})\n```\n\n### Verify authentication request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthenticationResponse = await agent.verifySiopAuthenticationRequestURI({\n  sessionId,\n  requestURI: createAuthenticationResponse,\n})\n```\n\n### Send authentication response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationResponse = await agent.sendSiopAuthenticationResponse({\n  sessionId,\n  verifiedAuthenticationRequest: verifiedAuthenticationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.3.2-unstable.33","_nodeVersion":"14.19.0","_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","dist":{"integrity":"sha512-DIm2pBtKqLZfbJuyTyPct6IO6xJzA0k8Fz8jdLi1LzBHX0IDzD0aUfZvIjZghGKERggHOg+fq+/HXo3wPD8QLg==","shasum":"5377af74b470709a1bff5bd91a23bdd99c3617c1","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.3.2-unstable.33.tgz","fileCount":24,"unpackedSize":94626,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJiBO2qCRA9TVsSAnZWagAAlToQAJ7u+ToYU/EjiRy5U+g7\n1nHDXwRZbAPfc3hbzBzO/awlmwji2nh5memVl68EV3Qu3u3o2XIXB7sNGJdD\nnzeD8DrktzU56KLOsIdvBLzQskHEWyZ6lzHiB2E+7bnDMIuKG+IbBxsgFZER\nTTFY4ZRFmJI7fBmqkk+SEIRKcLODGcXy4ZNlkfqAuI38k1cT30cicqFMViSC\nbVmoKzDzgJ//ERrG5WsNf5KJcDhONFLP2T7FaHAROCJTHf3wcE2/HMOiJxYj\nBQuwwT7mqX1pbkUzcWjcaYImjkzCGxklAJM7sWRytkuGPBS9sqUOSXXDfp8c\n20jbZ10geVfYWCRH9jMUQacWbGMtExyvQ7+GRGxT1L04GsmJOFyCS0lbMvnb\nFVRBQXEXgBkk74Oc4fqiEfeXe4v/xTSoaFnR4tDcbc8DNpoqE2nalaQuV3D2\nNP/HUCWUFa6wOzLsNOhbdbyr9tAxIjTpRMidkrGyHSMP79JjMzXvbH1MjYzp\np25lPejDWkqVaY56D9fcdY/RpGZhVVzFn2v8OW88bv8mbPZXlhsYpIbN1atw\ncHHBDG9ZKX5NVPICPg90UjBITsrXfRi74+91bvvNEw22LvOLj4Hjb4b5pGGw\n78flESOiR1cvuEt1nj/bWxd0tqa/9qfruKENY2KLNj1vX/O23nGVPsi3jxPf\neRfP\r\n=Dd0C\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHoNpvHDFO/ux2iUVlYp4gltUM6rzBdua+yVFGX9oxNOAiAO4/XGS3jVuOA4J4ZAawQx9BUqcbk/1tZN/7kUA1/PUg=="}]},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.3.2-unstable.33_1644490154519_0.6109364004388027"},"_hasShrinkwrap":false},"0.3.2-unstable.34":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.3.2-unstable.34","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"^0.2.5","@sphereon/pex":"^1.0.2","@sphereon/ssi-sdk-core":"^0.3.2-unstable.34+4a2fdef","@veramo/core":"3.1.1-next.26","@veramo/utils":"3.1.1-next.26","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.4.0","@veramo/cli":"3.1.1-next.26","@veramo/did-provider-key":"3.1.1-next.26","@veramo/did-resolver":"3.1.1-next.26","did-resolver":"^3.1.5","nock":"^13.2.1","typescript":"^4.5.2"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"4a2fdefa54170b0209810d54cef0ad361fb5aaf7","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authentication request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst createAuthenticationResponse = await agent.getSiopAuthenticationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authentication request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationRequestDetailsResponse = await agent.getSiopAuthenticationRequestDetails({\n  sessionId,\n  verifiedAuthenticationRequest: createAuthenticationResponse,\n  verifiableCredentials: [credential],\n})\n```\n\n### Verify authentication request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthenticationResponse = await agent.verifySiopAuthenticationRequestURI({\n  sessionId,\n  requestURI: createAuthenticationResponse,\n})\n```\n\n### Send authentication response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationResponse = await agent.sendSiopAuthenticationResponse({\n  sessionId,\n  verifiedAuthenticationRequest: verifiedAuthenticationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.3.2-unstable.34","_nodeVersion":"14.19.0","_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","dist":{"integrity":"sha512-g6oHCDmXm4iI7I7JrarY4LbIB5K5AGjLooh5vJXw7n9iOSq5X0+uSdTeOdBrQOqwNSOxawANi3+2mkSO4u7hQQ==","shasum":"30cb383468ccaf42904b64ce3f1cb8efec4eefb1","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.3.2-unstable.34.tgz","fileCount":24,"unpackedSize":94626,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJiBPX0CRA9TVsSAnZWagAAuyQP/RJhLM2Vc3lrRc7IFWjx\nrwY9vXnhB48pmkI0du793Ea+JFJxi0jo4acSw6YefIgSVAQi+y94lK0HhLgF\nvy2/QFAXAXkqUWi6e9Du7sP3ivHtG8r8LyfyPhzlJegycSjFuxBri/+hn38f\n95yCicgDwUQh5ftkGeR1b7/sZ1eMkDbN294QhhvP1GsUF/mkSLKdPVsPQuV2\nsHE8vuzn1Zr8pfy7ammUTKapjLynUhYzmNL7J8xs8/ilC0K+W7ysQfvKhuA6\nl8LG5w/adc7nUY3EW2g8oFOWUXdRoLKmQ/YpPxZEFbAh2BoXfOJDrw/VbEQi\nBwlHdpgYnI3hcLUhjQBjA7kXBlS9A7nvfYxC3+AtYoFUSR51LqDZi7O/fexz\n3uaX7pay2qgHFhxBCAH8Ap1bFzEFtC4hHPscrUHR5Fu8P+B7+03knxrXwkqs\nh5twd3vazlQyN5ww5zxHZeJJ4yeMpZafBF20O9KRdZzWveuPFmHvtIWjXQ5J\nEFghhnRxTNleNraGc6mGMMTL31A0wPRf4pfARjdWo3mmjU8lLaHq4BFq7L+e\nyRImZ83oEEeWnUvy7jdPMtCVZprcsFh/yctOkpPFRj5eZipgYHtmWAIIJQVj\nRGhvv6cO+MFRYL6A/ycyCO2Q+fOVoksmnS2yTFe085c4iNMGTboBbKEDUfFf\n/Fuf\r\n=dv3B\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDEqTv26RvZ0s910Rd4yF+7Gc6oNNgXPYHPgYlV5qrPYQIgTM7Kb0gwUvFszcnaKfrNrQjwS3s6e4zz9mN0warpaR4="}]},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.3.2-unstable.34_1644492276473_0.0019394585671406173"},"_hasShrinkwrap":false},"0.3.2-unstable.35":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.3.2-unstable.35","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"^0.2.5","@sphereon/pex":"^1.0.2","@sphereon/ssi-sdk-core":"^0.3.2-unstable.35+6e693e5","@veramo/core":"3.1.1-next.26","@veramo/utils":"3.1.1-next.26","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.4.0","@veramo/cli":"3.1.1-next.26","@veramo/did-provider-key":"3.1.1-next.26","@veramo/did-resolver":"3.1.1-next.26","did-resolver":"^3.1.5","nock":"^13.2.1","typescript":"^4.5.2"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"6e693e526f040c0c0d1cf9a94a1118ead482c00f","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authentication request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst createAuthenticationResponse = await agent.getSiopAuthenticationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authentication request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationRequestDetailsResponse = await agent.getSiopAuthenticationRequestDetails({\n  sessionId,\n  verifiedAuthenticationRequest: createAuthenticationResponse,\n  verifiableCredentials: [credential],\n})\n```\n\n### Verify authentication request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthenticationResponse = await agent.verifySiopAuthenticationRequestURI({\n  sessionId,\n  requestURI: createAuthenticationResponse,\n})\n```\n\n### Send authentication response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationResponse = await agent.sendSiopAuthenticationResponse({\n  sessionId,\n  verifiedAuthenticationRequest: verifiedAuthenticationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.3.2-unstable.35","_nodeVersion":"14.19.0","_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","dist":{"integrity":"sha512-xyVihUbficrOjPCToo/cZIbZF67w7TtDcNrkEbo33hGnxUzxFdQDcTnSYgGVjUNgpqvWBNw2FB3gY8ioYvYmRA==","shasum":"7f324af577d33adeb52ef6e246dd2e1ae8baa7c4","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.3.2-unstable.35.tgz","fileCount":24,"unpackedSize":94626,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJiBQmgCRA9TVsSAnZWagAAZhYP/2cKd1v/aGZaaNWjWzOD\nb2GWrL6JyQJs+MsTnaT6rwYPA3txqFc89kSBJUmbfAqPe1car1fEhiloumVD\n9CzdnOYOWWiAmkA54Uc8Kqo8MwOH0wNbLV+bTK002Sf5fepoVzHESsaRLAJg\nKydfbyceNQbi6o26gK2HQQLlJ29q7J0lLV0mxOv8QLWLNqEOB2Ikq6yF4XMX\nV1ZuWwK79y5ZYMJdPHpkRe+Q42Thm10emdHZcttWIjWSkkaI0eX3Jvp+uanG\n2MdiL3fChjYXHXUraQCM6RnbMuFpXwB36j+taRVP2gLynPcjVJ5O4iJy50It\n7d6daaVK07gQCp06kiSglMLbLsss/X/qGSXNSo8dtN7bVHa+/fPGOKLhD/jY\nz/CRtIq9t7K/Csv6xGYhPDwx8hxkBoJ6wjrVdtrtnD0W1LhDJhkHG7LXGowS\nhiBqj2hBPbuFTh59XMQQ8lcyQvTO9zP3DntLNRzzpkzhBjhgrYt67P5Q9GUC\nrQjDCo9x/Iy+BtSlrm043Tknv4kAQ9DISRQ7ej4zNMe09Dx+/rebZbT0/ac2\nhgxUm0uTxLJ4XQJBjpZggRLVmiNN6uVrjiTJdS9FEi9FqeKeQcjs1836rL4P\nN30sOTI69oQbPCBKTc/4ZUcBAFax6PAHP/Yd781m88c8Lyh/YJVxjQqCqJM5\neDuW\r\n=5fYM\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBR8xeJ64OJ/xAivYXM4142hWQGEjamspr/CC4552dSuAiEAnAujEZbXc3KwvSMPnKHNgeXnrNfpnrXEJFZqIARaO8I="}]},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.3.2-unstable.35_1644497312050_0.9643987038386661"},"_hasShrinkwrap":false},"0.3.2-unstable.36":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.3.2-unstable.36","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"^0.2.5","@sphereon/pex":"^1.0.2","@sphereon/ssi-sdk-core":"^0.3.2-unstable.36+84793a3","@veramo/core":"3.1.1-next.26","@veramo/utils":"3.1.1-next.26","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.4.0","@veramo/cli":"3.1.1-next.26","@veramo/did-provider-key":"3.1.1-next.26","@veramo/did-resolver":"3.1.1-next.26","did-resolver":"^3.1.5","nock":"^13.2.1","typescript":"^4.5.2"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"84793a3d507957d3f1c066ded197f159c5fe4cc6","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authentication request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst createAuthenticationResponse = await agent.getSiopAuthenticationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authentication request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationRequestDetailsResponse = await agent.getSiopAuthenticationRequestDetails({\n  sessionId,\n  verifiedAuthenticationRequest: createAuthenticationResponse,\n  verifiableCredentials: [credential],\n})\n```\n\n### Verify authentication request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthenticationResponse = await agent.verifySiopAuthenticationRequestURI({\n  sessionId,\n  requestURI: createAuthenticationResponse,\n})\n```\n\n### Send authentication response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationResponse = await agent.sendSiopAuthenticationResponse({\n  sessionId,\n  verifiedAuthenticationRequest: verifiedAuthenticationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.3.2-unstable.36","_nodeVersion":"14.19.0","_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","dist":{"integrity":"sha512-lT0bkM7/GUNpSnrPNmXXOcdHtsDaX6VpYwwNsBWDSImramqpwZEYCHuQynxS8VbvPXYj4WbUOz1p/MbOQbTuWg==","shasum":"7cc66a438a2998347e8354312ccc6320f08722bf","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.3.2-unstable.36.tgz","fileCount":24,"unpackedSize":94626,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJiBTMJCRA9TVsSAnZWagAAwrAP/ieGOecfkZO9ZrxQEWJr\nINx5r2E8/zUa9mlrDKqdwd40KJK/0PVj+o2e2001TZgNP41wKoDZK2nmXy/v\n30qO6JX+YAnDMXr0L+a6/4Kkhf5nGn/CiXPihNG5jjukQ2KYT/koruCOMfwQ\nJ02A6XxhLTFbAVm3VCYiSj6wqYv54srQ/A0KwhJDqPbPVW3Dgrog6CX5qRB2\nGY5JbEbFHtrkUEBIoisyzdpBQFQbvFytkgnjxvNJP55+M2jvcLMfBgRHHU4a\n2ijLCZhCNtb+hxloZvdNzGnWqB3ha/sQIna1xz4j1MrrgLGZeQUSi4+B3gHm\nQXEQBGtVVxSNrrbmJ93XxsbjuC+CbtvuNIKU38utfE2T8pW7ys8arhJRw7Nr\ndiu6sZf544Oh2W8BHRqVJnOxfHcbNsuOr4dPB1vGIieagRv+QXXonvpnCIHY\nizQyu0MmCPayRlJKV0eG2EqO9C6CpSoczHR9dFbZxyEiCUg3M4dZTJbUhJeR\nptNW6+OQ0T1NfwH7um4ufTloj9z94+96WCwcRA6hx6H5xZ2LPsTqEdpl3Hgu\n8oA2/eVNAxfE6P+Xg6EXJRFKQCO6Svrz3tOqwxJ7SxSJaB3RtyKs/lYHiyjT\n4NmilYi0o5paCrPr5hxYAgOGPtCDDFQJxAXGoc4/5w9bt2DdrNmiCXSyeAGl\nhZFw\r\n=P9Al\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDTTrapt/zr8lL5xJ2B2cNXFIAiAuvJpjezwOk5Bhmp9wIhAIOrUmFdWQgV8GhKJVgy3NvPwwmGn9YquO3uW8Grow3j"}]},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.3.2-unstable.36_1644507913003_0.34055635356761105"},"_hasShrinkwrap":false},"0.3.2-unstable.37":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.3.2-unstable.37","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"^0.2.5","@sphereon/pex":"^1.0.2","@sphereon/ssi-sdk-core":"^0.3.2-unstable.37+2aefa72","@veramo/core":"3.1.1-next.26","@veramo/utils":"3.1.1-next.26","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.4.0","@veramo/cli":"3.1.1-next.26","@veramo/did-provider-key":"3.1.1-next.26","@veramo/did-resolver":"3.1.1-next.26","did-resolver":"^3.1.5","nock":"^13.2.1","typescript":"^4.5.2"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"2aefa7244b1be0c662e5287273e9dea6a16669cc","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authentication request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst createAuthenticationResponse = await agent.getSiopAuthenticationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authentication request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationRequestDetailsResponse = await agent.getSiopAuthenticationRequestDetails({\n  sessionId,\n  verifiedAuthenticationRequest: createAuthenticationResponse,\n  verifiableCredentials: [credential],\n})\n```\n\n### Verify authentication request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthenticationResponse = await agent.verifySiopAuthenticationRequestURI({\n  sessionId,\n  requestURI: createAuthenticationResponse,\n})\n```\n\n### Send authentication response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationResponse = await agent.sendSiopAuthenticationResponse({\n  sessionId,\n  verifiedAuthenticationRequest: verifiedAuthenticationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.3.2-unstable.37","_nodeVersion":"14.19.0","_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","dist":{"integrity":"sha512-AkfXFMLHdyhktkrzsOPqcw9lDkaWDDLuaQzaxKtR6VnjUs1qKmyG4GZQqo5R10Q/zvRBNtiEdqN/tQLJxxJB4A==","shasum":"2c8f98eae0c7e8709f8eebf57d8b425ae0788994","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.3.2-unstable.37.tgz","fileCount":24,"unpackedSize":94626,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJiBXKfCRA9TVsSAnZWagAAgyMP/ivSfYtz3FffA7r6SZFn\ne160bfpUmpQaLBlCoszeR957RKzVGDC0qkXCdrpDFyegRV4W1EbOJH7hP5jt\nHZiHpIbZ88rU/H5WtFg6hcooPQHHt88dPtE2UXXq3Ty81YB78kuUavUF/eft\n8cEh3zEDEs7OC2Oo8xm39nS4rnVuwpWFwRpjRF5sOQULZvArKlZVX6U4EIkg\nZBtLF0+g9gSxgmxQ9JciJnQO1z3ajtEHTXcjRmP1DXGjM9y8M278EgjnFY2a\nySlTsq2KnWaLi0xl8+4DmyrWIyY3xjOeVKkGCVOTugp0Kla3hQkWOFcW+GzE\nBByVjtc4LToydKu6ML2qL9EKb5ey27xG4nIfnyJCxHotDvG9lLvJEFRmeMSS\nwUX76OmOOr/h/F1TAjgwDhtXN4BRKRr94vfWSVk2F8uH0K3Sol6Oe1t5PTxx\n/46zeSmX6FKAsJS6TmyyHRn5zLCodWUg0m7ANWl3hCtWq5tkZ3AiBLUwBJRm\n+yagmPGIl+0hPzMP77eg3FQBvr/T+Ef7GwnV2Wh2UVKzuC4NgvSVZhdoiFpg\nZ5v2ewaQSmoBX6JURCZYq74ql31ZcalFeHUmh623vRn29dg5pxJZLjxLXYWh\n3zsIAQJ+n4Vtvyzr4ziiFV28SzjRicmm3V43WBAyXb9hCxYTpFADVQr+Pfv4\nh2WU\r\n=WnaT\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDjPMCcsAUFUiwCJm8Sgvx/8CwKwduotPmeHA3qfQYmSwIhAJs7lJ0JYYZcwxnUhMEyPA1XQe1W9sbry29bgbbuQRfq"}]},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.3.2-unstable.37_1644524191164_0.22891862438862454"},"_hasShrinkwrap":false},"0.3.4-next.15":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.3.4-next.15","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"0.2.7","@sphereon/pex":"^1.0.2","@sphereon/ssi-sdk-core":"^0.3.4-next.15+59b54b9","@veramo/core":"3.1.1-next.26","@veramo/utils":"3.1.1-next.26","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.4.0","@veramo/cli":"3.1.1-next.26","@veramo/did-provider-key":"3.1.1-next.26","@veramo/did-resolver":"3.1.1-next.26","did-resolver":"^3.1.5","nock":"^13.2.1","typescript":"^4.5.2"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"59b54b99e0375c336d8bdd652e1fb4922bd6cbaf","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authentication request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst createAuthenticationResponse = await agent.getSiopAuthenticationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authentication request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationRequestDetailsResponse = await agent.getSiopAuthenticationRequestDetails({\n  sessionId,\n  verifiedAuthenticationRequest: createAuthenticationResponse,\n  verifiableCredentials: [credential],\n})\n```\n\n### Verify authentication request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthenticationResponse = await agent.verifySiopAuthenticationRequestURI({\n  sessionId,\n  requestURI: createAuthenticationResponse,\n})\n```\n\n### Send authentication response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationResponse = await agent.sendSiopAuthenticationResponse({\n  sessionId,\n  verifiedAuthenticationRequest: verifiedAuthenticationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.3.4-next.15","_nodeVersion":"14.19.0","_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","dist":{"integrity":"sha512-gjagubv+XKpongdMdE/K2nsdWynZfXLdbqrCbqiKTjQaDbdqAoWcDe9eJO860YnZkHCCkLY02OWo3NXdrekBOA==","shasum":"92831dbca21d83b84d634583cffd512fc023ce3d","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.3.4-next.15.tgz","fileCount":24,"unpackedSize":95230,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJiBaTOCRA9TVsSAnZWagAAI0cP/A3m+eXyzZPgYohMsChh\nR1yM7o5xXynrlSGIHojX9N6hynjvvGt3il6u8av6go3Gd5ipW2SkIA8/U++/\nAcKlLXRV1Dhvu6lRanXwqhU/PIcQmi7HB2uBUJK2vy0pXfTcJ/godEM78XZy\nHaEnFCbEKUF+0TrF+B1ZNGuTYNyuA+VJTA/uckl55eTHGiYkbfudQ4MiykwI\nofMvgXXAZWMB4mJW9URIe4AGLcE4lStE3ny1RlPahnlLTL5tdY3MJ9YJWG5v\nu09/7sKF1PwSvgcFMyirai44UIxm1AWC/7SXY0TZOvFCTLILUhleE5spjiCk\nqhkc5J6JMn1FvB8m0bvKwCjGTb30MIxyEP7gL863/pqOAG8GuFIf3hgoquKB\nWqVK8q8m7X8/QD4czZX6znFF5S+q0D/SgaO4KFms5oOdFHPiOd7hYDdCCN2t\nxK6kFsEm0ZFt8U5t6cCzKJQGTsazGH6LcEJVfLmv2FeIIWIrbgcn+gc4DuiI\nAYncCERp/W1YyhRvYKfUcjPbAamYwM28pXsdpDOWcJISXLg2gIZRqGr98Bok\nV9IiQVvpUe1L7QILwmRv4Idk+J4HPp9cFpB02sKIoTWY9CQ6BXPKSO6WcH3+\nJSW7HAVp4K2AuVF5KJuQnBP7MM9RmwMTrl2SfRV/3fTS1h3TskH7BQ2iE8TA\nCW5N\r\n=vQNa\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCkB/OQM7BSYmrM18nRYKipysr2IMdHGCEPPZKp4fg3TAIgfG7DO8GB748p2pkPI84tTO9JlziUFrT+4zBTAO4SRtc="}]},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.3.4-next.15_1644537037876_0.6243917172283833"},"_hasShrinkwrap":false},"0.3.4":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.3.4","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"0.2.7","@sphereon/pex":"^1.0.2","@sphereon/ssi-sdk-core":"^0.3.4","@veramo/core":"3.1.1-next.26","@veramo/utils":"3.1.1-next.26","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.4.0","@veramo/cli":"3.1.1-next.26","@veramo/did-provider-key":"3.1.1-next.26","@veramo/did-resolver":"3.1.1-next.26","did-resolver":"^3.1.5","nock":"^13.2.1","typescript":"^4.5.2"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"f56ffc2e5f224525bbde5dfcf70e362927d0613e","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.3.4","_nodeVersion":"14.19.0","_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","dist":{"integrity":"sha512-yGtWdnxlC7j8Y/+DQ+HWBYVMYDnz4BgphaI4fKr37hY/Qbodxan5luilzAFpB707f9jJ0oEso1FvKiCYIQ6RTg==","shasum":"8f45e99e61a6f78cb8259b0d40b9594f3f831461","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.3.4.tgz","fileCount":24,"unpackedSize":95198,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJiBagdCRA9TVsSAnZWagAAUqAP/33ujsMVYuffDHOzXYi7\nRUHrtBwMDbPlxcyK8eIxTiUszv1gYClFZTOH8nsRGslQEmHYnvT8g3WlEV/n\nTdBXSK0wPGwmeFjjP0+qClJWU7HaTAFLMJo4S4jFXdz0deyVYbYf6pDOLxxE\nb5AvZKaF1l6lrdWBjqXr6i7d7L5MOioikYIvjRp4hPoJYLhpd4XoELoSpBgq\nRP8IjX4WVAkGocLYOaPQ6WQ29tl6y1MRTlRgjUWM7SwFuIHAV5TH5EaEKF92\npSruWcXE5mv6cIkqUYf1+g53AUx+Rg+Amflz/9Y1YTegxcR+s1gXPFQNasru\n9X1ljK7zGokET6hVahDguVIHQM7RaFnGoCvPzY9JjgWSXLMBMs0TQ/pTagXo\nXy3NQ/Fq4J6WpiwfgNHTv1GVzdaT2o/AKjFS62zPniY1NiBHAFsflm8cSbY/\n3cuKbousKyk8w6mVdruoDCvqIbKT+aUWJ+tPlG6hQiEqRlj0TgZ4yhRHk7n1\nJBLwdE7pMGAFWId0Rt7mGmUd9UUPv0/sWzGv9BbiyLzD64ROs7BnSFamTgYL\n5wQgjI/cdXG60o0kiCp2eFtPgcpRlnP9l45EYLig1ATSfIHHLEcsqC7oBMTC\nVgRU7jHd2uE+c3IZ6ca/dnN52//Z0KCczN4GxjTe07tfIMi9slFSnzhKN5wx\nTbbi\r\n=RSE3\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD9vZ7FFoe9wLPFyykzkIRXNBtRJxFXm4c4GV6+0CEDAwIgTq2zcJoBWcH3bgdPXHmRoTbCMYKbcUlWu+IgRxU+EyM="}]},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.3.4_1644537885085_0.14764803652293068"},"_hasShrinkwrap":false},"0.3.5-next.3":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.3.5-next.3","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"0.2.7","@sphereon/pex":"^1.0.2","@sphereon/ssi-sdk-core":"^0.3.5-next.3+7b6e50a","@veramo/core":"3.1.1-next.26","@veramo/utils":"3.1.1-next.26","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.4.0","@veramo/cli":"3.1.1-next.26","@veramo/did-provider-key":"3.1.1-next.26","@veramo/did-resolver":"3.1.1-next.26","did-resolver":"^3.1.5","nock":"^13.2.1","typescript":"^4.5.2"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"7b6e50a1aa15ad47b3403457eb0d1b2864c2babe","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authentication request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst createAuthenticationResponse = await agent.getSiopAuthenticationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authentication request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationRequestDetailsResponse = await agent.getSiopAuthenticationRequestDetails({\n  sessionId,\n  verifiedAuthenticationRequest: createAuthenticationResponse,\n  verifiableCredentials: [credential],\n})\n```\n\n### Verify authentication request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthenticationResponse = await agent.verifySiopAuthenticationRequestURI({\n  sessionId,\n  requestURI: createAuthenticationResponse,\n})\n```\n\n### Send authentication response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationResponse = await agent.sendSiopAuthenticationResponse({\n  sessionId,\n  verifiedAuthenticationRequest: verifiedAuthenticationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.3.5-next.3","_nodeVersion":"14.19.0","_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","dist":{"integrity":"sha512-nlv6QM7CSAaxcrkTpJeHlriaJtQhQxD7SBL+QE2TMC//UugaR8BW+jxCh58eZk13DwjzD8zEAx3BZLr7dz+myA==","shasum":"a7de1c06f61b86f01c5bf1228ac7dc59db7c11d6","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.3.5-next.3.tgz","fileCount":24,"unpackedSize":95228,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJiBan6CRA9TVsSAnZWagAAKjMP/1zn2Ie1bq/avhKuyBvW\n7AF5JU6IEbaQQ2fqn8ZvnqWpxG4LoiCQGYayXBMRbsbii3SkN+k1Ks7PlV28\nru8ulRfmv18fQIWA+8cjK9m5y1bxUEpxbcyzQa9aVDsW1ZsAPS3kXjLLh+Py\nNojmygJIXDH+97PAdJV0sn6XbneX/6Tw9NoDYqkhqG7rQh1Uy7l1Sh+oQ0D2\nXktW6uSFavqDdlHf+mjZD0TRWvVlnrA/+VjwZtUPzq0UflSu/QWE3KX+fcJ3\nZEMO652w5TnZmO+wOuOLpPdOQvmSUY3738qoSBi0SWidIEeLWJmYZFnCDKnU\nzAggDplD27JC+ijeMPm7nJk1vN9mBxB2zJvn+VnyHO7L9BrPISecfL1+zOK/\nPFHZDTNvnNAsNpyov2qtHBp8TD85FyFSiXzelC2A9PGrG0pdJeIbj0EhGzqn\nuv+2zvqIEsy75oPRyrT1RW/KTWTW16FHiSqU4Uz0aex7dGGF8EUUam4nK6Tz\nz4ClMTQe+xo29v6oDQyG0DBGBCtYUsyLRvmXzv2h+bY5iOJiph54gy5j0H4v\nongCN9NQYS8rhC8UiAHktb06qH548g3gT3t1UEpMFpGaeMQGmsta2NVaP7gy\n+RlvKhCNMEp8N0n0zDcM111RvDDOPTrnY74+2Ipzl/90Ma+4g2iKqUr0n+YR\n62Gt\r\n=JJ8A\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDlXmTwoDTYX0bF9NpzdjuSdxrqa+FdQL6tuSBu/WxZ2AiEAoi3ny6Edb8oAqe/bLfcHGA2894LHMZYty9Jc6ng+ESg="}]},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.3.5-next.3_1644538362871_0.008818087259291119"},"_hasShrinkwrap":false},"0.3.5-unstable.44":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.3.5-unstable.44","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"0.2.7","@sphereon/pex":"^1.0.2","@sphereon/ssi-sdk-core":"^0.3.5-unstable.44+7850e34","@veramo/core":"3.1.1-next.26","@veramo/utils":"3.1.1-next.26","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.4.0","@veramo/cli":"3.1.1-next.26","@veramo/did-provider-key":"3.1.1-next.26","@veramo/did-resolver":"3.1.1-next.26","did-resolver":"^3.1.5","nock":"^13.2.1","typescript":"^4.5.2"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"7850e34ad2af58f62523a2346826d12280216d31","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authentication request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst createAuthenticationResponse = await agent.getSiopAuthenticationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authentication request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationRequestDetailsResponse = await agent.getSiopAuthenticationRequestDetails({\n  sessionId,\n  verifiedAuthenticationRequest: createAuthenticationResponse,\n  verifiableCredentials: [credential],\n})\n```\n\n### Verify authentication request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthenticationResponse = await agent.verifySiopAuthenticationRequestURI({\n  sessionId,\n  requestURI: createAuthenticationResponse,\n})\n```\n\n### Send authentication response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationResponse = await agent.sendSiopAuthenticationResponse({\n  sessionId,\n  verifiedAuthenticationRequest: verifiedAuthenticationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.3.5-unstable.44","_nodeVersion":"14.19.0","_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","dist":{"integrity":"sha512-2tR2fAsTFt8tEsCXVjXwgYz6OPkLKsfxAVwtSK2xN2wNEjME2l6vKcr1RoR4TuCo0mZhsxrusWaN2voJ1xl7Rw==","shasum":"fa1de133cf6411296b187ebc539e376a8d1a2ee2","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.3.5-unstable.44.tgz","fileCount":24,"unpackedSize":95238,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJiBcDLCRA9TVsSAnZWagAArUcP/ArN5wK3wwTx4xwm5o8O\nKHCUqq/kPPsWXh3dP4y9GwaLdUGeMUrXQLY5mVi9GlexR2RnlV9NVQjircb5\no1wsip/vxIHIdz3rdOUQDsYG/j8i0h1nJqY6zsnx9Yg+BOAXNuO80s7fxuGR\nxrscTAl7RlkxBZzrTPC56iSpzt4sEu9YYspBeCW3qxbXMO7Nz1lv0bKeGwgI\nSU9f9GOVyHaeQj38arG2M6kouOXWxFP644cuYwL5/V5H6dcR7wQ8f+oDsZZ+\npCZJWnnAmQ+sGT8f3tj+084lfe8Pp7dxtt+GhQem/W2egdxCqNqLn19LuXJ1\nrIus3HSQaBmnGENWW0bgoREUSG28Hy2Klj+/O8iuyj3WROTHLSjoHbAIYrZ+\nsEwacQmlFZF+qZ2YavenyAaXtTs2CcLzJ6F7KGxYuThvkYm04QgVdXSKfLaQ\nP3XlswolKzVUD3gPYmWNuJmjXbKBWEh/AX9oWHBPm7WtYE/Izkxvp8UPMNLd\nPZeZndyoWN+CPIZc2heAhpE/R7jw1F5TFzCEN9AH1PmDvtmOUKe0JKYNuuKy\n00UlPylzuHLN/Pn2FJE3Qp2y2MQsaaju3KH1Yq+QvssgCpsV/S5+INx1F9fm\nXkfZR9DOSx/unzqHb/UebPY6KZ5RUFM/3wKafioN4IUO9dSO9Djb2xkwcKJh\nkdHx\r\n=/492\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIArx420wo7ofgImvO8Uf1dGOT/tc0LxhjeNwX6iSiyFbAiAXIZBPnk31rj5v9wBumBezCxiZd13cUArYTU51sd8+yw=="}]},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.3.5-unstable.44_1644544203596_0.4339708993722331"},"_hasShrinkwrap":false},"0.3.5-unstable.45":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.3.5-unstable.45","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"0.2.7","@sphereon/pex":"^1.0.2","@sphereon/ssi-sdk-core":"^0.3.5-unstable.45+040014a","@veramo/core":"3.1.1-next.26","@veramo/utils":"3.1.1-next.26","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.4.0","@veramo/cli":"3.1.1-next.26","@veramo/did-provider-key":"3.1.1-next.26","@veramo/did-resolver":"3.1.1-next.26","did-resolver":"^3.1.5","nock":"^13.2.1","typescript":"^4.5.2"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"040014a84e7111e80819a68302ab68855a9a6ba5","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authentication request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst createAuthenticationResponse = await agent.getSiopAuthenticationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authentication request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationRequestDetailsResponse = await agent.getSiopAuthenticationRequestDetails({\n  sessionId,\n  verifiedAuthenticationRequest: createAuthenticationResponse,\n  verifiableCredentials: [credential],\n})\n```\n\n### Verify authentication request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthenticationResponse = await agent.verifySiopAuthenticationRequestURI({\n  sessionId,\n  requestURI: createAuthenticationResponse,\n})\n```\n\n### Send authentication response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationResponse = await agent.sendSiopAuthenticationResponse({\n  sessionId,\n  verifiedAuthenticationRequest: verifiedAuthenticationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.3.5-unstable.45","_nodeVersion":"14.19.0","_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","dist":{"integrity":"sha512-Mhd3V+zLJlva0dpNBgEt12oIag3dUyXvLaiuF6v+mR4Q4v4fc59ViFYn/Iq7p4yhsoFbkfcfIK8i9feimiYOkg==","shasum":"596fe8cdc5937ead19b2c28a74d94ef2870a8d69","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.3.5-unstable.45.tgz","fileCount":24,"unpackedSize":95238,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJiBcGNCRA9TVsSAnZWagAAavUP/iFQZi3msYo2rYeusfLM\nx3dTbjNg3yBy3/ayInF2XLEEt+UWoL2L2RAAVx+geu+BK91mKOZ3XMdoZsZo\n0QKMBO+AdBM0T5NJaeRxi03z2FyV6ljLNWvJoKAiu0QF6pXfb9DmS8n+HCJ/\nQjah3RErc12LijP2lbIXkgbhs01VcLrw5WgqVUmUQqww6uS+Bsc8GoImIcFn\nT9K0jkiARxl3YZ/jSAMPVRRuczDhb2gA2PvUO25DB7mXVTTba03bcY1SHwPd\noPGsxnPa/Lg1z6YismmQ45pebWJCekSAkMpNv7WqF+RJe7yRanKp3+Kb+F/B\nPMtKsuwbYk+dfXFrcAlXIO7QKQhzktmYHhv7Px6COTis1bNCU/Gd3SIo3z14\n9OhI608zrxDu53T9VsDPdXckyBg0B9ui+xTgFP/C3yj4FG9KRbOovbb+deMb\nGYgYlkO/GMHp7HaayyGjmLuVVYYSA0N7V9zgEHzAYB15oUO+zeilx5c3DclC\nt0l5QT214nXBEnzG7Vm/rUzIHBtzSNdGajOZzfTw4fwBgi3lsbCQOVDKZhmk\n9mdBKeE94QAhleFFEijNtnv2t/tgWf6Jgo7HyqNliTnI/zyyFXBauJ9ynlnm\nL3cU5oeOltrk/tH0Bzie2eqOJlB7VuvMKNFWxyzSIsxCUMoCqxjCAPTRpAND\nxKO/\r\n=KSCe\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDAJWzcVwRoLZ3zxni4VLazP/YCUR0n/fyAUmQTwlvYvAIhAKBmz2QdqaqtIoX7dPl/073p7CWU2q87tMvCXqLDM+Wn"}]},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.3.5-unstable.45_1644544397298_0.5555069398576398"},"_hasShrinkwrap":false},"0.3.5-next.46":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.3.5-next.46","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"0.2.7","@sphereon/pex":"^1.0.2","@sphereon/ssi-sdk-core":"^0.3.5-next.46+3824cc0","@veramo/core":"3.1.1-next.26","@veramo/utils":"3.1.1-next.26","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.4.0","@veramo/cli":"3.1.1-next.26","@veramo/did-provider-key":"3.1.1-next.26","@veramo/did-resolver":"3.1.1-next.26","did-resolver":"^3.1.5","nock":"^13.2.1","typescript":"^4.5.2"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"3824cc0e57e146bb70452b93a14141c90704a9a0","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authentication request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst createAuthenticationResponse = await agent.getSiopAuthenticationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authentication request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationRequestDetailsResponse = await agent.getSiopAuthenticationRequestDetails({\n  sessionId,\n  verifiedAuthenticationRequest: createAuthenticationResponse,\n  verifiableCredentials: [credential],\n})\n```\n\n### Verify authentication request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthenticationResponse = await agent.verifySiopAuthenticationRequestURI({\n  sessionId,\n  requestURI: createAuthenticationResponse,\n})\n```\n\n### Send authentication response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationResponse = await agent.sendSiopAuthenticationResponse({\n  sessionId,\n  verifiedAuthenticationRequest: verifiedAuthenticationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.3.5-next.46","_nodeVersion":"14.19.0","_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","dist":{"integrity":"sha512-tqGucC/eIz1eXyz4Jd+jXin2ZSx6xsOx7WqBlTsEUNa3x55MLNzi6W2VlRybdK2UQpZFJZWbjmRMAdjf6Q1J8Q==","shasum":"df24cf1421fcfe0e7e283e65e072ba99469ea8f4","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.3.5-next.46.tgz","fileCount":24,"unpackedSize":95230,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJiBcIbCRA9TVsSAnZWagAAKr4P/iRlxRU2MEfEiqE4/XHP\njIYEeUG0tI79iK8dUytTa+LM2xYy45IAlstReydKVs6G7wsgW9sbGKJErQ4s\nnfrAskxdoBp6JNM1PTeOO/2i4422eeLBu2/A5ZNvsPHqc11A5cvXnwh5m3Eh\n39rhXUHjgebuF45xoW26njttCrjpzmTHuq22XUS9jgBsLSuyIEW5bL/ekgAO\npFHw8Dir0R2vHUhRLWLF1QDWlu11FaNL9UC7maJqoytHlZv1Myd/sqK8Npbd\nJDG/pniWRsWOyz/DXWt8xwL9UpgK+41M9zx04XxRYPPWYfQxo50CsPQPX3/5\nhgAhh9YaI9ajYGldXrHAnlgIz1cohz7Yin2Qp34DR2l4F6wM5xR+56bR60Dh\nsv+5Bey/Zo4P92ewJ+5bHD3O5NEMPLCZ9jCaRNk3NxKsCcOA60AHLsKVXJxB\nIHlXeXi51yQ4Kae7CVGPfnuF78BkWRDNMqSFNWO0DpTLG74bHtctTIGWHqiq\nPlRac7jSzGfnWeZTnumAM8zPLhQu0rI0tsDXNeweAdC+hF3WeHKcU2TelKgP\nTsKY6Dhy6Sw/UA+xw+OqHW3NNI6h6KDGiIkd5j+UikdmKLgpcO2lT0w8TgVt\nRaeDOcFOd0JQrHj6JJHp9MhfF+Hh4h8fx12jRkpMYouZhU80SedwDaOllRbj\nIR2P\r\n=152w\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAZ5796BbPKoNzO9EcsuVCVaN89tXxAmBQxKy1BBD9nlAiAT4YfYong3t+IGqmRUb+raIw/ES+/e5lnAWsn25jPgeQ=="}]},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.3.5-next.46_1644544538841_0.42501986797779234"},"_hasShrinkwrap":false},"0.3.5-next.47":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.3.5-next.47","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"0.2.7","@sphereon/pex":"^1.0.2","@sphereon/ssi-sdk-core":"^0.3.5-next.47+11ebcfc","@veramo/core":"3.1.1-next.26","@veramo/utils":"3.1.1-next.26","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.4.0","@veramo/cli":"3.1.1-next.26","@veramo/did-provider-key":"3.1.1-next.26","@veramo/did-resolver":"3.1.1-next.26","did-resolver":"^3.1.5","nock":"^13.2.1","typescript":"^4.5.2"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"11ebcfc037be76f2cc4113fe2dbd0247bc4bc9af","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authentication request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst createAuthenticationResponse = await agent.getSiopAuthenticationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authentication request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationRequestDetailsResponse = await agent.getSiopAuthenticationRequestDetails({\n  sessionId,\n  verifiedAuthenticationRequest: createAuthenticationResponse,\n  verifiableCredentials: [credential],\n})\n```\n\n### Verify authentication request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthenticationResponse = await agent.verifySiopAuthenticationRequestURI({\n  sessionId,\n  requestURI: createAuthenticationResponse,\n})\n```\n\n### Send authentication response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationResponse = await agent.sendSiopAuthenticationResponse({\n  sessionId,\n  verifiedAuthenticationRequest: verifiedAuthenticationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.3.5-next.47","_nodeVersion":"14.19.0","_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","dist":{"integrity":"sha512-6+jCnlo2ohjV4ZQXfz83bj0HDUQfeh3Umy7lj85PnAXttRNdQ2QfcCANewNOyN69Cij/G8+BvHF2NJGVOu8Ylg==","shasum":"5b214742bacba5db50716776084a92bac942487a","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.3.5-next.47.tgz","fileCount":24,"unpackedSize":95230,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJiBcURCRA9TVsSAnZWagAAYYgP/jvswNXSoJbvvlVh7pL6\nRAfBeYBgbEZS5DAZ+NHZepAfgk5SHL1LwoT9pUYBb4GjR2dAw8xHDr2hcIY7\nU323YJ4454smU00I6v5YaG3wZBPbdpnntGEgzm/bN5Mv7QWvLdAqags/2jkO\niCeq8Evv0k08bXtF8hU7Tpt3RHnk2GxbDSAcQ2KzVkdM0l05t80S2kolLtOl\nicZjlRUpW27+3bBJt5jBInESKvg1fBRBivY2TqFoqcCxcElMK+9AONHV1tfw\nXfHfkMxRkCjhK27GUtehiwH96hT5KSWxfQO3ByNZ/hly1HB5YzJT1nPXJ+wl\nHh8BYxfaW/Ul/ZfcRDf7QH6MANjEhxEkr4YTBcT9QVbYVZK35nvCPEUyGybf\nZG8pT/8JrBdGaPWzSgu722Z5KiZ/QduQiWvZ3y6sfsWS1mqbGivI6rOU2Mjz\nUbhlhDoROU5V25cmzEcx5Wr7ckdA2yL7hteNqAu1opUd591aeIc5wUpNQzh+\n/dqlCWzR/Rk3vBLham+BWuIQmRMp0fXNn+bibv+XM1FHerJtELziJmVzLqPI\nzCXJ5lt0FiBJ35ugrrKiimfkoYcgZ8D57sIdph4ZlyC21h5ykXpQvVrLd6VE\nPSdbC0S0k3+YevGkrOqnIOoh+vhJA7ayNKA+gbGaMkN35n4SmS8s9FBrJota\nQ2aj\r\n=XViy\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCNK1noZUS+WMYKoV6i8OAN37p7qpnVTDCm/pq33vMoPwIgcg1dDkkdNXZfN3QgURQUBKIpsdQuH2TK+ep92TiMAEA="}]},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.3.5-next.47_1644545297337_0.15826014079630224"},"_hasShrinkwrap":false},"0.4.0":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.4.0","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"0.2.7","@sphereon/pex":"^1.0.2","@sphereon/ssi-sdk-core":"^0.4.0","@veramo/core":"3.1.1-next.26","@veramo/utils":"3.1.1-next.26","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.4.0","@veramo/cli":"3.1.1-next.26","@veramo/did-provider-key":"3.1.1-next.26","@veramo/did-resolver":"3.1.1-next.26","did-resolver":"^3.1.5","nock":"^13.2.1","typescript":"^4.5.2"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"8dff4d7ba94349a52332e9f6c4bdf23a95117e63","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.4.0","_nodeVersion":"14.19.0","_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","dist":{"integrity":"sha512-gEWtPtwfhSR8kKjmCI/PHsnMZm7rr8GwPPh+Q9ldInGrsttqE/R/AYS7GXGzcI9gDZ7vZ6E+GIFzfZ0K7iMfEA==","shasum":"0d0cd9802d13ce50ecfac75c55f7701e756905a6","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.4.0.tgz","fileCount":24,"unpackedSize":95198,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJiBcnDCRA9TVsSAnZWagAAz7AP/jL4pQ/5WMyobhoQk5RW\nL4ZSd4xGHx0JrrqQF2LsnvPId4Y+aj5lVjXptPLZXLgLESjcV3GYnmPX4NRP\nFjoaiCSw9IVjA0+atSMJgw68al/w5KMnJRcGXK7sSUPbf0eXrR8TOMZMTGGI\nVSinavUvXG+XE1IUXCw4gfCvj6U4XaQeAOj6A7MxwUtA8x+Xs/WRzmijwsvI\n73o+U4nQMAZotH9Qz4F6IC5xbhASSkLCWXIEbmy66XpGgCb2Ay6mbwMVua8k\nrgYQTatW7hqk5lcDRtpeOSYk3iNsOU6K/1DgQw5ljNWf4EcZz22Ge/pvoY2Q\nbBt8ZzKqT7hEL2vNpdmhhaV1+iFvH6mrhmGVaAc4+0AYegjed3CphSN8oAyx\nlGRw5z9LH0TraoBFMr5iZGXwWPdy4WuaTp8ItIb8QRSC8IyuYGSn+ta7f/Xc\npuNJo1bcr60h0urO0Dr92t/2+FKXesI+9RDdb6tELUhqSvEv2tc2ghlavy4d\nQ63Risn2EfQ6qbCCr7r+cuZUfOdjRFM8S9kt5YOe5mPbWFPc1raBr2+g711L\nXcTM/kOXRV/bTUX+kHV3QgnTWSlnqiIJYdcojBe8BQUah9Mf84wCNjjGYHlt\njuwM3PCJ1NCpLRPfAXipn72PAQnhstPgZDNqMJey9aSf9B85+l5koEvucy9Q\n/08p\r\n=2qvg\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFfSx9susITZryBSpR7dGP09kFyiSnqIFt+6ylu748RXAiALlFGJr8r8g1/AmJD3/4L/Sb4RmA+XnHruJuBCIHxzJA=="}]},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.4.0_1644546499693_0.13984686043932903"},"_hasShrinkwrap":false},"0.4.1-unstable.2":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.4.1-unstable.2","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"0.2.7","@sphereon/pex":"^1.0.2","@sphereon/ssi-sdk-core":"^0.4.1-unstable.2+ef8f9f9","@veramo/core":"3.1.1-next.26","@veramo/utils":"3.1.1-next.26","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.4.0","@veramo/cli":"3.1.1-next.26","@veramo/did-provider-key":"3.1.1-next.26","@veramo/did-resolver":"3.1.1-next.26","did-resolver":"^3.1.5","nock":"^13.2.1","typescript":"^4.5.2"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"ef8f9f950506712e1ecd0c15e068f39dce872677","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authentication request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst createAuthenticationResponse = await agent.getSiopAuthenticationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authentication request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationRequestDetailsResponse = await agent.getSiopAuthenticationRequestDetails({\n  sessionId,\n  verifiedAuthenticationRequest: createAuthenticationResponse,\n  verifiableCredentials: [credential],\n})\n```\n\n### Verify authentication request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthenticationResponse = await agent.verifySiopAuthenticationRequestURI({\n  sessionId,\n  requestURI: createAuthenticationResponse,\n})\n```\n\n### Send authentication response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationResponse = await agent.sendSiopAuthenticationResponse({\n  sessionId,\n  verifiedAuthenticationRequest: verifiedAuthenticationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.4.1-unstable.2","_nodeVersion":"14.19.0","_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","dist":{"integrity":"sha512-/s08kQSmrR0K3YD9jVXm5WQr39ddq9ED9P1WdYYB5rC4pEDPpI7V9bqy19fKP6/lilBDPiNSAugbGe4Bcr+HzA==","shasum":"3c858731c3c50d7de7aef53de5579210129a2bba","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.4.1-unstable.2.tgz","fileCount":24,"unpackedSize":99626,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiEAOHACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqhgQ/7BebzEJhICkq1aQNSdz03qydXOw8kRYBVDEp3gKR0QtR0TUtk\r\nUMLI8Z7TdYwJ7DryWOA67ZRZW7z51cSNu90xLl68988AeZZxOsI/ufIac6oM\r\nuGZTyzkUoSr1rnTB9etdK0AmaAPbI0yX/Z7+P5Gnf3rFFXvugXFUVxES8mf1\r\nszM9hcmxUuEfs6Ie5Q501mr7LBF8HC3jTXULT/P6WTDP0/3Kh1lrvaBexfgQ\r\nsRlEHJXF0dz70BqNWKeVp2jvtT7Ip3kbyEmbVSWwFQICwEylOEkXPNR7EnCb\r\njbg/89Y6Q7lOnYyzKF4gOvB+Q0B3nq/xeXR5lFT4bQSkTxWDmUcO+Q9XOq+M\r\nyS1lUon8NwcpeRRjx7PoLZX+UUO8TctX3+a22lZLwuzQfuyFDMzPYyvze8Xf\r\nF4ObHdR13KeiKot+WVf3ZiI8WdDmp1WBV7RoetEDvqnmrewvt3qqq2yVm+66\r\niiK0cBptJ7lntuEcqRd339Y2j3DN8NGWrCSn+f9RuY1uCRQ4uk9TZSOcYXl4\r\nTm/XaH18bSaJVkROWag9wYZ8r1XA6mThoHuhlqgAViArYDgeKE7Vl0Wl0+C9\r\nsuZPcEDpiaHRKpIVCAQqnNkx496aMze6zdXjuCFOncXKvNtdXwociNF2wrxl\r\nYi2McsWJ6rv9IxGFN1yBf4RCdumgLznPXVU=\r\n=XeoW\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCLuHJCxAfs5Mn+dp0zxTMZ+8dfDkqxQg3hqNU7epYfdwIgAqik1eNJHFHNaqouHBdiM3T3grHEYeFCcwiwkSuXNUs="}]},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.4.1-unstable.2_1645216646970_0.3056548698343404"},"_hasShrinkwrap":false},"0.4.1-unstable.3":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.4.1-unstable.3","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"0.2.7","@sphereon/pex":"^1.0.2","@sphereon/ssi-sdk-core":"^0.4.1-unstable.3+d3d6076","@veramo/core":"3.1.1-next.26","@veramo/utils":"3.1.1-next.26","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.4.0","@veramo/cli":"3.1.1-next.26","@veramo/did-provider-key":"3.1.1-next.26","@veramo/did-resolver":"3.1.1-next.26","did-resolver":"^3.1.5","nock":"^13.2.1","typescript":"^4.5.2"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"d3d60760532a7d5045e6fe0f40e203fd19ffd34a","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authentication request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst createAuthenticationResponse = await agent.getSiopAuthenticationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authentication request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationRequestDetailsResponse = await agent.getSiopAuthenticationRequestDetails({\n  sessionId,\n  verifiedAuthenticationRequest: createAuthenticationResponse,\n  verifiableCredentials: [credential],\n})\n```\n\n### Verify authentication request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthenticationResponse = await agent.verifySiopAuthenticationRequestURI({\n  sessionId,\n  requestURI: createAuthenticationResponse,\n})\n```\n\n### Send authentication response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationResponse = await agent.sendSiopAuthenticationResponse({\n  sessionId,\n  verifiedAuthenticationRequest: verifiedAuthenticationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.4.1-unstable.3","_nodeVersion":"14.19.0","_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","dist":{"integrity":"sha512-+YbW4b9lcShPwxgP3MjKhX3dwEO/iyZ7hwcwBgGegZs+Ph2ysc2rD1tgdqri8UGOxbhOrIcZhMsKF8ubSqDpNA==","shasum":"23b7595dbd5353107ab365678cf51fe8a11d965e","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.4.1-unstable.3.tgz","fileCount":24,"unpackedSize":99626,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiE9/pACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq53g//XMPXi7f7mE1V55TUXsBhIUClfgK1d9Ae6ZNKfK62W58iUUhW\r\ni1WIxKk6VfnYuc7vFmXMwoKr0NjJZ93ooszjw8QqU7y2l6DA/kDXQHV1yYBN\r\nuCjZThcIc8FQNtLNhNJrTgkL8EDmKKKYCCs6w7hyudIHFLJitMh7duzRwGF5\r\noXrRGQAMEYJazgihpaAF8OiiY1GjZlitwduxMBVxRKUd35uRJ/2QPXvmxefi\r\nsbcxyGy50+VRId1iMkws3jAdAuFQegzrBP3x9sOXQ5oE3Ezv+X408agIuzI4\r\n06IEXjKAqNqGI6e4TdBTFUUKOAju0DbnalTwNQyLHBTmTOqwm0kDN8p4J1Kh\r\nKf+wqC8cTijnlVgs41Y0rWiUlKv2sN/bA4T/VjRGZ9QjRJ5Sl+gAjfttpwct\r\nH71NZdhl1kqjcCnwiK4r5enbYdWD0WyI3P952LAbo/fxYie0F6Ya/a3n7tuQ\r\nnKZrjsy2oqsXc6b9vfew9LD/jWTPPWdeQ+CN2skxuFNMyj0TaT7OxqMyHoI+\r\niKpUoNK96SMlJ4VZEoed2bT/8s2SNRuN0rSMsQMOexKrborS+qSn3p+r7mZc\r\nx4biUohtCCt2XCVitKqUb4Ym0Z/VRi6ue+S0tBTVmq3+JFqXKbIAWmgqgiHn\r\n54j0/qM8NlaFGdHa08DieuoxZnhDvn9gW1I=\r\n=5/Rg\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAUWua6vnyN60CIjnD28bBsb34gyMA66VQx3m9QsWdLlAiEAs0c+WTrArevYoWmgu3gf844KUfr3oRuDLYiNx5nAw1I="}]},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.4.1-unstable.3_1645469673687_0.05078034548349897"},"_hasShrinkwrap":false},"0.4.1-unstable.4":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.4.1-unstable.4","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"0.2.7","@sphereon/pex":"^1.0.2","@sphereon/ssi-sdk-core":"^0.4.1-unstable.4+7d84e53","@veramo/core":"3.1.1-next.26","@veramo/utils":"3.1.1-next.26","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.4.0","@veramo/cli":"3.1.1-next.26","@veramo/did-provider-key":"3.1.1-next.26","@veramo/did-resolver":"3.1.1-next.26","did-resolver":"^3.1.5","nock":"^13.2.1","typescript":"^4.5.2"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"7d84e5368fbf7aa395dbc6b85fed0bdf6da3034f","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authentication request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst createAuthenticationResponse = await agent.getSiopAuthenticationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authentication request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationRequestDetailsResponse = await agent.getSiopAuthenticationRequestDetails({\n  sessionId,\n  verifiedAuthenticationRequest: createAuthenticationResponse,\n  verifiableCredentials: [credential],\n})\n```\n\n### Verify authentication request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthenticationResponse = await agent.verifySiopAuthenticationRequestURI({\n  sessionId,\n  requestURI: createAuthenticationResponse,\n})\n```\n\n### Send authentication response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationResponse = await agent.sendSiopAuthenticationResponse({\n  sessionId,\n  verifiedAuthenticationRequest: verifiedAuthenticationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.4.1-unstable.4","_nodeVersion":"14.19.0","_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","dist":{"integrity":"sha512-UoQMAkjB5tzksiWHQah5FrICTeIJkpzVVfjwgGy5yPFOfLT7FEwGIQiIkp17N4XF4ER8XK14bq3itbRySQAjxQ==","shasum":"e1ffb510c2b49c2774f37dd23046d9049cbbeb7b","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.4.1-unstable.4.tgz","fileCount":24,"unpackedSize":97175,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiFRwtACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmqo4g/9FWW5td869ADf6uSwXgXNoO+6o0IEfe8eSz5ck7gkz6+czP42\r\nQn2Mp0Im5F/9ZGDHOvIKFfKIHurCaHRKvHYq8S1gEwC+muxWfUk6M8fZ58R5\r\nT3ithbsJ/yjM73kravFSi2KLUxgcHgLYN7S/hHjcQj8ZN5EAHRtaeswCcA/Z\r\nF8B+IEricfcnKUe6GgVQyg1DEVz9iacbygmQBDPtF3roAcInNJivl0lsAErm\r\nyA2O5VmEhVt+19Mgvf0YSIeYa2kRrqCtHFebWVNE2mUVndELrmg8u7zY+Vzr\r\nThtOYJy8baovSac6eLZ60fJpuvoAY9w0XgX7nkpbsqP/Rw8JCPaS5q2d0XYE\r\nmRLVO36v+Oc1VrUyeZEpQQsfbm4eA3PmvbDGemCYi1O4LkUx4tNi9H1zAgEC\r\n2BqqXob27b+LpAfRgJrXFrRwXYyWJfhdZjjDQyBJs04KLCPvr2w7P7e69JCs\r\nv7bWqaGvurL/4cGThV6MKZOKQ17sXJ5xG/MXGM3USIAFNqgVTs+MwzzpxPI/\r\nXwLuEthVROX+pVbVfZcmCWnMU4Vuv1hjyevoRfeBQ6DEpa9eOc5G6ClJ23Ev\r\niW/3xBb0zgF4BedHZ0hjYHmWgKkODWUierImyeTEe/RAZzuGufOFA2UdE9Ik\r\niBSEPR+cAVQ1xqGEA4o3HPczc6Btddmi52A=\r\n=nLMA\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDWUIXw0GXTDHO5Q5tyPb5Q7z5289WI9OAJbwBdTHKpygIhAJ8c0puzbfWEORAQfGQYPXDCLS4DRCEM1uDOjgrDtMeL"}]},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.4.1-unstable.4_1645550637038_0.8425309754444685"},"_hasShrinkwrap":false},"0.4.1-unstable.5":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.4.1-unstable.5","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"0.2.7","@sphereon/pex":"^1.0.2","@sphereon/ssi-sdk-core":"^0.4.1-unstable.5+f95ef21","@veramo/core":"3.1.1-next.26","@veramo/utils":"3.1.1-next.26","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.4.0","@veramo/cli":"3.1.1-next.26","@veramo/did-provider-key":"3.1.1-next.26","@veramo/did-resolver":"3.1.1-next.26","did-resolver":"^3.1.5","nock":"^13.2.1","typescript":"^4.5.2"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"f95ef218b2770298adedbb484ad0d91267630777","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authentication request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst createAuthenticationResponse = await agent.getSiopAuthenticationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authentication request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationRequestDetailsResponse = await agent.getSiopAuthenticationRequestDetails({\n  sessionId,\n  verifiedAuthenticationRequest: createAuthenticationResponse,\n  verifiableCredentials: [credential],\n})\n```\n\n### Verify authentication request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthenticationResponse = await agent.verifySiopAuthenticationRequestURI({\n  sessionId,\n  requestURI: createAuthenticationResponse,\n})\n```\n\n### Send authentication response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationResponse = await agent.sendSiopAuthenticationResponse({\n  sessionId,\n  verifiedAuthenticationRequest: verifiedAuthenticationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.4.1-unstable.5","_nodeVersion":"14.19.0","_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","dist":{"integrity":"sha512-GtA41OKjtxrmuxpAHPWDzeRc+a+VgeIjAhIr59alecmXi1dUuTE1eqa3+G8aqGnMqOcBDic4zS+6v6uTFvTd0Q==","shasum":"d7d189a08f52828d5dda5f06e5a09ee4c2b44fa6","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.4.1-unstable.5.tgz","fileCount":24,"unpackedSize":95236,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiFjxqACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmpn3A//ZC2gIiPuyKqtPSvYPZ5tgXd7wXgzrKfO5S9OkCMT8opbFJF4\r\neHqvjqLqs/xx3yX/fRCrJWX4a8q+nrkW3rex2w4AcxbXH+Hnt0Co8y6RAbtw\r\nJjaKl/7NM+LVr3zxtkm2tdjYf2574fVSIXTEU+bnN1bnW0Jjequmc6q1Modv\r\nuOboCyMnXuajuZpRmQbm9ff2P1q+H3UNO+yiKSblvd5+CYPw4Al0SmQY1aSQ\r\n17Koz81PY+aWe0xNAiNjgsFoYy5S4JSlnIWDARDyls7uS57UOtIDB7Nh2JI+\r\nG8IaVX8qCReteytrnfKgnkgo2VbSs02ROl2osMcmvKzlvlCoDyMolvXXQmux\r\n53kVhLHCNVpNolmNTW4SyEuMQW8hlkBMaaJmNEvyR2x8Vz0BeWDST598YyXa\r\njfLNm0ns1j/NEKpzOm+ETyGq9UIIO5wfikdtXNg+Gqhn3lYEY/5EZw0SKM8F\r\ncu2HUHWAv//6WgfijLF8ePzyVUCN3ObXIa7dsLeiZJwq+nl1snUyQ7pS0vRh\r\nAyRQ74OyzhrnQZPN+32nZ9a/i+qvt2tvjjs9+xg5WhHmYwyVgDHE2GaR8bFY\r\n5mxAGrNhP8MlpjcE9MxN03cUn7fKL3Oq9tz2ve3tTzwGvJAfadEkOyWHO6S1\r\n4wYaeFUyYB9ua49sUCQefin0wpRv5oGgeFM=\r\n=kPjZ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCb3KZM/ittVugI/UHGlWeNnzLQt5qW9+ILF0aducvnvwIgSK4MvPhSUPLFCQHf+2aY6hqMzs6JNm7n4zb7B/sciU8="}]},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.4.1-unstable.5_1645624426868_0.27884961853242873"},"_hasShrinkwrap":false},"0.4.1-next.6":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.4.1-next.6","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"0.2.7","@sphereon/pex":"^1.0.2","@sphereon/ssi-sdk-core":"^0.4.1-next.6+9a32aaa","@veramo/core":"3.1.1-next.26","@veramo/utils":"3.1.1-next.26","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.4.0","@veramo/cli":"3.1.1-next.26","@veramo/did-provider-key":"3.1.1-next.26","@veramo/did-resolver":"3.1.1-next.26","did-resolver":"^3.1.5","nock":"^13.2.1","typescript":"^4.5.2"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"9a32aaac5d6abac161c9b6bedb3defc1c386040a","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authentication request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst createAuthenticationResponse = await agent.getSiopAuthenticationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authentication request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationRequestDetailsResponse = await agent.getSiopAuthenticationRequestDetails({\n  sessionId,\n  verifiedAuthenticationRequest: createAuthenticationResponse,\n  verifiableCredentials: [credential],\n})\n```\n\n### Verify authentication request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthenticationResponse = await agent.verifySiopAuthenticationRequestURI({\n  sessionId,\n  requestURI: createAuthenticationResponse,\n})\n```\n\n### Send authentication response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationResponse = await agent.sendSiopAuthenticationResponse({\n  sessionId,\n  verifiedAuthenticationRequest: verifiedAuthenticationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.4.1-next.6","_nodeVersion":"14.19.0","_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","dist":{"integrity":"sha512-3W1akMg+L2J0Cc3/yOdJI1KsbTN14HdI/2wtwFL5aK9ajcQWi5Ugwug+Z+GhOBngIIb3j+AkPs1o4Sd8s1M1nA==","shasum":"6f050ccae42a1e227d48f01f7f9fb1da5dca055c","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.4.1-next.6.tgz","fileCount":24,"unpackedSize":95228,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiFj13ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmpc0BAAnnZvtmwy8UQXtnrpWwXP1HOmKlyMEIXoJQPxyV27vZpAo6Iu\r\nklErMTBRtUbxlw5VkngcmDK3PTZQh1jamoigQbrUwGvzeiUEY3Go+fGB7+e8\r\nCM5imjmBqdiTFuu1GZz/WTnB2ziq+MRwk10hql5CqBej+KghcMUE2cBmgJs+\r\nyxHjtrmaoAcRy0TYpzs/MIYbD4P2ucCrufbBtv9PVK6kyt18evy4ZAlRnOz9\r\na4EklhA9J2NYYN893Yl/hrMMtdqtqOdpERJ0SywkgeBVCUhAi6ZfV86ZuTdV\r\n8ZzcyKqkRyV86ZK9dndOYHh3Wf4p6MizcAtprqiAl5OaiqeVPZLpPMPgUGUx\r\nPlFcZ2O5Tt6aG6JUBPeEEOHt97WEL5jKFLLEDngonqJlDqMiOmgxNDQfSdm7\r\ngDtZti4mbx6tzleTw3f3GdubQn93tC+Kgbkhos0eQb4kDn3iaAO/aQRhkdzJ\r\nwAPh69AMDCgAjtfshMDF+P8HrcVVzGB1Yc2WTbvBOY6miqfdpOSdhIUAxLml\r\nNUB2ldLqMtLCeM6tBI55+/s+gX8vZMVOqmtfdOHsVNPifB4/lYLY6SnqOYVk\r\nlUIlGp/faf23gy1uo6uUjrIp1i0Ci4o7L8rQWxzaK+utkdhGEHdT3JeTytqj\r\nfUVzhmGBKA5I0cfIEiKV/sgiVyxwFhOvdiE=\r\n=XFhy\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIC8gRPv4bqP7xTwELtGUgVoLwq0UCr/9I1Ywsa6n+F6zAiEAjKLJJmBF70Hi1q2mfnKWrXW5dTmY3A2Gff5nlmTbJDQ="}]},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.4.1-next.6_1645624695055_0.9778425036884855"},"_hasShrinkwrap":false},"0.4.1-next.7":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.4.1-next.7","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"0.2.8","@sphereon/pex":"^1.0.2","@sphereon/ssi-sdk-core":"^0.4.1-next.7+67ee65a","@veramo/core":"3.1.1-next.26","@veramo/utils":"3.1.1-next.26","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.4.0","@veramo/cli":"3.1.1-next.26","@veramo/did-provider-key":"3.1.1-next.26","@veramo/did-resolver":"3.1.1-next.26","did-resolver":"^3.1.5","nock":"^13.2.1","typescript":"^4.5.2"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"67ee65a82f6667ff9c94494d35f547040dd0a569","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authentication request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst createAuthenticationResponse = await agent.getSiopAuthenticationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authentication request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationRequestDetailsResponse = await agent.getSiopAuthenticationRequestDetails({\n  sessionId,\n  verifiedAuthenticationRequest: createAuthenticationResponse,\n  verifiableCredentials: [credential],\n})\n```\n\n### Verify authentication request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthenticationResponse = await agent.verifySiopAuthenticationRequestURI({\n  sessionId,\n  requestURI: createAuthenticationResponse,\n})\n```\n\n### Send authentication response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationResponse = await agent.sendSiopAuthenticationResponse({\n  sessionId,\n  verifiedAuthenticationRequest: verifiedAuthenticationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.4.1-next.7","_nodeVersion":"14.19.0","_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","dist":{"integrity":"sha512-trTo2Bxu9Dk6XbS9zn5mbsUz1XihiMKjd6K/sc5P4W5oXCo+gPltLxMAULyKW/V7+rWI5PCL4k3wQvW2uo4/0g==","shasum":"122f4c0e86ffa6c871e5696c670c689f18362faa","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.4.1-next.7.tgz","fileCount":24,"unpackedSize":95228,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiFlwuACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoOvRAAnG0hyhS2npQfh4riB9JMVPeJgzPHIDBzWFc0Fg0SxqvU9AYA\r\nJyNBa9VzNy5e3+6GqccsDNZoP7MjUmfiTtUfj3Anh+UABPtTd80eQ0yzxpY/\r\n5qWsVXKDTPD5TMeSdxjQ+O8Cqf2Hw0PpiTAkocXqzJIdJY9FoIpXlSQOqtD7\r\ndZb7jtBkJP0epCJdy7ktqouvK84h8IfG2Kp00bgEvQSS3oe6ok8S5ySLehA3\r\nsgYNZAaDzn5sMn5SOhXdjqMg+zsj9/G4gms62my2GAawET2e/Zll5m76cFI4\r\nH0GnsLMg/RliGzWQ02C2CjPvZo4FRZoC/uWeJuPgYAXEzxTnBoRBAaMPlUhY\r\n9PdIjd+Tya3eKl5L+qECKj8fHFuJTwxvOvsewDpJdmymHsNzuLbJkEF9+R4C\r\nIUmyWn/ilI9NNyfjjczT6JhsJl+Z1fbwFE/61e/cT0N3bhErIhDdVWYPphSS\r\nCaERfkjNHIRbexdcZA4HAvnjbBNcdiKbnpiuZOpzZHUYrZXSptQObmCvem4N\r\na2NY9xUbx45dUUA+yxpADzsFx4lqCjFaFIlJqMs3n1Q0HhfN2BafQ/4NVGdf\r\nUpyfuh2yStEuy326VbwZ97c1X5GyLo470MNEiidNSG5LaUrZuRvE2Dgl/djP\r\n4I0Ezj+pRB7ZEynNOUKJNj0s9/veoQzjzLw=\r\n=+yAc\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDcdhiV6b8Cw1wn3D6EHHAsz06AlLntdaf0o4ilReVcsAiBuWx4BV/nIbooEVF07niwR3261pXF5Ji3w+tID8KqQvg=="}]},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.4.1-next.7_1645632558477_0.9810384995325232"},"_hasShrinkwrap":false},"0.5.0":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.5.0","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"0.2.8","@sphereon/pex":"^1.0.2","@sphereon/ssi-sdk-core":"^0.5.0","@veramo/core":"3.1.1-next.26","@veramo/utils":"3.1.1-next.26","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.4.0","@veramo/cli":"3.1.1-next.26","@veramo/did-provider-key":"3.1.1-next.26","@veramo/did-resolver":"3.1.1-next.26","did-resolver":"^3.1.5","nock":"^13.2.1","typescript":"^4.5.2"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"d99ef3d99ada5126c923be65dde3704fbfe34a48","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.5.0","_nodeVersion":"14.19.0","_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","dist":{"integrity":"sha512-kKbTmtFdM1DeIxX4ZKQVe6p1/zzwguzEWQHORKnClslq2s0xIwQb4rY/7o/OoOlDdM6tV1/btrrxTbCWU+vLrA==","shasum":"f7d283004418b1675385eacc75f7ea1209159b5e","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.5.0.tgz","fileCount":24,"unpackedSize":95198,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiFl57ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqPJQ//XyJhL/l7z3EYr6J4FHMoRWognPWppySgA3TlZ19wQOSnP9zF\r\nDy+mo0UuLk2BI5bF3eGazWjQH7msRFFWfez7S3WqmHSMfZTQFVv9g8CR5Okw\r\nYIbBseN/+C0t179VZtGPfV5NoXlF6zYJ+ocRoRS5H3lGLPSHce6Q6NUmUo4x\r\nKwlOkrKOpTwVZeAuWzTZh2ohSSf4y5Fts+c5xHE9U/GxVgArKCyHuj0n9QZU\r\nc7zs5uFFzF3NUEEXjOCG0WbdDFuORMwoI4fvrHv0JK0VKQB70JxXNqoSyHrj\r\ni3N99DKiZ194v3ugow8naMK2PKYfy7dGjtp8TsFCEjDJ1BuRwdKmOVEaTGMS\r\nNLIkzvYgXM8ywnWb84vdljKBUEJExcGJvhUq7uardExGqIUtc1v3XuKaGGZF\r\ngXquKKJeDBocaJTahV2HRAEbKOOET0W4QsvSbyreGOjxs0XfeN4sXQaxZjwg\r\nbODCexKOne46meAOzfca4OmoNhc42o33DsojiuQfRcuXsfbSb5JgDbfOLTfc\r\nJQoKMJMHGCM65HpyVEnXZ+Job6c0NyUdlYAuyZ+FsXCNxX4Ib2kGsldne5vp\r\ns6try48yctm5Vk6PVjY+2uB0UfvA2i3tfUPwTZLYDj4AxgmMKD+Cc+Vxrr5k\r\nodTVI7eMhlTW4mYyMtOVl1U3NK6P6sGPZxE=\r\n=t2qj\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDV0WD7Fs9oW8/3+SVrlmxySju2aM3Fyrs6J6bJyw3doAiAd5V2SqvYA+e3eq7pEprNr9v8SuDGmPFSpVX8Oh/M/2Q=="}]},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.5.0_1645633147459_0.03160357893084775"},"_hasShrinkwrap":false},"0.5.1-next.1":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.5.1-next.1","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"0.2.9","@sphereon/pex":"^1.0.2","@sphereon/ssi-sdk-core":"^0.5.1-next.1+42c1dc5","@veramo/core":"3.1.1-next.26","@veramo/utils":"3.1.1-next.26","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.4.0","@veramo/cli":"3.1.1-next.26","@veramo/did-provider-key":"3.1.1-next.26","@veramo/did-resolver":"3.1.1-next.26","did-resolver":"^3.1.5","nock":"^13.2.1","typescript":"^4.5.2"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"42c1dc57779a04c02504a9120089253f71698c9b","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authentication request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst createAuthenticationResponse = await agent.getSiopAuthenticationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authentication request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationRequestDetailsResponse = await agent.getSiopAuthenticationRequestDetails({\n  sessionId,\n  verifiedAuthenticationRequest: createAuthenticationResponse,\n  verifiableCredentials: [credential],\n})\n```\n\n### Verify authentication request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthenticationResponse = await agent.verifySiopAuthenticationRequestURI({\n  sessionId,\n  requestURI: createAuthenticationResponse,\n})\n```\n\n### Send authentication response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationResponse = await agent.sendSiopAuthenticationResponse({\n  sessionId,\n  verifiedAuthenticationRequest: verifiedAuthenticationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.5.1-next.1","_nodeVersion":"14.19.0","_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","dist":{"integrity":"sha512-ZvY6xWnYJV7e6Pzl42hBCMQ0NsYyG+jzwRKtlDy3wrSCVA7kjzhoqgQmuktM9tPf7N08uRT8kBs22bYHDbHKLQ==","shasum":"ceb2e348e13de618597fd8513fb83189455089cf","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.5.1-next.1.tgz","fileCount":24,"unpackedSize":95228,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiFnoMACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpyxQ//Rw0UCHThWF4y6UViLbm6O5MFflMfckTA0v9Qn4Xe19Tip3Va\r\nSIbitBGnpNCGXzi0r5Udyn/WcdUqIVH1wHrkdHt+u0Jw9eIXUeQEZJgOQ1Ys\r\nCN8i5mdg9iWyK6rbK60PcPswXGZjaqN5LUcfdVYsQijbwoKOBP4lrTDDrXII\r\nY3XhINUxTbbCqAbUFV5zt/Uf1UVlc0gAbv8gM5iACva1Oa/wYpa6A2/RC62c\r\nH9LZHmMT18pDvGTgxkz0ib4YNhb8BUzKr/vnCj+XcOm97PRL2ECL5DVvV1Ou\r\nAsKW1/bgtwh6kbB6RpQdz9GuOplvpr5rP2BJZw25WO8osm7UIcJ/XHpLOFco\r\n1Hxz0canZOE65vHd6BbUAW1jnLNbVwohNeoFcGZErTdkzA57bbmtJp7PtwxC\r\nLKILTRNdz7Sfei6cfUuqU8LifwXkf+7tzL9z3SnBNzibc3zr5fR7SEyUVW+l\r\nVfrSuYhJvT9rACDmMf38gDjQEiUwChBuRa0k5T3Z2+CEZiZ1sJ3XjHwcrV5P\r\nvIWSbPTC2JfM0/+R5GlSjxYUlhAKqAIkNUs3PesjfsoWVu57PYFGdZIFUAeN\r\nagh65jAc6++odxrUptGNd6vWX/BpA0GGeQUA1vk4SRuXUIUI5KX0x+fE1ltf\r\nXaxDedd+PE8OqIQ6+3YB4DWRaM3mKJuFSNg=\r\n=ZKr5\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDG8J2grK/ZdJ5qwj12fIS/zRKqdA1p2+FF0h1E2QmWmgIhANZS/MroJRHHCiKL645b2nxD+INHkKCL/tJU3Gq2BLXe"}]},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.5.1-next.1_1645640204158_0.46613017620615493"},"_hasShrinkwrap":false},"0.5.1":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.5.1","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"0.2.9","@sphereon/pex":"^1.0.2","@sphereon/ssi-sdk-core":"^0.5.0","@veramo/core":"3.1.1-next.26","@veramo/utils":"3.1.1-next.26","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.4.0","@veramo/cli":"3.1.1-next.26","@veramo/did-provider-key":"3.1.1-next.26","@veramo/did-resolver":"3.1.1-next.26","did-resolver":"^3.1.5","nock":"^13.2.1","typescript":"^4.5.2"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"033856a5193661b7dae683ad1e2b37ce728ed2d9","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.5.1","_nodeVersion":"14.19.0","_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","dist":{"integrity":"sha512-H3kyuJ6UPITOM8Y63Yf/Bl8PgTXf7Ojr7RxIyKIXJMXlbvBCCPrJ4KuCM8xiIdwzWny/HhK8tF7UivzVQSrskQ==","shasum":"86eff91c0655fc39881bd56834944bb891790132","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.5.1.tgz","fileCount":24,"unpackedSize":95198,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiFpNoACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmqihw/9Go9xgX0AskV+9RRc7meuGDHVESRPeMimXDtIxotU/np/9x3F\r\nmK602t7OSHGP0zH7Nu3OMjwfUwmOzG4LGsk8k/A/QbDFsoondKRfpCpFTgW3\r\nOUr4W9o66THG3+M2iEFSChJSFpMyKFeZ/xBhbjvWplTqQDS1A2KzoL3JAQ3y\r\npop1MP5wxZ0peIaha3C81W04sJmkdjkPKpIDuD5tyNdZYQC8ZHlmrUanBCay\r\nHGnzJXEvNR5Bx3lKfI/uvpaz3MCm0m8jEkiVurRnnxOhDz/GprzBP+xiYRgr\r\n/EhDlN7bD3MsbtGMZrZq8X4e6+oYLOlJOeJ6LFWocCIniyW2uxCoRWxIf/v3\r\nsMnSUqC9P0+u4fFN/6yX+qwFeuo8g0UWUHAGlIsNB/ZprJ6lz5jCBsrb+t04\r\n0B38+k5VTgl8Zgf/3SReSLs4ebKN/vPtr6xEpgV4CZbOLSNxXwCOYhvCvSiQ\r\n0fbEdQ6yYxpAdGIVvXPGvdGZh5OChxOag65mo4v4xwzkc9jX7t2f8ia8oOpa\r\nzDWuYWVEM2+nOxpMvqU0cP/u1VRNIaDeRt3xeYCD6rEpUgFljJ7/h7VdzuI2\r\nIRKkguwmCAoG5y18OUPKZhuCLIQzAuLkXAdq877pbVUcPHnp8QEvlxYnoTbb\r\nvph1jek+pjojnrH1Utp8jLvYqXu4UgeCtkY=\r\n=SkQI\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCqWJJWmFL0M7HzHQnXoV1ae0h7G0/OzDiuVni90xWqAQIhAPlkH4Cuvxd/M0XuK797wQGslfzc3d/VvjEwr4PF13Pi"}]},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.5.1_1645646696263_0.2945362098261828"},"_hasShrinkwrap":false},"0.5.2-next.3":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.5.2-next.3","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"0.2.9","@sphereon/pex":"^1.0.2","@sphereon/ssi-sdk-core":"^0.5.2-next.3+3c6f67b","@veramo/core":"3.1.1-next.26","@veramo/utils":"3.1.1-next.26","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.4.0","@veramo/cli":"3.1.1-next.26","@veramo/did-provider-key":"3.1.1-next.26","@veramo/did-resolver":"3.1.1-next.26","did-resolver":"^3.1.5","nock":"^13.2.1","typescript":"^4.5.2"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"3c6f67b95df8e953d7826fa843b90966f28467ff","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authentication request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst createAuthenticationResponse = await agent.getSiopAuthenticationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authentication request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationRequestDetailsResponse = await agent.getSiopAuthenticationRequestDetails({\n  sessionId,\n  verifiedAuthenticationRequest: createAuthenticationResponse,\n  verifiableCredentials: [credential],\n})\n```\n\n### Verify authentication request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthenticationResponse = await agent.verifySiopAuthenticationRequestURI({\n  sessionId,\n  requestURI: createAuthenticationResponse,\n})\n```\n\n### Send authentication response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationResponse = await agent.sendSiopAuthenticationResponse({\n  sessionId,\n  verifiedAuthenticationRequest: verifiedAuthenticationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.5.2-next.3","_nodeVersion":"14.19.0","_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","dist":{"integrity":"sha512-S0yHD9wRLtQB8vFX9tVIexNb5UDMNXYFdsGkKUI2lE/IBe7m6n1+5ZJu7KTibUSecqvqoPZMawdIdHLSFMX2FA==","shasum":"5c8d72e0c7194ca65be8bf3b0679c4334c94cfc0","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.5.2-next.3.tgz","fileCount":24,"unpackedSize":97894,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiGD9iACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpXZg//TUsybI2Xnqn2e/lGMXzIDid6X+zNj5EvY87dsOwf7TwG59lJ\r\nAH0A76e96v1t3bK0TL6+C6ffBaophn9eGb1lrDHWvws8q9gmw//ambdTZneo\r\nZLfdmwq5U93guArEezxMdwun4SI/bOWYQpJw29d25t3tBfjKsFarQnsB/FjH\r\nl4OT1RztaKOZbQq9gE2iXeLkbM8Ce1u3aBmWEGYSBVJat6crVQ6mIvw+L7Ao\r\nQNsuhez3+62OE+LvFckXFZq+eNJqwai5zxsCCMLvPrEbioE/ophuheZ6O1+O\r\nqOOa8yalHBrqXB3XYJ+1Y8qqgpCSeratuc7Ka1hwZzgKWADi8b7Eumay9rv6\r\n+jHuk7wSpYc9inxYx8C/J6sCmO9MoMM9/v5/7CE+P7VrpBxjzXH/X/44lQRH\r\nm35D9JXcMzS1daIAJ1ph3q6MQSSKcvMYCHT/gLFlc/RQa7zJTl9R8yVgkxMx\r\ngTjxqqcSH0zE1qwJAHPEMw7meSpMiII+gCBLnIc+A6dYuhMEQqX+WvxXlAKz\r\ncSbQTTuIAZvxYa5VeIcMCXs/xIkeFA8Yfe5lpaqQS4KaKVwiZX3KFrpbKVeo\r\nezYcpxZ7P1laVNo+ITO1Dh+sTQt0oOsqfqfPk0G1bMhw103rnidt0Mu5/4nZ\r\nmLntvKcAX6KFbTNAiLJmm9W1/ykneiy32mI=\r\n=7Ns0\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBol0z4q6s4j+SczK6pG5xYQ9GOaqCxFWqsx/Ab4wKodAiBoM5YYN0KX+3yI8jbnooFUKEs0MLR7BxocyW2XwZIk1g=="}]},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.5.2-next.3_1645756257908_0.6360516631122648"},"_hasShrinkwrap":false},"0.5.2-next.4":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.5.2-next.4","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"0.2.9","@sphereon/pex":"^1.0.2","@sphereon/ssi-sdk-core":"^0.5.2-next.4+df74ccd","@veramo/core":"3.1.1-next.26","@veramo/utils":"3.1.1-next.26","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.4.0","@veramo/cli":"3.1.1-next.26","@veramo/did-provider-key":"3.1.1-next.26","@veramo/did-resolver":"3.1.1-next.26","did-resolver":"^3.1.5","nock":"^13.2.1","typescript":"^4.5.2"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"df74ccddcab06a032ca47a033a46bd0268826f72","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authentication request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst createAuthenticationResponse = await agent.getSiopAuthenticationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authentication request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationRequestDetailsResponse = await agent.getSiopAuthenticationRequestDetails({\n  sessionId,\n  verifiedAuthenticationRequest: createAuthenticationResponse,\n  verifiableCredentials: [credential],\n})\n```\n\n### Verify authentication request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthenticationResponse = await agent.verifySiopAuthenticationRequestURI({\n  sessionId,\n  requestURI: createAuthenticationResponse,\n})\n```\n\n### Send authentication response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationResponse = await agent.sendSiopAuthenticationResponse({\n  sessionId,\n  verifiedAuthenticationRequest: verifiedAuthenticationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.5.2-next.4","_nodeVersion":"14.19.0","_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","dist":{"integrity":"sha512-ynsS6ifSmldocYipxlKqLPXzqdEEyPuNuxAzq1uBISDJpNnSDT+UL6yuKfIrSLOCnLTpPCh/2HK1ckxKy8Nffw==","shasum":"e1483a21f8afdb8d7b2df130b33cce2b5920e4ec","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.5.2-next.4.tgz","fileCount":24,"unpackedSize":98129,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiGEHwACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpMKQ//VhmtXc39broVpmsdG9ab6vwHhFFel7aND2W0C2eU7aRlS/Cv\r\nt1brP2t+GJWcdnZ9mksbccWHc4RaMJ6Icr9zhdN/OO5roIjT/1l9qQ/Jf1Ph\r\n5mPmsQ6B48brTUG6B4VrRH79lu86h70mpkoLP7u3uq4xqPCAybObMbaD/Gex\r\nnajgtiCr/KNAzGc9R+NdQ8DuCVYiQ1UM7ob45ZAEHO7yK33dgUv1QixvZvGE\r\nIC6qXQH/7gNTv/QxI2ND8soMnjMczyt6kCqqQRz6Q9cc/wUMAoO4CkwxqYnB\r\nwfJLYVozKsctJs2l+HPD2PQ6h9BEDiNaWrqO8592G2eGITEh7RR57OeuXUzD\r\nzL4OsVM7k8mdx77leOkmXitLSvgx2nDft48SntBslqnESWVmqzdXPQqu7nHj\r\ntDWf5vKlGEOFgydeGO5Aa4TvwWyxzfaqAYOhLwYI34nJukk9tSzziFfdWQyK\r\nPS6M1wiLydhEbiiGZugWyZoNtEOUP7/nMr0DMr7UM1Kq5HOY3/x1q9GOJuEn\r\n3OZaGXxD23DmYit5Sj+7hVQNwSItcKqAe7j5ALfqSA8r9QYt/cTbyJS02Rit\r\nDUH17pkxcZi4nWTBQ414xAcTvqNVLE0kQm/IZ4A3MFyEs8hllqL7k9hZxeFa\r\n5ukSWRE8ys8eIGMcN9Y02kpzFx0Urhxlvf0=\r\n=qizz\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIF9ia8y6YG9dtrs/Q52I1/eE+H77Ap3qKjutP267tOcuAiEA6ZXlI0it+xLedi0qyqHsnRK+4qGVoebPatnmL0VSehs="}]},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.5.2-next.4_1645756912698_0.17425185856383796"},"_hasShrinkwrap":false},"0.5.2-next.6":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.5.2-next.6","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"0.2.9","@sphereon/pex":"^1.0.2","@sphereon/ssi-sdk-core":"^0.5.2-next.6+f1e08f7","@veramo/core":"3.1.1-next.26","@veramo/utils":"3.1.1-next.26","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.4.0","@veramo/cli":"3.1.1-next.26","@veramo/did-provider-key":"3.1.1-next.26","@veramo/did-resolver":"3.1.1-next.26","did-resolver":"^3.1.5","nock":"^13.2.1","typescript":"^4.5.2"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"f1e08f72f2bf5c5e0fc602b9a610f9b01f4a6591","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authentication request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst createAuthenticationResponse = await agent.getSiopAuthenticationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authentication request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationRequestDetailsResponse = await agent.getSiopAuthenticationRequestDetails({\n  sessionId,\n  verifiedAuthenticationRequest: createAuthenticationResponse,\n  verifiableCredentials: [credential],\n})\n```\n\n### Verify authentication request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthenticationResponse = await agent.verifySiopAuthenticationRequestURI({\n  sessionId,\n  requestURI: createAuthenticationResponse,\n})\n```\n\n### Send authentication response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationResponse = await agent.sendSiopAuthenticationResponse({\n  sessionId,\n  verifiedAuthenticationRequest: verifiedAuthenticationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.5.2-next.6","_nodeVersion":"14.19.0","_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","dist":{"integrity":"sha512-i6+Psv8+H069yO238M80tboRFXYsMUMOEdN2gTSiWqtxPsXer7AM504NVmCmGM8JvADC10OXXjzJYNrn1GjVnQ==","shasum":"e90a9c61a7facd1109681d376cd5e368746cdf39","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.5.2-next.6.tgz","fileCount":24,"unpackedSize":99828,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiGEWnACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoYmA//YeYiVhvKqx7MqlVvzy0R8yRCxSeyBD4rhc0j7V6wu8cmLybs\r\nhJInnR38Gqldq0MohLpY1HtyxBEo2JuHglkOiGCfnhyzlSPetQK6sJ6MyAjD\r\n0dLabG3OXbR1Z0wnx74yuf40+Qveuv8Absxys033d152RgYUKwVkpBg8ZaB0\r\nOn4+Q9HzgWITrp3fhyFa4xH9SGeRLOsdD7qbL8EXEaOROtI4AvlyJNtixmkC\r\nDNbIjiu6Iw6+IPtSKuQQbg+wuYx3bT7rjuQ8q2oVt1EUMskYoddOlujA2ndI\r\nABRFkEEpNOTuPOtuAC0Ohs2gTrgzCvpJkrvuwrid/1ePsdqa/p7KWB6qPHGO\r\n9XjU75HFCO2Wxicx/YSqp20mCVK1S2dXrw/0XYWQ1yTlQU9BS/osJiqFi7ns\r\nhykcBysNzOjtbtk9ZmgJCW8Rp+8M9JvB8PbW4Z3KNBEPCMzFInGz6ImvgXl0\r\nMqEGASZA6qZuOk93VV+GE33B/l2p6bbql+lifByTNSghmFVlxzDc7nDAAWPj\r\nxuoT4vyFfeoFWW03WKiHSlV6LLs+VkTo9ClXBLZKcS2LLOu/jCi5miwsMU+M\r\nuCWXmlo0UYXAn4QYuMlXNUarjdF7xN/Wd7M0A9cxNrs4ERV7fCITp64FBu7t\r\n8qUeFsP9KH3Mz+n4jtoUV3eLiSsjQzzHbbM=\r\n=jh2Y\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDF6wr4qi6JH6XaaiQAl5sEYvjtU/z/c2c4GNqOD26x1wIhALn/ZJfZM59AKiY8OGsvSlCPYD3jnlswQOM+kzK3tXK7"}]},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.5.2-next.6_1645757862981_0.8216025126399671"},"_hasShrinkwrap":false},"0.5.2-next.7":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.5.2-next.7","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"0.2.10","@sphereon/pex":"^1.0.2","@sphereon/ssi-sdk-core":"^0.5.2-next.7+eebce18","@veramo/core":"3.1.1-next.26","@veramo/utils":"3.1.1-next.26","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.4.0","@veramo/cli":"3.1.1-next.26","@veramo/did-provider-key":"3.1.1-next.26","@veramo/did-resolver":"3.1.1-next.26","did-resolver":"^3.1.5","nock":"^13.2.1","typescript":"^4.5.2"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"eebce18bf9cc9d28a8bcdd6886100b7a8921bb2f","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authentication request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst createAuthenticationResponse = await agent.getSiopAuthenticationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authentication request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationRequestDetailsResponse = await agent.getSiopAuthenticationRequestDetails({\n  sessionId,\n  verifiedAuthenticationRequest: createAuthenticationResponse,\n  verifiableCredentials: [credential],\n})\n```\n\n### Verify authentication request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthenticationResponse = await agent.verifySiopAuthenticationRequestURI({\n  sessionId,\n  requestURI: createAuthenticationResponse,\n})\n```\n\n### Send authentication response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationResponse = await agent.sendSiopAuthenticationResponse({\n  sessionId,\n  verifiedAuthenticationRequest: verifiedAuthenticationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.5.2-next.7","_nodeVersion":"14.19.0","_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","dist":{"integrity":"sha512-H6u3hSiyTsb4BFa54v1iyptjkWCCx7/10Gju0WAJSitAM+xN26ZGNk06i1BMWCSmF9PgAhStjgqsO7xvoeqPcQ==","shasum":"da51a7fa6aff53f87f8e1f4cca85b081b11cb4e3","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.5.2-next.7.tgz","fileCount":24,"unpackedSize":100506,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiGEy5ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq6/RAAnowS4M+0gfKCdpVSVcGKtypRnmoPBPKVnKwAVpHQbTRcA+oV\r\nRKZpsbXbTX4Lh/H5n/LjBGQNb+1MLZAgtfOGdXcV9xH2OcD/MhkFN0T4hsX/\r\nYlxxIEfxmjFWF4FeayTDQiHDQ/94lPrI5/x3yGKLLS0sXI1kdYaPAeabkhA9\r\nLhb6XOc7EbL0MJKH0HwIY75xNj0dpqDD+jQpnVhHcymqaAuYOOXH63PpeQNU\r\nmL6pJLuj+oZlDJKN+7qOpID7LCrmK+jMz7gTpBe58D9qyy56OShvmaN0q0J4\r\n3+NTO5Kxx6CHW84PWj/XYXo9/DTiTng5bubhMi5zq8dUAKfCgSHJazwdjBsx\r\neINBJRpvJlBFni4rg02YtOnJIY4wDNkg8FOPHP1FrNQujARjBr/SnCUQXQIs\r\n3MUtlSN0+B3PjQX0JK25aVOuB/YUCcK8MhlhqjMrVWb7TZGjP8EspSJXZTRG\r\nbu+Jo4aUeEFLXWqXns8Svx7rvM/FA0CDCbjFH/TeW1uJsc2QfmKDhQH6Ko+F\r\nGXbiQPbL5A2CkPkPpGr+lC5H09ZeRI5z9NPEX8nr35+zZrhrrtUQwBIpRg3f\r\netQavBR1N/LwWoFqnJ3mYyafjMyc+Gkz1ZFNpV7f4+samB6XiYnP/J9TtaRd\r\naTWJmn7G7WVqvGVJAhuE3fpdqUmslPjEu4k=\r\n=pPnK\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBAxjN6RQBURHLfdOAe1x2LPmb8uy0uBcbxqv/USvNgMAiEA1KUCPnvGrNIp/3NjoefKdMEfO5vT+RsRbvpbKXO87VU="}]},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.5.2-next.7_1645759673675_0.09460320322127358"},"_hasShrinkwrap":false},"0.5.2-next.8":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.5.2-next.8","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"0.2.10","@sphereon/pex":"^1.0.2","@sphereon/ssi-sdk-core":"^0.5.2-next.8+a9f7afc","@veramo/core":"3.1.1-next.26","@veramo/utils":"3.1.1-next.26","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.4.0","@veramo/cli":"3.1.1-next.26","@veramo/did-provider-key":"3.1.1-next.26","@veramo/did-resolver":"3.1.1-next.26","did-resolver":"^3.1.5","nock":"^13.2.1","typescript":"^4.5.2"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"a9f7afc386189ca4851ce967f5abf7db812d1003","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authentication request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst createAuthenticationResponse = await agent.getSiopAuthenticationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authentication request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationRequestDetailsResponse = await agent.getSiopAuthenticationRequestDetails({\n  sessionId,\n  verifiedAuthenticationRequest: createAuthenticationResponse,\n  verifiableCredentials: [credential],\n})\n```\n\n### Verify authentication request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthenticationResponse = await agent.verifySiopAuthenticationRequestURI({\n  sessionId,\n  requestURI: createAuthenticationResponse,\n})\n```\n\n### Send authentication response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationResponse = await agent.sendSiopAuthenticationResponse({\n  sessionId,\n  verifiedAuthenticationRequest: verifiedAuthenticationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.5.2-next.8","_nodeVersion":"14.19.0","_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","dist":{"integrity":"sha512-0LM25u91vqFRU1lKhiWW7zkqRS6YEZNqyTlLzzdf4ECqwLRF9bdbUi1VEIq6JcsexaZRWfU3hGzSgoNTMfP1zw==","shasum":"68453cd915843b6c8709593a12b0f20fc7712aed","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.5.2-next.8.tgz","fileCount":24,"unpackedSize":100937,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiGE8oACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpcBhAAoMBWKShlG90/AyCBUf415B1xZKP1gtAWIASmhCOleHm3IOIm\r\nmILRcUf9emr5oSq5tQuVFY+oh3QfHbJZcuCtl+qQ9zkqFDEHKHLaG1DhdkTj\r\nQySWfpn8IIQrzDpTCaBIhQTGuHAGSJPtM4yaTp7fW3nbi4TIOPdJsqansz0g\r\n1Q8izrU1404EC7q6I94/+Tdw08qz3NAy6yL2KVQThebDTb26wcb9XkY0tddM\r\njLI6pNB9v4Bgtp+HU8+bKlqsacGHIco4VNy0yB/DYlvL6z+RXUfExu1usCP4\r\nv+jsVVsPucys2x50KFigrhDEazsNHYuZuSgitmbHpoZosNULqvA9PUf1lPEM\r\nXDlcv3G73IzPAR2cCj/g3/yxq7wXz40gj9NCaro+SaiIpTe/v6p6fyHbEwoH\r\nz6dZ7I2Xf1ih7Pe5SqtC1gjVjKYqsGhhzYXW+4xsPwKLz5RVuLhXq6q4Hz5I\r\nD3G0EPF/z1eiPq00OXBhhrwxirhvihnzRLt2/5OKqUnZZC75Xo/tJUJHJFrF\r\n+qUUpDZcjLNXlmSgNq/MC3GNB8E72omap/hL1YPnC47Y1xuBXDRspWFurZvz\r\nLiy4EQgxz1h62JojaIc7Q3yg6amnA1mDgn1cEtazoslfsd6gEgQCwB8PPpjE\r\n7znhGOT9MJL9TSysUEg7+GzH8+oQKuFNy2g=\r\n=bOZ1\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDbUfDiaeKCTCkaFgMVZvlVRuezHc5f3/hj1+/C2YtxGwIgeQa5ORPRRNWjYvo4bNoZYV8HDBLUDhrFxj5dE+v2CA8="}]},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.5.2-next.8_1645760296744_0.7235034447049755"},"_hasShrinkwrap":false},"0.5.2-next.9":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.5.2-next.9","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"0.2.10","@sphereon/pex":"^1.0.2","@sphereon/ssi-sdk-core":"^0.5.2-next.9+9378b45","@veramo/core":"3.1.1-next.26","@veramo/utils":"3.1.1-next.26","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.4.0","@veramo/cli":"3.1.1-next.26","@veramo/did-provider-key":"3.1.1-next.26","@veramo/did-resolver":"3.1.1-next.26","did-resolver":"^3.1.5","nock":"^13.2.1","typescript":"^4.5.2"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"9378b451d4907c8d5385f464b27f858547409bb4","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authentication request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst createAuthenticationResponse = await agent.getSiopAuthenticationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authentication request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationRequestDetailsResponse = await agent.getSiopAuthenticationRequestDetails({\n  sessionId,\n  verifiedAuthenticationRequest: createAuthenticationResponse,\n  verifiableCredentials: [credential],\n})\n```\n\n### Verify authentication request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthenticationResponse = await agent.verifySiopAuthenticationRequestURI({\n  sessionId,\n  requestURI: createAuthenticationResponse,\n})\n```\n\n### Send authentication response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationResponse = await agent.sendSiopAuthenticationResponse({\n  sessionId,\n  verifiedAuthenticationRequest: verifiedAuthenticationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.5.2-next.9","_nodeVersion":"14.19.0","_npmVersion":"lerna/4.0.0/node@v14.19.0+x64 (linux)","dist":{"integrity":"sha512-fnxa+DsS59QZtelkuEwVpltm0ppgsnNRjI6GY4rpLexNu6MvaOlMOWVJb/NHxymffWxwowEUVSb7mpViN3NFHQ==","shasum":"55069732a5c1a29deaa8ca3cdc7df7a6e7ccc48d","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.5.2-next.9.tgz","fileCount":24,"unpackedSize":101547,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiGFqCACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpMfQ//eOTQT/zxDbbto7urHZ+5qtuCXZTo9IC19MRD0DX/myDGnJGr\r\ndgeztd/LvM9k9FIzxbHBgu3HDPEeDwlPYJpV224/npZGvNpLrixaCKgQgPuq\r\nyA7adHQpkZBQVL90MhDaHKxgTFQdvh49QmTD+xS2/pQTI65Mw3T9srxH9BgF\r\nxBDtIztSYVGFn+2Ut2YagQ2uqP0hd/givvEkX3vRrXpzJxDrFq4FskJAVxlZ\r\nJUP1hRXtlhAsC5tD/vaOezUnNxs/5u8UQxHlH7dyhHQRPbec08QvMjd0Qyqz\r\n1ZbmZ0fgC48ID2jtoJL5PSJiLAMSUaTkn23/i3yMwbONn0+ayFQptQNgdAxP\r\nrz4Bq5oQIpeEng6AFxOD7IUFNFZYLvhNh+bMeD8HOrcBgAnvfCCDYKlIbqnz\r\nRTe7C9BO0z4FAYmiPBTnoFFmMKpqKXr+YpYUZXGOn8ymD3rvpJ2EdIe8Dotj\r\nSQxfZv7/BkxUq/mU30oz4n1sXy8ME3kSub2JexcogmAPaly6gcZ9YEqz/X0X\r\ndW7lggD1K+/JkMrEc3uOK9gd7iUraAZSTSWzW4YTpJPh3M8g+sPIZCll/ghV\r\nBrNla8IMipvVS92GIi6bH8Zlz9Jen5atL92ni+DfuSXV+ywsMKG2zeSftmy0\r\nmpaFeuB4cRjRdEbpeFVK1VPiRkj/sYp/Kqw=\r\n=QEE5\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDXqHgX0S1TsOh5CQwp077CCYikoy6OHJ+wM2e2pr4SXwIgXnNzANM35z/m+EYO4qvaWnZ/hDJCwTxdIqaQeUPxyLI="}]},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.5.2-next.9_1645763202379_0.16162351953421994"},"_hasShrinkwrap":false},"0.5.2-next.10":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.5.2-next.10","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"0.2.10","@sphereon/pex":"^1.0.2","@sphereon/ssi-sdk-core":"^0.5.2-next.10+f3c5eea","@veramo/core":"3.1.1-next.26","@veramo/utils":"3.1.1-next.26","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.4.0","@veramo/cli":"3.1.1-next.26","@veramo/did-provider-key":"3.1.1-next.26","@veramo/did-resolver":"3.1.1-next.26","did-resolver":"^3.1.5","nock":"^13.2.1","typescript":"^4.5.2"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"f3c5eea0cf6a020c5885b2c9d6104694ded9d0e5","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authentication request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst createAuthenticationResponse = await agent.getSiopAuthenticationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authentication request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationRequestDetailsResponse = await agent.getSiopAuthenticationRequestDetails({\n  sessionId,\n  verifiedAuthenticationRequest: createAuthenticationResponse,\n  verifiableCredentials: [credential],\n})\n```\n\n### Verify authentication request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthenticationResponse = await agent.verifySiopAuthenticationRequestURI({\n  sessionId,\n  requestURI: createAuthenticationResponse,\n})\n```\n\n### Send authentication response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationResponse = await agent.sendSiopAuthenticationResponse({\n  sessionId,\n  verifiedAuthenticationRequest: verifiedAuthenticationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.5.2-next.10","_nodeVersion":"14.19.2","_npmVersion":"lerna/4.0.0/node@v14.19.2+x64 (linux)","dist":{"integrity":"sha512-Gt0kFx9ekmRSrHFDzXico8GCkHhdMpSX7J28yKWAVoHq9e8AvB/YHv5weLScxavKeEQxLqsQMzRP/fA3YNbTEg==","shasum":"c9bdade4ccc6befe84b73ad38c4547bf5daf6828","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.5.2-next.10.tgz","fileCount":24,"unpackedSize":101549,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGqMcaeSSI0oZi1thIR5dQ1M/F6J7pGnAF8uDZI+vjGVAiEAjY52wccLSYoYT5BBu0hCUIy4QR43nwzE/zk3hhQS37I="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJifPlPACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpK7hAAkwc76VdDt3saoYVqt908RmMmA42CLZnfPlhpruzvRcBEUaqr\r\n/aGE9oQpoUb0UjReYsRGRLULzi++xCIdg9to21KLD3FOyWEr6ybImqQQWi8w\r\nNbiLq1UwDjAz5FCDDAKB8tdDgkmyh+dl+Uornvnw7w55kuHrglZQ0Fexghpe\r\nc7GdG/Nyk38+OvtKqkLbRgu2ltRWOkMGQ2TnAhyOBeur91r8ICF7hGbNJ+Bx\r\n7t7CPghO/9nwKqcaA3YJ352DmIAuTLN9CSD+W7vX+khHOpCp0kFtumK3/DhI\r\nGkTjYuLRC7IMASY1WZZU+pPVt/4q7eCkjzlddtIbPmWH4zIS2NWGhMoS+kMH\r\nQfu1KljZeQGClV+rC+JzTBHGnxiOqDeMQmoogv1ZlUl7Wf3f9d2xMTg52SgI\r\n8qoYyBjMuzEe4Z0sX8oqpKXGjfeeoRLH2wbcUpji5i2iuzSfT+QUlLQtN7Oo\r\nNUvYuoVLTCtG27zhODTxD+1DUnVzC5JOMfEoDCWhEZtvsDc6+3e20IzLgSOU\r\nI4UqO9Y9qaB3N97UV4rfEwTPx29JDwOjHzop6dfWoWLEuqhmv78ha4mxTJxP\r\nZzv1V8vrikih9u4E5c2+/N9uksuyG41ov1xof6rqDgL2+i1jGmBVEcedrbMJ\r\nV9jLNQxryOWM7pUgzTmrve53RmkqXeeGayc=\r\n=dqLc\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.5.2-next.10_1652357455522_0.05171072209039629"},"_hasShrinkwrap":false},"0.5.2-unstable.32":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.5.2-unstable.32","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"0.2.10","@sphereon/pex":"^1.0.2","@sphereon/ssi-sdk-core":"^0.5.2-unstable.32+60c4547","@veramo/core":"3.1.2-next.84","@veramo/utils":"3.1.2-next.84","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.4.0","@veramo/cli":"3.1.2-next.84","@veramo/did-provider-key":"3.1.2-next.84","@veramo/did-resolver":"3.1.2-next.84","did-resolver":"^3.1.5","nock":"^13.2.1","typescript":"^4.5.2"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"60c4547240d6c95cc94348e0b42c67fa79091e78","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authentication request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst createAuthenticationResponse = await agent.getSiopAuthenticationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authentication request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationRequestDetailsResponse = await agent.getSiopAuthenticationRequestDetails({\n  sessionId,\n  verifiedAuthenticationRequest: createAuthenticationResponse,\n  verifiableCredentials: [credential],\n})\n```\n\n### Verify authentication request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthenticationResponse = await agent.verifySiopAuthenticationRequestURI({\n  sessionId,\n  requestURI: createAuthenticationResponse,\n})\n```\n\n### Send authentication response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationResponse = await agent.sendSiopAuthenticationResponse({\n  sessionId,\n  verifiedAuthenticationRequest: verifiedAuthenticationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.5.2-unstable.32","_nodeVersion":"14.19.2","_npmVersion":"lerna/4.0.0/node@v14.19.2+x64 (linux)","dist":{"integrity":"sha512-Aft4YquuBTJiTiXnUKzbe1gJN+DJvWesElbPAhfnH3q0qE7f0RqmjnkcUCu5uZrXsgNM++9RBrpWsrPU57N/SQ==","shasum":"28efba08886b8733b99d2a3f7382a80ee6d5e573","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.5.2-unstable.32.tgz","fileCount":24,"unpackedSize":101557,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHumxW5udHg4X3M7x04aoCBMLnFUwRi2LJZOaXnMVUDsAiEAhBh3PC3z1M9N3gcOuv/KqbWKRB4KPz5shOG4/i06Bzk="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJifmvoACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqrpA//boVVds6m1S5QdKuwPGr0B5u8eBzK6X9SmpJMdb6uFz/XIxtS\r\nIiXyOpaqPFLXLLZLA8uJgwx/MYF+0pWC4p/nD0wNB4MKI5VifTq4jAGU3iEL\r\nM5zihJ2DflQoQQwvmVQmFWyn13c0Urdihk1fpN2YTEfSPOFEQMZabQ1GoUtE\r\nReCWcqlf4B9FBO8KGBEyckd258PFTrH0cxlQOk9294j96esjM449Zd7eUNnw\r\n2SrY3CD6dDamd1P0gVfk57bSG2xy6hdU/s/I1rMjQpDT7NkmMEnk7oxB0vT5\r\nN0MBXwWKnCusucO3wqAdSDd/EdwNfWv5SorzhBQOSMRZUrZcoxJ82whXjYGH\r\ns9qE/2KIQhLFUwyz9z3LKGkRGpInlhPnQMMghAO1TdymUZSXYB7635q9i20w\r\ntePe2Z7Rs7njC+uISZS9P+GFcrPKjtWFytNDq6UhwFOjdLwCim8iKtNWb4Zc\r\nd6hy/3svpvE+6+5u3+EmBotrL+pCTQ7bjjPCZ4Top3keqgT9apcB5EOTlfXR\r\nFpYVkarMj3AU3emP22kvjIlf61+00PUe28rkgVpdEfEMeaTMpPrbUbD3LHb6\r\nxrjpFToZbGZPXgH2cIrA+07jXvJzB/9/UMN6aHoK2Cdv3KjKmKBBR7iAakMr\r\nnhCt6pbd9/8qSmHY7cocsunpV6JrJqQ4OVQ=\r\n=zJhj\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.5.2-unstable.32_1652452327995_0.9877923555382149"},"_hasShrinkwrap":false},"0.5.2-unstable.33":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.5.2-unstable.33","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"0.2.10","@sphereon/pex":"^1.0.2","@sphereon/ssi-sdk-core":"^0.5.2-unstable.33+d7bc38f","@veramo/core":"3.1.2-next.84","@veramo/utils":"3.1.2-next.84","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.4.0","@veramo/cli":"3.1.2-next.84","@veramo/did-provider-key":"3.1.2-next.84","@veramo/did-resolver":"3.1.2-next.84","did-resolver":"^3.1.5","nock":"^13.2.1","typescript":"^4.5.2"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"d7bc38f3559aff6e394d32ee479fed861d4d789d","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authentication request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst createAuthenticationResponse = await agent.getSiopAuthenticationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authentication request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationRequestDetailsResponse = await agent.getSiopAuthenticationRequestDetails({\n  sessionId,\n  verifiedAuthenticationRequest: createAuthenticationResponse,\n  verifiableCredentials: [credential],\n})\n```\n\n### Verify authentication request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthenticationResponse = await agent.verifySiopAuthenticationRequestURI({\n  sessionId,\n  requestURI: createAuthenticationResponse,\n})\n```\n\n### Send authentication response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationResponse = await agent.sendSiopAuthenticationResponse({\n  sessionId,\n  verifiedAuthenticationRequest: verifiedAuthenticationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.5.2-unstable.33","_nodeVersion":"14.19.2","_npmVersion":"lerna/4.0.0/node@v14.19.2+x64 (linux)","dist":{"integrity":"sha512-fzsrQEnW7TqSiVqp74Bs23W6PSLo578c9S4lIuSw4vtt6w7TlFPxTT/wGnmRe0GlptqbbgqaH1b7qy5T17IM8g==","shasum":"84ae06cd72b7ace6c6ebb449603185e9444f18c9","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.5.2-unstable.33.tgz","fileCount":24,"unpackedSize":101557,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIB9xFI+4+ZNl4lAPDtJizdm2S12zyDy04xwZoKua2Sf9AiEAqqdFLBroe2f3J/KVEy1s8/A5Nmd+5Y/BlRE5EcIrOYA="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJighnWACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq0Ww/+P8tArLhdpEOay0NGXZiXD5aaK1iDFGGtek8mTAiVyi0umJwc\r\nss1ae6gbAo54UYuPhjAZTrxpKEmZwMiF7t78PSvrHFlqUwkCrzIqTs+Z1zvu\r\nvgbI1pj7k0Le2RRWIxCwHEjM2MBNdu0mbJ5RMKzYCj2O5mPlOTyKlORbYWF9\r\nTjvii9diSG2reKXyKfh1riB3Lqgx3bMbMQXFCeXHP0tQ1w9tsl+VJbTZIxw3\r\n+8LknzKASQLc1v1jnPa7HHn92HBaheT8EII/4LVW3lRtP2+UrBUO7mmND+YO\r\nO/vqG8wNWysKy7LmO51BgkTFhydPvqb5YNe0JTqZOntnm1fPoOs1ZYpaCIVO\r\nbV5leoWpBtTMRXskCs/WIBv6T9ES2KadsXucMhvI75Nc+jW/m03T9Ffrnm4N\r\nzTYxhA/3sUuDFQzDRr4HcCQwaBtmaUJJG7ye4s+DiTEVu0i0hPFSKW841A7G\r\nMDLVCs2frDVTyZ9XGme9O3qLNPDQ8ypTcz1SvTGW+xMv+Fua4vos+QLXi7Nt\r\nXBuMBGwpoybnejuUSk5EELiLdWHYOgZgWPXFcatBcfvJ2AR8LpkHkAdv6VjQ\r\nEaxztO7H3h6DGqt0pN4oLo6w+RRBLGqwC5pwBP7K6y67WGkXyRSgdcY3TGAN\r\nCfYRbrRU+5clkbPzfImKgx8u93khH1RJJbg=\r\n=ZPkJ\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.5.2-unstable.33_1652693462769_0.7410277491360129"},"_hasShrinkwrap":false},"0.5.2-unstable.35":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.5.2-unstable.35","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"0.2.10","@sphereon/pex":"^1.0.2","@sphereon/ssi-sdk-core":"^0.5.2-unstable.35+b16ff10","@veramo/core":"3.1.2-next.84","@veramo/utils":"3.1.2-next.84","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.4.0","@veramo/cli":"3.1.2-next.84","@veramo/did-provider-key":"3.1.2-next.84","@veramo/did-resolver":"3.1.2-next.84","did-resolver":"^3.1.5","nock":"^13.2.1","typescript":"^4.5.2"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"b16ff10bc2c0b7d9ae7237c8a1ecc70b931e7335","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authentication request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst createAuthenticationResponse = await agent.getSiopAuthenticationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authentication request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationRequestDetailsResponse = await agent.getSiopAuthenticationRequestDetails({\n  sessionId,\n  verifiedAuthenticationRequest: createAuthenticationResponse,\n  verifiableCredentials: [credential],\n})\n```\n\n### Verify authentication request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthenticationResponse = await agent.verifySiopAuthenticationRequestURI({\n  sessionId,\n  requestURI: createAuthenticationResponse,\n})\n```\n\n### Send authentication response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationResponse = await agent.sendSiopAuthenticationResponse({\n  sessionId,\n  verifiedAuthenticationRequest: verifiedAuthenticationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.5.2-unstable.35","_nodeVersion":"14.19.2","_npmVersion":"lerna/4.0.0/node@v14.19.2+x64 (linux)","dist":{"integrity":"sha512-L2ScoVrhoKEQcGGmU1ZOTx2sttWsQqcBPuVBYEsQ/eLHsjnUKPjvxsJjGOLw/aOy5JgvCDETtLRoNe7FD8jzSQ==","shasum":"d1b06d9c5a22c6a2acef19ba5fa6557bce077896","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.5.2-unstable.35.tgz","fileCount":24,"unpackedSize":101557,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEsO32/ZK6DPab50QdHFcDEhiEZ0BOqUp1jmjRRtQjXPAiEAq0HiO/Ehg5ArPVgAA4EtnthuWP8CjmqDKDR4Z3i5yv4="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJihKD/ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr0ZQ//fNdEC9Obz/hPXoq7xrXIyaQ8spB6kmMl6XAbLnYqhauGTopH\r\nawJF4kTDKxyORdmkxwD3hnN9hbHjU1JbXWdJ4fhAb+TyeO4t7d/6Wbx+v/PT\r\nxkUagPtSDb2hx1kzC2XigD7fZJ4KO8du2h2BGHlNEgrYd06AV4OmJVuPO/KX\r\nqRfdJJ8/W8CfcDibSJAdEs/c0xHQTopLuK2xeBnR6+gGiTmkRKF8Ple6dy4S\r\nRrsyXiXsIF/xmtcCOmbXKn15vDTcYQxMOcnrkFWDIIF8O7bokWHYb6PSZ0eQ\r\nic2fMpGPpnUl4y1lCpy06jOSeh6ALOmswMdCD8ezVzJaFpY+/3aqmJ95/etg\r\nO929tyRmzYClKdlidmDNgPBvag5yzC3Rh1kKTREPdGeyULRWD+Hds+JiialK\r\nvQlw47zk6EgTXSZec08FVYrRNqKAi2a6qXv1WD7WBwPIotgeIBKB65Otz6fV\r\n00QchlG24m1JPARmoQyZtSHRecaV6AN5auPNPppJShpiDGKJsiGn+BeyiJrt\r\nvKBvzvC3Y6AXuvPqZLtDGISNoT597XB/VYaK6I/4nLCmTdr3wd6o983TlWI6\r\nZzcxF+2/odjjdfLz5u8LdQUUqbT8L5aaC6VFEsuQFXnyWufMKn2P53OH/RRv\r\nbIQDtw0StharKYNRkXNEM/7iESLFkUoD2m0=\r\n=wdd8\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.5.2-unstable.35_1652859135621_0.877482357575222"},"_hasShrinkwrap":false},"0.5.2-unstable.42":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.5.2-unstable.42","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"0.2.10","@sphereon/pex":"^1.0.2","@sphereon/ssi-sdk-core":"^0.5.2-unstable.42+a1ab002","@veramo/core":"3.1.2-next.84","@veramo/utils":"3.1.2-next.84","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.4.0","@veramo/cli":"3.1.2-next.84","@veramo/did-provider-key":"3.1.2-next.84","@veramo/did-resolver":"3.1.2-next.84","did-resolver":"^3.1.5","nock":"^13.2.1","typescript":"^4.5.2"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"a1ab002d995d816a7aa4c549cb6337af214a01a3","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authentication request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst createAuthenticationResponse = await agent.getSiopAuthenticationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authentication request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationRequestDetailsResponse = await agent.getSiopAuthenticationRequestDetails({\n  sessionId,\n  verifiedAuthenticationRequest: createAuthenticationResponse,\n  verifiableCredentials: [credential],\n})\n```\n\n### Verify authentication request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthenticationResponse = await agent.verifySiopAuthenticationRequestURI({\n  sessionId,\n  requestURI: createAuthenticationResponse,\n})\n```\n\n### Send authentication response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationResponse = await agent.sendSiopAuthenticationResponse({\n  sessionId,\n  verifiedAuthenticationRequest: verifiedAuthenticationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.5.2-unstable.42","_nodeVersion":"14.19.2","_npmVersion":"lerna/4.0.0/node@v14.19.2+x64 (linux)","dist":{"integrity":"sha512-LTzfxabYgKjljoDP546OPT+c4w9Bg6Rpcum3djC2c6AlreY2xnvd5OWrF+nUEVAfzeFSZ7AJZ0sh7KoqNmmiXg==","shasum":"45f92dabdb76becfe537b58df7dee3ddf8e109ab","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.5.2-unstable.42.tgz","fileCount":24,"unpackedSize":101557,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIE7NOX0b7yfSuwUI7/NimDXFF4ozDLYjGugl7Jlb36NnAiAjk/fjHAqD1EKEB1Yzw4r6+tKOAXd0fZg1/1oe5MZ/aw=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJihhkUACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmotig//VhBdT5UUdWvPc6on889Z/dIwx3ojPOzpPPWIxAlxZQ0DkTHP\r\nT5n0O/TS0Py+EYcKlt0kltxTjR48nx2a4Mfvh+63ND69ClV29WUwC5NpiuaP\r\nnCBOFD9YoqMDk+RQmJcfQnkOc3G44XWoDe5pkU7VH3s6Hf8TtR2Lw2YzfnWG\r\nmM4lYhUhT4uXGnWqnoI+TbHlHBcSsSP5Qv3KJTqTf2NP+s1kYZmdRKa2v7gX\r\nG8VKYumYSQIL+3VvDx+6NvjM6bjWPSCU318uKrRDGtNJr80a2zKHyIU1ZWXN\r\nXmv2t3/m4l7A5OPAj8LIZD0giBmKcqSzr9YWoBTPRv/daOUEgeSCqey351Jf\r\nx3rqvqTzCTlxUE2goYidLOtcmoZ3uAvt2qKYyIJmicDeD8c2AhIe5+OMpn65\r\nqrWMDg9iQIb851VVJIjgn6nSF8tkCrcvTm0hNhJIOjrfwkjTGupuZHH0y0Gx\r\nlQlF31DB1gITA2QcrNmh9U28XyKFVxqu/JY06qULB80XuS3NTL5vIYEv7Ljz\r\nUw6Hwyc7Nuh7lcGmP7FO7YqO657O1qEhJZgxX/8TeIj3fC9EBy369uS4Qb6D\r\nht3/Y/TohsCw/SRuAx3REIQ/lTO5qjT6R2liD5K13oQqHeQzc+rHRXHYwYWV\r\n7LVJRV7fhNQBM27qjsCN6/VkNyxA3JeA7RE=\r\n=Uv9L\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.5.2-unstable.42_1652955412113_0.948307572224879"},"_hasShrinkwrap":false},"0.5.2-next.45":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.5.2-next.45","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"0.2.10","@sphereon/pex":"^1.0.2","@sphereon/ssi-sdk-core":"^0.5.2-next.45+08a2fd8","@veramo/core":"3.1.2-next.84","@veramo/utils":"3.1.2-next.84","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.4.0","@veramo/cli":"3.1.2-next.84","@veramo/did-provider-key":"3.1.2-next.84","@veramo/did-resolver":"3.1.2-next.84","did-resolver":"^3.1.5","nock":"^13.2.1","typescript":"^4.5.2"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"08a2fd8ab49674cc073b83ebb58ad43a3d2c7ac1","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authentication request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst createAuthenticationResponse = await agent.getSiopAuthenticationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authentication request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationRequestDetailsResponse = await agent.getSiopAuthenticationRequestDetails({\n  sessionId,\n  verifiedAuthenticationRequest: createAuthenticationResponse,\n  verifiableCredentials: [credential],\n})\n```\n\n### Verify authentication request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthenticationResponse = await agent.verifySiopAuthenticationRequestURI({\n  sessionId,\n  requestURI: createAuthenticationResponse,\n})\n```\n\n### Send authentication response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationResponse = await agent.sendSiopAuthenticationResponse({\n  sessionId,\n  verifiedAuthenticationRequest: verifiedAuthenticationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.5.2-next.45","_nodeVersion":"14.19.2","_npmVersion":"lerna/4.0.0/node@v14.19.2+x64 (linux)","dist":{"integrity":"sha512-LUnANW/UiqEfbMqRft7UOzavm92j4Fmi0im1tsAktG/pYlbxnQ4tUJNUZtp98voKTQtpXvXexlfLOzUaR+X2QA==","shasum":"19b53fb4b72267bcd65e15fb9c9e2fe152ae47fa","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.5.2-next.45.tgz","fileCount":24,"unpackedSize":101549,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHKgrLLc7+01byKr5Cy/F24E4W42Xrg2jTRFZpvrY7nuAiEAk5DMeuvUxtXC2SiASQA9rlIp7pgxrq2svhY7Iu6G0a0="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJih5ucACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr7XQ//T+lhJ8hdD/vIr+Hw+PV5ji1cKqSmx7fmneB5nB98h4ISOhQW\r\n7DURC7n9EvnL01JviHUvowSigx4OBeuhZNpN/WHEt41oHadZJperuEGvJbzx\r\nLXSuzOHDdRZgZXvSxN5xa1p/HXAqprGbxITLH3La9tJr9APLoMyhGzCR2w1/\r\njdPI9igncVPBY+toTmtIuD1NRv47cHJlHVAHzcPSdAHAJ/OxOar3m0p6hZbc\r\nPCGTYg4G3duQamSBBSW22GCjD3OcbvJtGOKnZ7WcaCHTLG44WX2sIgR2Nc6a\r\nGIIg0p+aOvi7st+4BXa9AHq+GDnMix54jSllTHWrtnIWBveRrz8mjkw7Pc6q\r\n7DuSHbU0XhNB0hO2cfeadDpCr5RpOuHBAcCq9QmaGrbFQZGzBLfAiSdWHMhr\r\ncD4Boxn/SN3awQ3fJDspG0pOATvJdFbsew5Yjyae3wn4r2gdkMK1QR9JYDU4\r\nd4uG9OT1E8gzusdr2h2ZI+GN1f7NwmakNdaTtAvLO89/yUpcU3CadWGsyOFf\r\nuuik1hqmyDiSbZXYAr8E+1WeOmYYRu1wkXH2akAkYzxkpUVWvzPEuiUKYDC/\r\nWb6TYH3z8LhvuadcNP0vUTbynodbCwaasBj+4VhU0psztrHKr14iBunEe1Qn\r\nOLrWY5FFXIWbMxLnEVFkPyJRM5lxolIqWYE=\r\n=2zWl\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.5.2-next.45_1653054364644_0.14355069307789092"},"_hasShrinkwrap":false},"0.5.2-next.70":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.5.2-next.70","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"0.2.10","@sphereon/pex":"^1.0.2","@sphereon/ssi-sdk-core":"^0.5.2-next.70+2007615","@veramo/core":"3.1.2-next.84","@veramo/utils":"3.1.2-next.84","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.4.0","@veramo/cli":"3.1.2-next.84","@veramo/did-provider-key":"3.1.2-next.84","@veramo/did-resolver":"3.1.2-next.84","did-resolver":"^3.1.5","nock":"^13.2.1","typescript":"^4.5.2"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"20076153a8958b0541d9548d4c980d5b4c8afffa","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authentication request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst createAuthenticationResponse = await agent.getSiopAuthenticationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authentication request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationRequestDetailsResponse = await agent.getSiopAuthenticationRequestDetails({\n  sessionId,\n  verifiedAuthenticationRequest: createAuthenticationResponse,\n  verifiableCredentials: [credential],\n})\n```\n\n### Verify authentication request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthenticationResponse = await agent.verifySiopAuthenticationRequestURI({\n  sessionId,\n  requestURI: createAuthenticationResponse,\n})\n```\n\n### Send authentication response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationResponse = await agent.sendSiopAuthenticationResponse({\n  sessionId,\n  verifiedAuthenticationRequest: verifiedAuthenticationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.5.2-next.70","_nodeVersion":"14.19.2","_npmVersion":"lerna/4.0.0/node@v14.19.2+x64 (linux)","dist":{"integrity":"sha512-5vYfGaq+WzUW5msNibnTVNRjpc4EULDpM0T1R1NhdZRsm5vRRWjIHQ6ZvINrHVFYvSFIhx+FIYS4pdO1JlFXtA==","shasum":"2059f1e6e0f7fdc14ce5ba04fc0df64ae0070f8d","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.5.2-next.70.tgz","fileCount":24,"unpackedSize":101537,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDOvANj1aJgU3KIdfNRd8Yt+OyLKnMHqnfAJPTsKdl1qwIhAL8Iydab2ZPWsy9b+bcrErT16cAJzZAIxXAn+F6q72PJ"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJilfvsACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo1mQ//Tl7z+EuV9S6Zxv192k5o+6EsRbgj6MeAHGJU3yKt8Z8iHnZt\r\nK+wDu4Qj3j/BmKva/M4PXSA5CSuLyBtBmH5yk1IErss+HwXpNspKre+Q65Y8\r\n+YaYlbQco1LmFZGsR8OZz09lEgCYXqqvoK06OKUPbRKCMpaPTDspljj9JinL\r\nAZMgf0X/EDrUefA7GqRK+dh6J6Jk3EDWY0AwM2j1fSOyBCj4pke6uETWrBQN\r\n7zbjwHM7FxpLhY0R5KVfpe6V6rU5tIXNh6ZtxJsbsYwd9ZUYRGOGcYdykbj1\r\n8RrYMDvJfWhPZllX8ramvXVg2cBBSKjZkxf/snIdSEKr3zgezDodEDQVSsMX\r\nY8lu+MsFI36GMm9TgjqgIFTN9BzMr8U6+MQsoOaCLtH3AvFwdoQ8Wc/GC0ET\r\neiE8o+h+wv/YaDLQwJfm3YcAKcQE/3SUn47JjKS35IxJgDcD7h1Me/D/pPZ+\r\nG/oLu789susJUMK5PsNAEu0aekui3M+eZq5RsH9n4nG4bk7lraD/h3XI89yJ\r\nlgbRKQIswUsblMvnO5A/cwh1pfpWTgrx2MwI3WGNcYIrLaZ1Kizx+MGule9B\r\nf5+Oqe5EpcGyz9VsQF2IZjMYPIqugtnLzsIsfIY7c70QlfQoxEknZj6kJ9I9\r\n8SNgYNAeH1W2WTM7blodG7iz/bx5q+Kv+J0=\r\n=e5TB\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.5.2-next.70_1653996523884_0.2079681295290816"},"_hasShrinkwrap":false},"0.5.2-unstable.73":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.5.2-unstable.73","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"0.2.10","@sphereon/pex":"^1.0.2","@sphereon/ssi-sdk-core":"^0.5.2-unstable.73+fcef61d","@veramo/core":"3.1.2-next.84","@veramo/utils":"3.1.2-next.84","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.4.0","@veramo/cli":"3.1.2-next.84","@veramo/did-provider-key":"3.1.2-next.84","@veramo/did-resolver":"3.1.2-next.84","did-resolver":"^3.1.5","nock":"^13.2.1","typescript":"^4.5.2"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"fcef61daf8ec509ee3125f65f114a6b3e9e53bb3","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authentication request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst createAuthenticationResponse = await agent.getSiopAuthenticationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authentication request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationRequestDetailsResponse = await agent.getSiopAuthenticationRequestDetails({\n  sessionId,\n  verifiedAuthenticationRequest: createAuthenticationResponse,\n  verifiableCredentials: [credential],\n})\n```\n\n### Verify authentication request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthenticationResponse = await agent.verifySiopAuthenticationRequestURI({\n  sessionId,\n  requestURI: createAuthenticationResponse,\n})\n```\n\n### Send authentication response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationResponse = await agent.sendSiopAuthenticationResponse({\n  sessionId,\n  verifiedAuthenticationRequest: verifiedAuthenticationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.5.2-unstable.73","_nodeVersion":"14.19.3","_npmVersion":"lerna/4.0.0/node@v14.19.3+x64 (linux)","dist":{"integrity":"sha512-AxEkhjwU+eE9A8VKh6AJjGRTPSTTkD9uBcbuk73qhJo7J6vEz1CpEyZ12PSO8ZgQE32JwRo9ENEtbXHkV9zj3g==","shasum":"e3cf29b0c96a7ff828c18228279218f8e64cfcb2","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.5.2-unstable.73.tgz","fileCount":24,"unpackedSize":101545,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAdhT908nS9RoC3L4vNb6GszhDUgSsbyWk+3JKtEgglzAiEA0npsUxtjJnXUqZWW/pXk3dccXJFOkPavbpZOU+7hR8o="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiquhwACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrfuRAAiNqCRNgbRHvGEWTo3EKbFC7u13qE+x99Eb8pODq0WvGEBr4G\r\nc652+Z2okmlgtUXaFl6DxBwBsZYhf+Hy+a/WWKSiyWTnOnh6rtI/84pqlLps\r\nTf5mfgEyqIca4QSLobTq6CFSJ80zifN3BWbGI8WAdWJXl2tSeB8QkSqXmrnI\r\nlrLuBhE58GZC0JMDWbjmZQq3VPhCzxA0JjkX1tyh90R25PUsKrhABd2S5ATz\r\n623HPrsNciI8R4vGdnUffVx9VmsIhP4pb0A3s3gwSLLE6TgmmhnoRDTuAHhX\r\necdGI+sp0uLEX00EdnnOXbTL79X79kB5z5GwcuU9QL9pUIQRZF+TWq2g5DGl\r\nvKOAmECdv8dlQswtDdEfuvFVsoOVm+ZtrJdqEUmr+TnM/Bg0utBz0+l0s8jm\r\nhnERp85UEtzEWyyxICnrQWICNJlVQ+XZ3XQ0MXsLDWmlyoNCUZ36MgF6TSDh\r\nff1hIsm5EvdoD37ipB9+vHiwFUa07kO3c1VGhqmu6f+ujQBoTUm2MOVe1MBp\r\nSvrzzFQak4DTE8qp2uxAiPKEFHLSiBNHOjq8sqA3W6ZSNKT1WGtyOJaOg7S8\r\nYpXD7+ltRl9E/m0n6z9XvD1DPKk07pwIvskzXCxFEk9DfSNH5uGPrmyRdc8+\r\nsJRjtMWtFFwFHtcLJOD098odiCRlaylWs2Q=\r\n=38n9\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.5.2-unstable.73_1655367792383_0.6883976242111853"},"_hasShrinkwrap":false},"0.5.2-unstable.70":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.5.2-unstable.70","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"0.2.10","@sphereon/pex":"^1.0.2","@sphereon/ssi-sdk-core":"^0.5.2-unstable.70+2007615","@veramo/core":"3.1.2-next.84","@veramo/utils":"3.1.2-next.84","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.4.0","@veramo/cli":"3.1.2-next.84","@veramo/did-provider-key":"3.1.2-next.84","@veramo/did-resolver":"3.1.2-next.84","did-resolver":"^3.1.5","nock":"^13.2.1","typescript":"^4.5.2"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"20076153a8958b0541d9548d4c980d5b4c8afffa","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authentication request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst createAuthenticationResponse = await agent.getSiopAuthenticationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authentication request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationRequestDetailsResponse = await agent.getSiopAuthenticationRequestDetails({\n  sessionId,\n  verifiedAuthenticationRequest: createAuthenticationResponse,\n  verifiableCredentials: [credential],\n})\n```\n\n### Verify authentication request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthenticationResponse = await agent.verifySiopAuthenticationRequestURI({\n  sessionId,\n  requestURI: createAuthenticationResponse,\n})\n```\n\n### Send authentication response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationResponse = await agent.sendSiopAuthenticationResponse({\n  sessionId,\n  verifiedAuthenticationRequest: verifiedAuthenticationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.5.2-unstable.70","_nodeVersion":"14.19.3","_npmVersion":"lerna/4.0.0/node@v14.19.3+x64 (linux)","dist":{"integrity":"sha512-aWFnybx5r775kgro2duOjFViarcNPq4/ZhPo3pcL5yg3+QiXH1hW+92rPtSxffllpJAz7vgmgbMumiooutoMyg==","shasum":"2b7c78668192b7ac2919afa155ad52b8c1179cf7","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.5.2-unstable.70.tgz","fileCount":24,"unpackedSize":101545,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBupaHZ2Bc/aldXPkSb7RnZs2iq3yYBiXI21nawStVYRAiEAw4FMABHpC1Dqgr1yG+YJTjjcHBzMk5eGWcApicd6HOQ="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiucHPACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmqozg/+NVyU8wUDsrWNE/If3VWPUe+MqGt1XYqBKY5MSU0PyJ1r2TuA\r\nPzgj8ArmIpdFKOJfhIkJnC26++D1ztSyu1AAn00f6S6ygBdL/q7Fi5G6ENIM\r\nR7+GLR7P+L5LLA51dB5EdxwJ+nwdEnY22bCOqqm3nAmR3IIUqhwvPfwhu+nY\r\nBdhGbFwdrRglLQizZHSlS2ox+hrVvRZejoSTgISau0M98KCnyvm0SE/u2fXa\r\nyuNKBk2XFo+aXREFmfdAaBC2QATkurm72alrTDfjlhAwx5/3a7j7DkOCyG2q\r\noBxt6mmrlZseqDjSPiyfPYzZQhYDtXzmShMxlTTtoFpJOl+wS8jwKUudhVzo\r\nloBmdkQA7CHrTpBdcQvZItqY8YvCvp7sSaTRobrLBO6jMmVTSJWdtbyR/txy\r\nJWvu4LSYO69xB/sM1osrg+K1Q/J/NZzSs8zZJPDAed8Br1LSo3gPOL6TjUE8\r\nOGksHp1xIO50oV7XvH+ej/+ubMNyJAv02rqyVcvswu/Bp5EJG2KY+QeQuNTP\r\njPurm4Fr/2U1TtC/A+3bGcruoloYpkuvt/4UbitYXrP8549kjNIugDRQLdSp\r\nvJdP9JKGab0VmWgALLnAs5iWe9npsriEF1uNgVE31zFzjQl80hjgySx0BIw9\r\nLlonAM6I1VIU/QhA9zayaU9As2/V7Zx/dcc=\r\n=Fzcf\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.5.2-unstable.70_1656340942972_0.789867797533625"},"_hasShrinkwrap":false},"0.5.2-next.73":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.5.2-next.73","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"0.2.10","@sphereon/pex":"^1.0.2","@sphereon/ssi-sdk-core":"^0.5.2-next.73+6e3e765","@veramo/core":"3.1.2-next.84","@veramo/utils":"3.1.2-next.84","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.4.0","@veramo/cli":"3.1.2-next.84","@veramo/did-provider-key":"3.1.2-next.84","@veramo/did-resolver":"3.1.2-next.84","did-resolver":"^3.1.5","nock":"^13.2.1","typescript":"^4.5.2"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"6e3e7657ccfd52ee13eb8e556fdea5241a160dd9","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authentication request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst createAuthenticationResponse = await agent.getSiopAuthenticationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authentication request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationRequestDetailsResponse = await agent.getSiopAuthenticationRequestDetails({\n  sessionId,\n  verifiedAuthenticationRequest: createAuthenticationResponse,\n  verifiableCredentials: [credential],\n})\n```\n\n### Verify authentication request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthenticationResponse = await agent.verifySiopAuthenticationRequestURI({\n  sessionId,\n  requestURI: createAuthenticationResponse,\n})\n```\n\n### Send authentication response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationResponse = await agent.sendSiopAuthenticationResponse({\n  sessionId,\n  verifiedAuthenticationRequest: verifiedAuthenticationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.5.2-next.73","_nodeVersion":"14.19.3","_npmVersion":"lerna/4.0.0/node@v14.19.3+x64 (linux)","dist":{"integrity":"sha512-8IIvRDKXJne/YrNii2NtD7uBAIebKMfXNYmxMxfxYzsK4e52HLnvFMd6FKsmedRGLyakEw4ntbXSi8x6mFtHKw==","shasum":"6606ac0208a965630c1c42c6bbb39412c8326587","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.5.2-next.73.tgz","fileCount":24,"unpackedSize":101922,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDwwBDp7tG3QPVmtxxeHRT7q7A0bQjak6twQm81VZvGjgIhAJnI9x+HNVup4oqgyx7F/IkLCLR2O7+n1DsMyV4Pu5A3"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJivYLiACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp4KA//Zf1WxHwKnS4eUMIdTJdqsguzDtrOR+z28HNM+MeaHOb/QABl\r\nNFer3/sOSdoHSckOfUr5w6ynSd+xPyOHc/e4vEkaRmPF/alnf161fRv8Cbm8\r\nvfYEEAjQyk4LziJYR2IoHk5/M5f2cyfhXazvGAefs6NR1VbshWrwX9uD9wxx\r\nopctULFxjzYjAMp48rFkqJX02NSfTcHBmxPxFDknh7qgUdUlnfnondDJEJAu\r\nkTuaHHzvsmWx1ofKCJwlhX/1HmxG3Sz/H5iBYzZB+kw0eTtfA+4YipX+jUvL\r\nhnc0FkEphhDOmw5EUvUqLxPNDJprIV4cmAIMnvkMOzqPvISyrq6b/+MZVFUO\r\nnSM20NxkLMaOpUuYeQ0dTz+UWYZyt0torixZsnw6harP5+c+dPHJHt/8A9oA\r\nKs2MAlr7WPPX9yo/Tti2SiWtLOCfulRJdyGy56CewQJSLtxpYaq6NfH4bOeC\r\nILrbHtAy5fo8iM6TqSkxg/Q86m2S+Q+Cc//m0idba0SAIl6RlGW1nPtw7QYq\r\nY2yMqreeMKh0ZMNNkpRFIApEJxCwXylvOaX575322jG/+rqk3UBfDZh6cZ3s\r\naFpa3GAc8OzmUjqLdk2RY3EJLWIVDBGs1FcTWGJ4Go/2uSkMAhCUqoYSs92f\r\n5mHOTmnZz2gBmqx0oD83QwJQTW6b0hBfm+I=\r\n=633G\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.5.2-next.73_1656586978181_0.6629484747143339"},"_hasShrinkwrap":false},"0.5.2-next.113":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.5.2-next.113","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"0.2.11","@sphereon/pex":"^1.1.2","@sphereon/ssi-sdk-core":"^0.5.2-next.113+ce7be9b","@veramo/core":"3.1.2-next.84","@veramo/utils":"3.1.2-next.84","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.4.0","@veramo/cli":"3.1.2-next.84","@veramo/did-provider-key":"3.1.2-next.84","@veramo/did-resolver":"3.1.2-next.84","did-resolver":"^3.2.2","nock":"^13.2.1","typescript":"^4.5.2"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"ce7be9b3403541cf714c5bdc5cd02633c9aaecb2","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authentication request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst createAuthenticationResponse = await agent.getSiopAuthenticationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authentication request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationRequestDetailsResponse = await agent.getSiopAuthenticationRequestDetails({\n  sessionId,\n  verifiedAuthenticationRequest: createAuthenticationResponse,\n  verifiableCredentials: [credential],\n})\n```\n\n### Verify authentication request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthenticationResponse = await agent.verifySiopAuthenticationRequestURI({\n  sessionId,\n  requestURI: createAuthenticationResponse,\n})\n```\n\n### Send authentication response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationResponse = await agent.sendSiopAuthenticationResponse({\n  sessionId,\n  verifiedAuthenticationRequest: verifiedAuthenticationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.5.2-next.113","_nodeVersion":"14.19.3","_npmVersion":"lerna/4.0.0/node@v14.19.3+x64 (linux)","dist":{"integrity":"sha512-d4tjEldLCFgo+23L9KQZqn8G7Om+Cp+RjS/D9fOnTmh2Ckhf9Wc1cuR2mYOahRQnzgGMczZXmdz38RZh8IsXFw==","shasum":"cbf5597bf0dadc5140470f45f1909a5c8da12f43","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.5.2-next.113.tgz","fileCount":24,"unpackedSize":102115,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD+z99h3g8enhmUpXXvyUDA0796xRwGs3MQxAbpBmzVOQIgICvUiUW9LQ2z72VO3BLjCuP50EQjGD4EyzBzP3uWHlA="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiv3SKACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoxaxAAhObd6YThApTjwoxrELVHJVcp4zTp6okjYlvCd8CbmdWMmFhA\r\nVcFZxUWYBijJbOoH7p7AubIyTpehxJuOalze24LUZjaw6UKiMWrZKrDEba5u\r\nqPNECAD9H5vtNYyAi3pvEAWBAhARFrXV0idsOjQ3ftU2tVCxGiRf0WJiyCB8\r\nmtmqm1+C6WfH8ESGd38uJKbj25YiFqM18LgicxBDNJBHIQs8J+sQjwqTranm\r\nzKKh7GoELzUlhKCDbb6jGl94jV9sEi3VxsM7kVYqVZfR/TCR8lUvyLjcyDbP\r\nPOUpKiS6LgcntvvpTllgjnRF+H+BJkTa272h5HnMUUfFTV+yaujLT7Qxa98d\r\nRHYrqvl3IMWyvUJtRlOpaN7JmEfqNuJv4fr07zlgrZlCFK2IInTgiEAi0aVw\r\nJIvkaN6LT6u8q94kjDRm00PuuDTlc1F5hA+skMQv3fSCoTy6E0hfILaCp32I\r\n6WAi1htGA0b4mTO3uJy2fMYEpgW/l2pp/tLFjSMeZDEoeE/a6KhTftTEoMjd\r\ndDcsZetiPAYSgSH2jPmQow/K2ZmRZEyWDKlbVCAdbMMlRtjPC5c1FJLQKEfT\r\nSdP1/3cp+aXkk2KuUIpk+2m7hGGandLcQHwVkIxQ63soRFMDnfXirT5oTC1e\r\nC0hsr/oNVohIRyzxk1C8NoKxebrMEYAY+O4=\r\n=rvc1\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.5.2-next.113_1656714378135_0.2202109453594716"},"_hasShrinkwrap":false},"0.6.0":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.6.0","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"0.2.11","@sphereon/pex":"^1.1.2","@sphereon/ssi-sdk-core":"^0.6.0","@veramo/core":"3.1.2-next.84","@veramo/utils":"3.1.2-next.84","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.4.0","@veramo/cli":"3.1.2-next.84","@veramo/did-provider-key":"3.1.2-next.84","@veramo/did-resolver":"3.1.2-next.84","did-resolver":"^3.2.2","nock":"^13.2.1","typescript":"^4.5.2"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"36f554af6b5c0fad8a7f860b4babcdf10e4174b2","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.6.0","_nodeVersion":"14.19.3","_npmVersion":"lerna/4.0.0/node@v14.19.3+x64 (linux)","dist":{"integrity":"sha512-YupRkvMiLnbcKJWIaUPvtjIVZ1Eshu3VmKdvsN8ETPRTfOO5f8gw97V6HnbgreS/RJkPmyCqGtGNuvLIxJkUTA==","shasum":"e453be065cace2094b3b7a32ca2161576d3ae70c","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.6.0.tgz","fileCount":24,"unpackedSize":102081,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIQDAdKL2Q3x8rKK+y6X+CaTKRC8vcXdqSk4BRJFer7y+EwIfFNDXPzCCS60O4qZtj3iTP97+Wq8zZtG4/TdxhBBS6w=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJiv3dTACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrUTw/+L2pKcfe0Vjgi1k2b+3QX0+aR/moBd+vdnCUg4CiPdCvNA9LB\r\npFWG5zHkC96FaxfN1SQ7N92kaYt72uopzLieAbo0sULHJc+62Ai95LywFVTi\r\nfTQrN6Od+8kppirLkv50Kp8yaol4QpoRzNprN/y0KNmWA2wQJhWG8fCBQKpV\r\n2StfING9TclD+WaYDbDLfwcYDcYkGMeh8Ku8WpeCDouQZBJyxmQ9iJg5nJgr\r\n7uKq96iqeuk2KnPku1qXzXEKBTH/GCJjKURmPaemBwuw2n5Bk1MW1TE+fIkV\r\njTyEuQkoN8XJoNifS+IHXMsu1pA9cxUU/iJVMu3CulakrJs8bUesU8lR/95Q\r\nkZ4+NtPE0fnIOFIBWxKEHp0lNG4EvIHXJgvC8hiZvzP85KEvnWy8Uu3RZmCM\r\nE7V9Q2o7cUuPf3DrHHfEVsHlJws8Nb1w+J3C2/cEZNAC6nwCTuXkt5HPC0PT\r\nlGlCm9esI3uD7HnTiY0ateWl0UCatYLUCPOxCK0mUcKn6rcD12eqSXgZgaxH\r\nlq9PMTljCNNLtpzENr44UJ8QpmJBrqIKWPPhok0il8YJRqadhN0MjEGBUdhE\r\nvco9qmmlEdvRX1YCYMM6iroqTA/JuvxVKalK6ad1A9jMbEXGBtP2zEAipfp8\r\nFbQ6vSY4MnPScDRv+JmHs0/ENSIAyZ4e4fw=\r\n=dDgt\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.6.0_1656715091803_0.8616263370894246"},"_hasShrinkwrap":false},"0.5.2-next.116":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.5.2-next.116","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"0.2.12-UNSTABLE.0","@sphereon/pex":"^1.1.2","@sphereon/ssi-sdk-core":"^0.5.2-next.116+1cf21f8","@veramo/core":"3.1.2-next.84","@veramo/utils":"3.1.2-next.84","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.4.0","@veramo/cli":"3.1.2-next.84","@veramo/did-provider-key":"3.1.2-next.84","@veramo/did-resolver":"3.1.2-next.84","did-resolver":"^3.2.2","nock":"^13.2.1","typescript":"^4.5.2"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"1cf21f8a17f99d49479db556eb6dc70c30dc8cfa","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authentication request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst createAuthenticationResponse = await agent.getSiopAuthenticationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authentication request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationRequestDetailsResponse = await agent.getSiopAuthenticationRequestDetails({\n  sessionId,\n  verifiedAuthenticationRequest: createAuthenticationResponse,\n  verifiableCredentials: [credential],\n})\n```\n\n### Verify authentication request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthenticationResponse = await agent.verifySiopAuthenticationRequestURI({\n  sessionId,\n  requestURI: createAuthenticationResponse,\n})\n```\n\n### Send authentication response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationResponse = await agent.sendSiopAuthenticationResponse({\n  sessionId,\n  verifiedAuthenticationRequest: verifiedAuthenticationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.5.2-next.116","_nodeVersion":"14.19.3","_npmVersion":"lerna/4.0.0/node@v14.19.3+x64 (linux)","dist":{"integrity":"sha512-dNTOwIzcv6QdD40jXs6kNf8sltSIz9Cl5V6bk//oQ/66AQcg8MMbjZk5I8wMYheLeFGWmHyM8t0MxFCLvZOREQ==","shasum":"1921aecb8858b5d407ef494c95d48818df643147","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.5.2-next.116.tgz","fileCount":24,"unpackedSize":102126,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBenf1vPhiWX4Nv7DHJ81lF40bRGcG6a1xQy2OxTdg/rAiAZm4hp9G4tJ9oIYED9gpE1/u3s3+4/f3sGnd+RF6kTvg=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJixNLYACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmolFRAAhsvFS7T/kGnNDvq3o8hmlB6fYePCMLX3A7tdp1kXRJyrygJY\r\ntDnMP/gjiFKBOQfc25aKpJZq6AWFCATEgTfCesgcqBRrqpn9SCHVMDp7RoS4\r\nJDstloXff5rIP8jaDuPpJZ3JThjKvdCk8C+0SO2wyqZld70tAZbCsxGhQqdj\r\nZIbPa3Mkz11VuVBS0B7gziUcjqm1u5jA0OlrFd3BfoY+e1UDRMfMtHEQWjbz\r\nyo8/DMFa0DMTPAuxl+q7cDhOE9rRkyjBx+CRuQDVwBoHesQ0ThYtiQCD0iNi\r\niUG5EsCkoGCIKDhp02dGfedOAHguBq8Q9CFjDHvFp9RwM7PU+d2ptfg5YSh3\r\nIPm59K4FPSeAQIR3Z9QsBeAMGsWkyPupCmmSZ5zSi7yxaFrN170RClH9zCb0\r\naodtpw2TTVRKWIwcoQv26bEruIlhxmlV0Ay4jTfX1SMcbVi4VAUEGThUjVyR\r\nHCcIZkbq6Ud7OGrerz2eegbL7mqm6EmV5WYGhd5YjGjSxoeumy5BMHkQPaAK\r\nG51LB7AzY5oU9/zi9voMS3dPP0pbboBoKUsmbSvnSGxdmKgNhq+L9KcSYqkK\r\n8SRewq7f+eD8NA2n3Hh63GPUFSEzNPVF3QlMyanesjIUtMmwJF+OmfJrcV+7\r\njvskzDfnYov2oD9vZRL7bG6b7HKU5SeAw7M=\r\n=s0Yy\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.5.2-next.116_1657066200448_0.4921315680602312"},"_hasShrinkwrap":false},"0.6.1-next.6":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.6.1-next.6","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"0.2.12-UNSTABLE.0","@sphereon/pex":"^1.1.2","@sphereon/ssi-sdk-core":"^0.6.1-next.6+d455c9f","@veramo/core":"3.1.2-next.84","@veramo/utils":"3.1.2-next.84","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.4.0","@veramo/cli":"3.1.2-next.84","@veramo/did-provider-key":"3.1.2-next.84","@veramo/did-resolver":"3.1.2-next.84","did-resolver":"^3.2.2","nock":"^13.2.1","typescript":"^4.5.2"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"d455c9f6b3bfdeda0a399bf183d3b29ec6b02df3","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authentication request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst createAuthenticationResponse = await agent.getSiopAuthenticationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authentication request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationRequestDetailsResponse = await agent.getSiopAuthenticationRequestDetails({\n  sessionId,\n  verifiedAuthenticationRequest: createAuthenticationResponse,\n  verifiableCredentials: [credential],\n})\n```\n\n### Verify authentication request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthenticationResponse = await agent.verifySiopAuthenticationRequestURI({\n  sessionId,\n  requestURI: createAuthenticationResponse,\n})\n```\n\n### Send authentication response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationResponse = await agent.sendSiopAuthenticationResponse({\n  sessionId,\n  verifiedAuthenticationRequest: verifiedAuthenticationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.6.1-next.6","_nodeVersion":"14.19.3","_npmVersion":"lerna/4.0.0/node@v14.19.3+x64 (linux)","dist":{"integrity":"sha512-po+P2XfdCEqGaB8bqHDmNHfpr3mfgF8Qg9SSvtydTGKx3u9F0bZESvQOI+Tc/rHDhzkPQ0Joz5ZsTvVekgCFfA==","shasum":"ab17a1f12f945653507963740210fb16a89e4268","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.6.1-next.6.tgz","fileCount":24,"unpackedSize":102122,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIG2i8QRm7cV7YqFSpoHMvDG4zZNj8r2EIgaHDfqk1VYWAiEAgATopcCWigj8jJgK7QkUxPbq949aSmtkmfRRzGgHwyk="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJixNnhACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmrczg//ashdzT7dAHYIIcsGIsh8sk7ECAqsVroCv1C6gHlDq6RXs8aF\r\ncOurZ1Dnlw78Ku/jh0eSZNrsLR40gOxXKB1btJ5ftP/RRnI1K89wamf/Gy2k\r\nNHkOmyXorB7UuSfgh68k0fXvJjx9vKPtRQjASZ73QOqT54Qp1ij+gh4Lq/Xz\r\nU/P2PbRrJUNXXD+jO35VbT17bB7IaydkEf8YNOADLY8VKcD/jMX4geZdMybt\r\n68cv33hKURKr5apqaLx/2mlSu9IHiIWM48aRFSsTTsf5DRk5KRdyznPh00NH\r\nxNOXyCuV6fW7zu2y13syF41ka1oeBSbOSQ/6G2sZ+oJr57RDc4W2KrsBgffu\r\nMALrutX3C+L9DihDiWj5N8OUPqTBMAd8+iZyl3/WnVHdapvb+pvkm3iXgdsf\r\n4ysJq6nrEQBWVXmB9gs2HzPjrTUq19y4EXnVNp2TaVbGqtMfZb6k4pm6LIZk\r\nVshF2FWq5+d7EtwGdv0hxUORXZtOwgVsNkcDe7/b0Zd6E302G+Jjo8LKXpPe\r\ni+Tei7J4KHj+QOsZ/vAP0f8PLnL0HIECZSaekO6fKO5yrXwcFKeRaZHnLL3G\r\n3vZgwpfQew3juTMy7lz9Q3QpeamXHAuWvPudZm3jqraj3Ig0+9wB8m+uh1LK\r\nnMTBU1GAndVSYBVKXEbIN+3PBZGwDSwR0fY=\r\n=DNqK\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.6.1-next.6_1657068000734_0.6372855233217762"},"_hasShrinkwrap":false},"0.6.1-next.8":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.6.1-next.8","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"0.2.12-next.4","@sphereon/pex":"^1.1.2","@sphereon/ssi-sdk-core":"^0.6.1-next.8+873e8b1","@veramo/core":"3.1.2-next.84","@veramo/utils":"3.1.2-next.84","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.4.0","@veramo/cli":"3.1.2-next.84","@veramo/did-provider-key":"3.1.2-next.84","@veramo/did-resolver":"3.1.2-next.84","did-resolver":"^3.2.2","nock":"^13.2.1","typescript":"^4.5.2"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"873e8b12f9c20604eaca3f12fd439eaf10a7d68f","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authentication request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst createAuthenticationResponse = await agent.getSiopAuthenticationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authentication request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationRequestDetailsResponse = await agent.getSiopAuthenticationRequestDetails({\n  sessionId,\n  verifiedAuthenticationRequest: createAuthenticationResponse,\n  verifiableCredentials: [credential],\n})\n```\n\n### Verify authentication request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthenticationResponse = await agent.verifySiopAuthenticationRequestURI({\n  sessionId,\n  requestURI: createAuthenticationResponse,\n})\n```\n\n### Send authentication response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationResponse = await agent.sendSiopAuthenticationResponse({\n  sessionId,\n  verifiedAuthenticationRequest: verifiedAuthenticationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.6.1-next.8","_nodeVersion":"14.19.3","_npmVersion":"lerna/4.0.0/node@v14.19.3+x64 (linux)","dist":{"integrity":"sha512-ar0FldQq2A3zN5vOnO7xHpSsZHIJZVVniH7DMS+gWDxUj/RA3RW4Pl3XulIOx+TURLQCb/6ZUrVpUK5PGumjGA==","shasum":"80083f4f1a7869de138edd3fc67bb783d7b19a53","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.6.1-next.8.tgz","fileCount":24,"unpackedSize":102118,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDz4xsIbNdLrfcfqwdqcDHJ529SzGME9FBK1DKxkeWQwgIgNnbLyJZtWLfNs+5luJS5sVFSoIqxyOQLwKMte2M8iqQ="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJixgIfACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqnmA//SOCwd6IDV6O22vYf9TFc9JUQw4RRMHzc+ayl7GqPXxyPXXiQ\r\nhHfb70Lpr9betW2vrGzUXoKAfEqrWWtD46Tqf3KIKAcapcHWuuNLTMzlk4fL\r\nQBZn0BYh+YT6o459qfu9tLDArxtwogfuDotQeqJL+sx/BjZ9xcdy4oNVbMVW\r\nreQ3/etpkIPUuzkFzdB5A5tW1s8sp9RjAKLBddMSpyv65miJXkjtDidcR91e\r\nMdhv2Ht/Fq9X9fTWoEHqAPbgXCQSvir36EHVFBh/wkTPE84T28kPGA8z6OWR\r\n1TVqk0w6hzRx+CEu6zcIGkEAiQuMiYrjl7x7QsiOFTA7XGJrab9j5XNLKwo2\r\nOtIifwC3EXNJegfXMOs/YxvxQDObsmYY9gGkj1ODyFzCcFcmN5f4BH7PzzZr\r\nNl9tMCEa088fDK3x4hrzKLBecyizTj1cIRcTfBzPpUFK6orV0FOr2x6dWEFZ\r\nrKFQUDTu1UsEDsFm+s5MairklUhcl4RCCb1hDIowsnqkm05gtVQkxLFyr6Mj\r\nwEpGR6xME2NpowOqhmJskF7jzXuHuhBYnIkoSueRYQscblWurRQAEkqqPlKT\r\nUT0LrgjpeiWbJyXnF7JvQ2ScjXL993qPwJrcOsQgo7AIiyRE1OHmaqsGUAY1\r\nbWGM+4JKSRtf/0AiTZrz3ebWE9J7L/+HH48=\r\n=OkTr\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.6.1-next.8_1657143839592_0.8483608789713208"},"_hasShrinkwrap":false},"0.6.1-next.9":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.6.1-next.9","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"0.2.12","@sphereon/pex":"^1.1.2","@sphereon/ssi-sdk-core":"^0.6.1-next.9+ca83b93","@veramo/core":"3.1.2-next.84","@veramo/utils":"3.1.2-next.84","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.4.0","@veramo/cli":"3.1.2-next.84","@veramo/did-provider-key":"3.1.2-next.84","@veramo/did-resolver":"3.1.2-next.84","did-resolver":"^3.2.2","nock":"^13.2.1","typescript":"^4.5.2"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"ca83b932ac3a56e223cb63f8dbdefdc0ae3f0d62","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authentication request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst createAuthenticationResponse = await agent.getSiopAuthenticationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authentication request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationRequestDetailsResponse = await agent.getSiopAuthenticationRequestDetails({\n  sessionId,\n  verifiedAuthenticationRequest: createAuthenticationResponse,\n  verifiableCredentials: [credential],\n})\n```\n\n### Verify authentication request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthenticationResponse = await agent.verifySiopAuthenticationRequestURI({\n  sessionId,\n  requestURI: createAuthenticationResponse,\n})\n```\n\n### Send authentication response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationResponse = await agent.sendSiopAuthenticationResponse({\n  sessionId,\n  verifiedAuthenticationRequest: verifiedAuthenticationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.6.1-next.9","_nodeVersion":"14.19.3","_npmVersion":"lerna/4.0.0/node@v14.19.3+x64 (linux)","dist":{"integrity":"sha512-HpqiweO9x75HTubghPLrI1kqF41cUO0JF3s82eunzoAVsLRtvTF6OxyOxuuf1o6zQhQ1XskqnpLqZcrIyFU9bg==","shasum":"db4758d4ff87b8ff952acfad8969357fe3a68c92","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.6.1-next.9.tgz","fileCount":24,"unpackedSize":102111,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHN5Oh40DPE7XaX5Mo4h6Wq1Nt2T6tibOaCbvyBKILBzAiB078sFuJJQfLLbdxc1iLDpkzDwZW3PJh94vTzZEDD+0A=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJixgoIACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrvYQ//VMxFILdNBB8TaeYyhagAxc21OX4EvuMtW94fK0Dx3i0TF2+j\r\nxmpvQ+RMlCpIv+hy9KNW9nk1/dPZAspIRJGc+UXJ7Be7dn4K4uww3oC496ly\r\nqA37qJagkN+kctAgSk3r1AceAnq60iAgM/xTLJOCdu18HwaMt5YYNmZA25II\r\nn64onWoACKNJrLfPAcCgpiG+hq2rv/SsRRF5YB2Fg4tFvWaUTmyuPUEK2mHH\r\nuj5XYaK5AePft4iY+DZhuGrUOU1CaBiONNajA6/S6Adcl1hal8FZ847W+2h1\r\n1dlFBktriklJE9ykYuQi+1sjoCGO7FwftXMofCzhNBGVavjp7OVrUqG8C+50\r\nZ8zZuGLoF4fUjGA3zRAkxsjCwr4Kh3olvQVjWMSNHopxpvTFXOdy2UPoYrxC\r\nPPvTJkeFh9nb+9wI2aehoZ+fMAN6eye3hrg8lsl91gZIpXlXgk3iS4t7Tk6C\r\nZmUzlCiCs8Z3Wi62tOZIrR2PGd/m2pdFtz0F4lEZe5Js7yPRPBBO2OhEy3+Q\r\noMP7EOHOxEwiQVLBQmU5xE1QVHO9riNVzBsd0hUyt/zP2+7qT7xEUFHCreod\r\n59z74QZG5hMsWNsfb08dXNoQDqtsKwXA4biOVMOZ8WIGgI+gjzHeaQudKwmC\r\nhUdIjOxySwh1KKUEmtAaQ5b21rZyWOyw1Ik=\r\n=m7pO\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.6.1-next.9_1657145864383_0.8925655295948842"},"_hasShrinkwrap":false},"0.6.1-unstable.49":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.6.1-unstable.49","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"0.2.12","@sphereon/pex":"^1.1.2","@sphereon/ssi-sdk-core":"^0.6.1-unstable.49+251ed60","@veramo/core":"3.1.2-next.84","@veramo/utils":"3.1.2-next.84","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.4.0","@veramo/cli":"3.1.2-next.84","@veramo/did-provider-key":"3.1.2-next.84","@veramo/did-resolver":"3.1.2-next.84","did-resolver":"^3.2.2","nock":"^13.2.1","typescript":"^4.5.2"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"251ed60ebd6984d5fe494a764d8cd662dd0eba6d","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authentication request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst createAuthenticationResponse = await agent.getSiopAuthenticationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authentication request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationRequestDetailsResponse = await agent.getSiopAuthenticationRequestDetails({\n  sessionId,\n  verifiedAuthenticationRequest: createAuthenticationResponse,\n  verifiableCredentials: [credential],\n})\n```\n\n### Verify authentication request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthenticationResponse = await agent.verifySiopAuthenticationRequestURI({\n  sessionId,\n  requestURI: createAuthenticationResponse,\n})\n```\n\n### Send authentication response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationResponse = await agent.sendSiopAuthenticationResponse({\n  sessionId,\n  verifiedAuthenticationRequest: verifiedAuthenticationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.6.1-unstable.49","_nodeVersion":"14.20.0","_npmVersion":"lerna/4.0.0/node@v14.20.0+x64 (linux)","dist":{"integrity":"sha512-WlxZS/oGhtA6htUkm41jmo+yhlKV9q5CKpjqx2G0CBEpOZExb5IopKVr0muq5oKvZ8ZfRCAcBVN931AVChN9ig==","shasum":"5d8a47a8c248595d477a83a61e68d5b0971e8cfc","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.6.1-unstable.49.tgz","fileCount":24,"unpackedSize":102121,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBdcKEXqKAMOExqCiSHSJgOcnruVwvbopuyRdgT1Ic9zAiAjBIr67afKDuSoq1TJNFwzxgtOu5nRd/J0rgKZ7QmI5g=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJizfmXACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoDVw/9HoR8P4sIDfFhCOzcBHT+r1LZB90Cl5bfA3RpwM4bGqqlffir\r\n13a5QA9MCeNeIT2i9fhAkgXiRJmY5wZ+9vQr77uZE9An1uNtq0t5esGlsLcS\r\nj2Q0vbSKyyeaI1pWFaBEMJaGFRx1luC/qI+N5MqgOYBgGsSNuXPmM+9cqZ/N\r\nBkj8MJTNMsPK/5HMCMB5L82+O5MiBLKNLJGxzeSTUi8lxOTrClAo9fQIV95o\r\nzz0/7O9QH4UxAazb/BcVlHxslOsVeZXED+2i3bidG9VyYgWCNZA8T1Nn447k\r\nV9qV4S+l/FenGWWvnaO+nRkSEjcFCsw0pNEiy8Yk8IelE8iItNkfsELjTyDx\r\npC9krahQtQLjKbTRTjjtewX0RDjWUzVikuhHm6QS/zWZ/AGiztY6aDvK3Pqe\r\np8OFnIksYqhvCleKqaqbU0pvsljHWt6LyynUof3k2PV2aDIzBm417KmsSoTN\r\n8IJJLTA8DDKD6St3lpJFyXPG92bj4ZHP/yWi/Co4VpsncUxdYxFeAXgVlZL4\r\nCvj9aphBeclaMn/BpscruP+FIPAPNtNAflFHrtFjjbhKq9MB9JhJauYbS0A4\r\nbbhfjGlY82SI1xWnn5ynwVNdw/qh9+USe4AKtYiKUjY/mThX0AnODU/wKtjV\r\nm6VazwDL7DHFIriqq/bG8HwT7GJBXfPLSgg=\r\n=3pUi\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.6.1-unstable.49_1657665943577_0.5650466968328784"},"_hasShrinkwrap":false},"0.6.1-next.50":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.6.1-next.50","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"0.2.12","@sphereon/pex":"^1.1.2","@sphereon/ssi-sdk-core":"^0.6.1-next.50+5ae3140","@veramo/core":"3.1.2-next.84","@veramo/utils":"3.1.2-next.84","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.4.0","@veramo/cli":"3.1.2-next.84","@veramo/did-provider-key":"3.1.2-next.84","@veramo/did-resolver":"3.1.2-next.84","did-resolver":"^3.2.2","nock":"^13.2.1","typescript":"^4.5.2"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"5ae3140c252b6a3d90194fc3c57c00d2494cbd9c","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authentication request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst createAuthenticationResponse = await agent.getSiopAuthenticationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authentication request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationRequestDetailsResponse = await agent.getSiopAuthenticationRequestDetails({\n  sessionId,\n  verifiedAuthenticationRequest: createAuthenticationResponse,\n  verifiableCredentials: [credential],\n})\n```\n\n### Verify authentication request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthenticationResponse = await agent.verifySiopAuthenticationRequestURI({\n  sessionId,\n  requestURI: createAuthenticationResponse,\n})\n```\n\n### Send authentication response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationResponse = await agent.sendSiopAuthenticationResponse({\n  sessionId,\n  verifiedAuthenticationRequest: verifiedAuthenticationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.6.1-next.50","_nodeVersion":"14.20.0","_npmVersion":"lerna/4.0.0/node@v14.20.0+x64 (linux)","dist":{"integrity":"sha512-LKHoi3TUPJn83C+vjmFuLiBGVjtuL4t4VnxHmbme58H47mAR57aKp5DgGguMb7l3flp5wMQZjIxXXhyjyIrqxg==","shasum":"d5b4e2829ddafa82f89513dab51fea8f3e720409","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.6.1-next.50.tgz","fileCount":24,"unpackedSize":102113,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDUHj/LWckrbgGd/6e9tGK4Xk9qVLIhcmTV1Mt5Qm25DgIhAP/cjsSju05Lwm/i10GDd+89ubC9qQpptwQNNa1qwx3E"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJizfycACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq2PA//QxyIE490ZZZHzv4DA6l4eb6FOQvBME7hCnVDD3VADbJZcdXl\r\nlkYZzhwlu8fdJSzPEBhymGlKXsrMjMPRwxAJvt4lFzXYvT199TYATI7htt56\r\nx6OA58Tty3VUY0/ftyaS7kb/rrTDHWDKUiVsxRJ+FFPzY2/D4twT0ZK2LKV5\r\npvDP+h2ZsU7BSCg1PxeQ5SyczI+fa8gAZPFtOrNa7hUpbN9u2nT6wrfbHUJP\r\nGIAqNqyQGeb7NN/BYv+GCy4guBpAi/fYCn9S7iTKUEXBQPZ/W4cuSvNP4//P\r\nFYuuZV75ubOLiaAc4zY6zHeqLbat2YnURA16eqSPR0Fe7nZkkOCC2Jm4qKcZ\r\n211tQd9ShA3MYrhm9cS8rbsIcdO8Ep6O8E7o/Zisbez/hxDEgdKaeMkoFEwW\r\nRhbkxpOoEXr2JOvJWJwLqhKCoQwya/A90rcfvis8ETUdSiXAkZDzEwjCMQQn\r\nnKMpmI8szLighV4LURo2J4JnrsvQ8Gk70Xu8VHh/F2luHGwH0CwJ6UtyBaQn\r\n683sLX/bP2NJtwDHYSK/v32fExfcu8/bNRRF3qhC39dYuOpLRTPaO1HoqT9r\r\nEm9x9bynm1awjPLNJUcjiRc6nbXnpgvJQxxNd47ZlK2s/8kRCvrHKEcLQ7YM\r\nFwleM6yFYj+Rbl+OJ+VuqSjectZ90W211mA=\r\n=nF6x\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.6.1-next.50_1657666716225_0.0014940763507957922"},"_hasShrinkwrap":false},"0.6.1-unstable.63":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.6.1-unstable.63","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"0.2.12","@sphereon/pex":"^1.1.2","@sphereon/ssi-sdk-core":"^0.6.1-unstable.63+a709ce6","@veramo/core":"3.1.2-next.84","@veramo/utils":"3.1.2-next.84","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.4.0","@veramo/cli":"3.1.2-next.84","@veramo/did-provider-key":"3.1.2-next.84","@veramo/did-resolver":"3.1.2-next.84","did-resolver":"^3.2.2","nock":"^13.2.1","typescript":"^4.5.2"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"a709ce639056f768745bf9faf7388f348cfa4a62","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authentication request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst createAuthenticationResponse = await agent.getSiopAuthenticationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authentication request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationRequestDetailsResponse = await agent.getSiopAuthenticationRequestDetails({\n  sessionId,\n  verifiedAuthenticationRequest: createAuthenticationResponse,\n  verifiableCredentials: [credential],\n})\n```\n\n### Verify authentication request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthenticationResponse = await agent.verifySiopAuthenticationRequestURI({\n  sessionId,\n  requestURI: createAuthenticationResponse,\n})\n```\n\n### Send authentication response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationResponse = await agent.sendSiopAuthenticationResponse({\n  sessionId,\n  verifiedAuthenticationRequest: verifiedAuthenticationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.6.1-unstable.63","_nodeVersion":"14.20.0","_npmVersion":"lerna/4.0.0/node@v14.20.0+x64 (linux)","dist":{"integrity":"sha512-bm4oqOjiScmQtTNm4QIwzYmlrvmT+Se46mI4Kw1m/3HoVLtsWB5HCmyhX2RXSsqZBH5PaqsgwHx3DgJBMHphzQ==","shasum":"8f5d0d27e0b1f73342dfc35f2d3dde26753e013a","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.6.1-unstable.63.tgz","fileCount":24,"unpackedSize":102121,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDlHD/FT2hmWRKhXqija2H+2eCVcPnKy0tfaN3YjRrd+wIhAN4LkdcoHNy90YZr0MIxFW7LhltrGd3Srcp/wHmfV0iA"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJizoLVACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq34A//TT+KngdNDGqLt7PDeo3dnnG9ufn+aSJK23auV7I6bX9BCcXx\r\neihEPUiWKMjxEUdx0aUSi2jpURh0AXzl8A+35b+DQAARcqdEtT/gTg5J5o8H\r\nU856kf+6WFTH7v9jj/noZDQj7pogMy55DwPlxE7oK0Dp1sw0AtrzNxyvtCfp\r\nlImbzZxX4Ldr0fAmpIra3OErymj723LjJqdnB6cIwmQ2sl2QREvkxBv2HJyB\r\nlrlLClXmOknsf7zWeiEpJ8F3b7zX9f7F8sqY5it8aYjS5pxzXvLsOCg14lAF\r\nbDn4/Q4zQPzB3Et7vn+2Ko4seomGUzJ/1RXpHN5Wl+X/IEZj2btQxWEt5QvD\r\neGMZljRfIceR+nb7uDouROSHhbLwWWKKz7jRm6W4Ato5QKC5wITS+wlPQKTL\r\nbFmIHTalwoYRASB6wAKpCBbBKakCK2kvpkOEi+wnuUGZq8lN4If57EBoW6SP\r\nzwvpjvHFbQQhiOCbKODhXx1b7RDMkvigy0P2HL49sgfRT+UNuQ4CE0Dr94x6\r\n1CzDmgMMKYZ3PFdjwDsplVUCowuYcoqPJR9JPXEf65RDFejSJQtCTCUG1OIu\r\n3VKWKrcZ5VpE1YJuZYgrU77YycCTRLa6TuomwJo8LLSrQ00AbRent7q7oWE+\r\n3Gbp8EfSqW2YixnemhGy1bECHpg9V0ricR8=\r\n=QNu+\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.6.1-unstable.63_1657701077072_0.7751106363617948"},"_hasShrinkwrap":false},"0.6.1-unstable.64":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.6.1-unstable.64","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"0.2.12","@sphereon/pex":"^1.1.2","@sphereon/ssi-sdk-core":"^0.6.1-unstable.64+8b69827","@veramo/core":"3.1.2-next.84","@veramo/utils":"3.1.2-next.84","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.4.0","@veramo/cli":"3.1.2-next.84","@veramo/did-provider-key":"3.1.2-next.84","@veramo/did-resolver":"3.1.2-next.84","did-resolver":"^3.2.2","nock":"^13.2.1","typescript":"^4.5.2"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"8b69827a11b02c26a1aab59cf8e37ed50c6b59ff","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authentication request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst createAuthenticationResponse = await agent.getSiopAuthenticationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authentication request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationRequestDetailsResponse = await agent.getSiopAuthenticationRequestDetails({\n  sessionId,\n  verifiedAuthenticationRequest: createAuthenticationResponse,\n  verifiableCredentials: [credential],\n})\n```\n\n### Verify authentication request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthenticationResponse = await agent.verifySiopAuthenticationRequestURI({\n  sessionId,\n  requestURI: createAuthenticationResponse,\n})\n```\n\n### Send authentication response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationResponse = await agent.sendSiopAuthenticationResponse({\n  sessionId,\n  verifiedAuthenticationRequest: verifiedAuthenticationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.6.1-unstable.64","_nodeVersion":"14.20.0","_npmVersion":"lerna/4.0.0/node@v14.20.0+x64 (linux)","dist":{"integrity":"sha512-xwyw/qD2MQIOo6rKQ1muB4L6dmBLRr1hqVCQZMUgl1n+xELpvAcjQVIdI04lglVeH8T3hC6Yca5zFMnK3A1Z/w==","shasum":"d650024cff78f1ac10dc71b10b542f04e8db61d9","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.6.1-unstable.64.tgz","fileCount":24,"unpackedSize":102121,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHWgBxN3CNLZK++uWb87dOn6QKQ1UrUAnwyMwkLhqwYwAiBavDTQwopN7KYaQmvA2KmHfA2Z5WB87KA4eXf4KppUSg=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJizqe5ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp+3Q//SU8aRhLY/+irHfBK9c8ADEWOrn5LhPu8MMpXp43nqVd2oznc\r\nUbInagalLb8npemX7AqEUuwbRTgIh6RYhXVzy9kB9wCw1V2n4waaXaL9n4Vw\r\n7G4MV3u4VrYc5PEJcTHDahgFTH2dalbaRvXN/bpYFDx+ht7lyQzQlRMA/jRt\r\ncOoNdzQdh9dT7tr/xvq8ZOzURR2ihKhjilXqV6A6npm/T3681RVA4taSmQPY\r\nMXdxiUlm5fEdIZgV4DMR3xNwVvSz1qfqYi6m2BBXKLnBsRG2y4gUDaWkAw/t\r\niiXvR0Ym1z4UczKwesn1P3QhNdhV/eCuHNAawZS2LO5qmi5lI2oS5oiwaIxm\r\nFfwoO8sQBzjfwMoeN3nrYzGfdarTx9YuIe6h1RpiFC1BpoUpf3gNm+uCxhA6\r\nUInzPS6NhBD9dey0hm1hxMMbzIM3tj703v88ytUG8bstpgVHpjh2e4+0dNBq\r\n6M+G9oIkQEk25J3pODDoF7Jds89/dqxzNHCGr1CfSZNus6SlS7wurGo/qpuE\r\nmLoST+yPb/V0FFy9dhhCnHWDk51QNLmj/vNyPAw0LYQBhXL0aAlboXC9790S\r\nmJ22t8nFnDZpxHG7T4AdUM5z6UY7lz1wcDT57QUmVjgn0Ao11q6pKidDEjND\r\niCv33V9jpxVgPYPisqh6X15j54DVybWBnUI=\r\n=Zd4k\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.6.1-unstable.64_1657710521274_0.9156567018334776"},"_hasShrinkwrap":false},"0.6.1-unstable.65":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.6.1-unstable.65","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"0.2.12","@sphereon/pex":"^1.1.2","@sphereon/ssi-sdk-core":"^0.6.1-unstable.65+a525017","@veramo/core":"3.1.2-next.84","@veramo/utils":"3.1.2-next.84","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.4.0","@veramo/cli":"3.1.2-next.84","@veramo/did-provider-key":"3.1.2-next.84","@veramo/did-resolver":"3.1.2-next.84","did-resolver":"^3.2.2","nock":"^13.2.1","typescript":"^4.5.2"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"a52501731e5fe58bf890234cfb9c671c3cb08aa4","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authentication request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst createAuthenticationResponse = await agent.getSiopAuthenticationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authentication request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationRequestDetailsResponse = await agent.getSiopAuthenticationRequestDetails({\n  sessionId,\n  verifiedAuthenticationRequest: createAuthenticationResponse,\n  verifiableCredentials: [credential],\n})\n```\n\n### Verify authentication request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthenticationResponse = await agent.verifySiopAuthenticationRequestURI({\n  sessionId,\n  requestURI: createAuthenticationResponse,\n})\n```\n\n### Send authentication response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationResponse = await agent.sendSiopAuthenticationResponse({\n  sessionId,\n  verifiedAuthenticationRequest: verifiedAuthenticationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.6.1-unstable.65","_nodeVersion":"14.20.0","_npmVersion":"lerna/4.0.0/node@v14.20.0+x64 (linux)","dist":{"integrity":"sha512-yuCJP79Cm+4IVTY/C7uICMIKueMPOnq8KqyWUmVc5DtyUdMlh7iT02TB4AxHXw20AspIYUTQ4FsELBTxvQPaqA==","shasum":"a5a5e90a4e59ea26717d25cb3beb212611231336","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.6.1-unstable.65.tgz","fileCount":24,"unpackedSize":102121,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDZSWpukq9S4vKV5inZQ6T2oyCDEz1GJq2T6OUeu9n6KgIgcosVuNvbpVUdRWsjb+EN07uWX15Py0bMMuzRUeV/ImE="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJizqj6ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqUbA//eERWWSsyitXhEfX4LixjqKhJPQW4eFfdzKFWcmEfVflQZGyr\r\nmy4TEvMaY9joalmXNe5sN6OSHgxJzcljvSATikw5zVCkao0RFebT/oR5uVFI\r\nbPLRh7gEJMmf25oVq+v0THhR4EzF/Zn6t/am4DeNDcKtNQXA7ABcBzg3Lb28\r\nYU5UiA4zPo1iZTBwLR7Q1nGFjVtYzreIwWWZnT+wrdL97nsepGImgZNMn5Wx\r\n85sCrzjfdnLD7EaBwRUhYnj3KlCSxU6MnrfBg83nFy8PxEBFPq0KFR0mZP5L\r\nOb4tXJzO9lEhKIQ653YFrSDD9GHndr+sydlRJ/ztAWFicAvUrmX5oz0E/2lV\r\nPC5bj4gk3OE8Zd7NeR7i//CMssN9VX6ohjnuboms7HlR+QLyJM/BRbhRjFkh\r\nrl3KAka9HDgrZZKcsdH8pw/tSbZvdPLNbJ3FR/D2XLONXlmd9eW+nvZw6feU\r\noPClhcLxoRRNdy0McCE4F3ODe3m6qkGSuDZDNQcM/G0HHaY3+MzWUxPX3PJa\r\nAKrq+Adm5q5874FlSN4e0aVZ+IPamKZ6RuwzGz51HtgOwnbUqnLgAwEElX3G\r\ncrFvKM6zD3rDn3ilV3PrqVQcRA11t72rjuDngnMaCxFYnCmyzey/w38iqK0s\r\nXzWBE24tuAipWmopdZXDYMDO/WunPH5UX9I=\r\n=Zw7X\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.6.1-unstable.65_1657710841866_0.15571619295739492"},"_hasShrinkwrap":false},"0.6.1-next.66":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.6.1-next.66","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"0.2.12","@sphereon/pex":"^1.1.2","@sphereon/ssi-sdk-core":"^0.6.1-next.66+cff4c2f","@veramo/core":"3.1.2-next.84","@veramo/utils":"3.1.2-next.84","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.4.0","@veramo/cli":"3.1.2-next.84","@veramo/did-provider-key":"3.1.2-next.84","@veramo/did-resolver":"3.1.2-next.84","did-resolver":"^3.2.2","nock":"^13.2.1","typescript":"^4.5.2"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"cff4c2f3e71a6943d384dafc659deb3bd69ab805","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authentication request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst createAuthenticationResponse = await agent.getSiopAuthenticationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authentication request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationRequestDetailsResponse = await agent.getSiopAuthenticationRequestDetails({\n  sessionId,\n  verifiedAuthenticationRequest: createAuthenticationResponse,\n  verifiableCredentials: [credential],\n})\n```\n\n### Verify authentication request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthenticationResponse = await agent.verifySiopAuthenticationRequestURI({\n  sessionId,\n  requestURI: createAuthenticationResponse,\n})\n```\n\n### Send authentication response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationResponse = await agent.sendSiopAuthenticationResponse({\n  sessionId,\n  verifiedAuthenticationRequest: verifiedAuthenticationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.6.1-next.66","_nodeVersion":"14.20.0","_npmVersion":"lerna/4.0.0/node@v14.20.0+x64 (linux)","dist":{"integrity":"sha512-hMDQg6sx5AByCB05iTcYrX2zTZf7IRDqyN7QQyUmYhg6bq9B7yXcopTCj1ss7ffyOSC+BLQ5QpHDm2dmf3IzzQ==","shasum":"6e7aeac45c02544f40ae64e76de2a620aed187a1","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.6.1-next.66.tgz","fileCount":24,"unpackedSize":102113,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGoLxyyGzvlNoS/8RUnxmD5P+oJpJKPzm1VRXn1PEy91AiEA3o+w3LfIUoY6GCV1lgZaRA7jY3n5smNOb8jKs0GZcQU="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJizq5HACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqAWw/8DFc//FdBG23bjEZMyvq/bFjDUIH4X+3A0QhWWwlqwEsMTWT5\r\n6y1Ao2qv2lPm7U6u1tBy2s/JaEq1hY1fThK4cQakIaUineqS4BjPSYLBnOqU\r\nx6P+Lv/b0D9bRLLRzy3ZYppfCXEesxHmmlXOj4hRwoCKwSvjaaO6iyVdenu/\r\nGyx7afiSKujdzmm63MFULpS6VbbgfizpVgxlYy0UQ5vTibeca9Knt7hioPP5\r\nC37ktJpec9urqDVtFcYa2qDVj1rFOAsSu5nr4LQrM1dbE9Fm2z9b9SYEuIxn\r\nDyVzPlUGXhns5U/Y2nZE/tae4beptfbwOxxIQ0g1djKnbfTYRa9C+o6lFP/6\r\npj9JReU82h9dJ4RIJjmdBUD/3CSKBdNjYnSRu95/2N2qkdSCQ1YnuYsOootL\r\nZH3gVYZgL65DPm3rpDXgXkVwn9nRlLMRyJOzw5wMsRwfvaBBKo1AWXgZ+5d7\r\neZIVvwGly5jgoVNyIHsIWHiZ9hTveYRbmwOrhwnHGa98d1I60KeGLvXU7Rdy\r\nzqpG+DzBiEuyGt8BwiUYto72D9vE6AAsqLpdYKDOFIREPuwk8AO0eVY+niFf\r\neUFKUw0r+4aPCpTK4yVvrvhk+TAPZaArDah0SLpNLb5IEQqDENs/ZXkfaWKz\r\nhpH8e0/opcGziCMYw/HiFKHcr/qGhluRjKM=\r\n=iaNB\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.6.1-next.66_1657712199293_0.17272794926145285"},"_hasShrinkwrap":false},"0.6.1-next.67":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.6.1-next.67","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"0.2.12","@sphereon/pex":"^1.1.2","@sphereon/ssi-sdk-core":"^0.6.1-next.67+386efc7","@veramo/core":"3.1.2-next.84","@veramo/utils":"3.1.2-next.84","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.4.0","@veramo/cli":"3.1.2-next.84","@veramo/did-provider-key":"3.1.2-next.84","@veramo/did-resolver":"3.1.2-next.84","did-resolver":"^3.2.2","nock":"^13.2.1","typescript":"^4.5.2"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"386efc71b18195004773fc74eb51b62cd3f5dd76","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authentication request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst createAuthenticationResponse = await agent.getSiopAuthenticationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authentication request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationRequestDetailsResponse = await agent.getSiopAuthenticationRequestDetails({\n  sessionId,\n  verifiedAuthenticationRequest: createAuthenticationResponse,\n  verifiableCredentials: [credential],\n})\n```\n\n### Verify authentication request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthenticationResponse = await agent.verifySiopAuthenticationRequestURI({\n  sessionId,\n  requestURI: createAuthenticationResponse,\n})\n```\n\n### Send authentication response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationResponse = await agent.sendSiopAuthenticationResponse({\n  sessionId,\n  verifiedAuthenticationRequest: verifiedAuthenticationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.6.1-next.67","_nodeVersion":"14.20.0","_npmVersion":"lerna/4.0.0/node@v14.20.0+x64 (linux)","dist":{"integrity":"sha512-XgJ2xbB4jyNT5L3jlJdjj4fxUVI52AFKMoISa7/4dCIgnSdojk36x+bTRnxRGWDNL2c9ErcC9N9QRgYfPPcBjg==","shasum":"fb30522818198b4abd10cffe2d7b6ca00af92f04","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.6.1-next.67.tgz","fileCount":24,"unpackedSize":102113,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD5ttTUS7XkgVQjoJJSkU47QRY1xO/45/XVapUM6yYwBwIhANglc1Mzdfi0B3Y+sVuA93DxzLK7oLs+/Gt6mvBhhDjM"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi4wFNACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpHsw/+M9Jw4HarbYK/0YJ4IT3wAt0Yy16wnbnDgu3uYjcJU7o6sXQt\r\nfI7XyIAM02sXCE3874i0yxFci8x6YeS1d6Uk9dLmF2vCI29CxiC6z6RSQqi7\r\nkjRHy1mF818/22Ebma3YOclte5wwFSMaf2anuzud0Jdz0AJ6bOM/OldPRy0v\r\nq2fh7ZlZGXogN7PN8Oq2SiLX1n1q3qHePEOLtNBtRMk+FKGrveqTeV9G1jS+\r\nGy4EEowgSM7cHj9NXNQZZyxeR6Sy7Aa2dR/P7Ayk4PwZkQsNXg04psnBQh3V\r\not58mXhQ89MHqsRbwMLjxZ/ZKGXNtDX2Q3ijmg5kfSgHGveLn197YBFyV3ZG\r\nZ+qjF2FOgaDcvreeHhB9XIZqY+Ch4ZTxOYiZ31xmxCVswlccAua3MRD9+0UH\r\ng1IDg2bAJN86cJm46h/kJz8YJWTZJl7a21igciOg4cW7ngd78XgwnSIBKy9I\r\nZpOY5vzRGydzkFnggdUtKvzq7QkpPhzWmAHErvBYw2inYY8Aaqb0QpkUGWmU\r\n8udxppQiVZcdTsb8QfghBtoZ5vbkKn7NEX9pqid+ewEh5vdfq016DtoBv91Z\r\n+/yUyo7jGl35bjNnFNynUaiN4tDGwuV1KHvrQVgGojqdk9PRFA33ClPpkiTN\r\nTrqteQ6CCJqudEFBvlqfH3ZMP6KIfPsnpak=\r\n=ypHY\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.6.1-next.67_1659044173234_0.9510087865773669"},"_hasShrinkwrap":false},"0.6.1-unstable.74":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.6.1-unstable.74","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"0.2.12","@sphereon/pex":"^1.1.2","@sphereon/ssi-sdk-core":"^0.6.1-unstable.74+1462b74","@veramo/core":"3.1.2-next.84","@veramo/utils":"3.1.2-next.84","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.4.0","@veramo/cli":"3.1.2-next.84","@veramo/did-provider-key":"3.1.2-next.84","@veramo/did-resolver":"3.1.2-next.84","did-resolver":"^3.2.2","nock":"^13.2.1","typescript":"^4.5.2"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"1462b74119f7a73f43ce3f0d4717e01b60a5ac1a","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authentication request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst createAuthenticationResponse = await agent.getSiopAuthenticationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authentication request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationRequestDetailsResponse = await agent.getSiopAuthenticationRequestDetails({\n  sessionId,\n  verifiedAuthenticationRequest: createAuthenticationResponse,\n  verifiableCredentials: [credential],\n})\n```\n\n### Verify authentication request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthenticationResponse = await agent.verifySiopAuthenticationRequestURI({\n  sessionId,\n  requestURI: createAuthenticationResponse,\n})\n```\n\n### Send authentication response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationResponse = await agent.sendSiopAuthenticationResponse({\n  sessionId,\n  verifiedAuthenticationRequest: verifiedAuthenticationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.6.1-unstable.74","_nodeVersion":"14.20.0","_npmVersion":"lerna/4.0.0/node@v14.20.0+x64 (linux)","dist":{"integrity":"sha512-KXqs/C8CmZefhXQO5c/82zcxya0zNo5mye9e7Yyaj8iFIi1lLXBS8G0z/Mr6V1fDK9vYawDSwzPjMuc+lclezg==","shasum":"e023efced75d3c7cdbec967f04b1a47b7360fd7e","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.6.1-unstable.74.tgz","fileCount":24,"unpackedSize":102121,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCJuXxD19V0u99vQq7WeGmR4Yo7ckX1w7sMXdhPTd1qWQIgVW+0LRujcnSmPCuok2jQWu3y8UTpsIFSNL1nyMFwYBw="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi6X02ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr7BxAAkIm1NgzNRzGC0FJqnFMWz2hNFlFOe/Qo4UUvrY5QD+qQ1dWH\r\nOk/vngZ4rOoG+hPCfn92tUKYonN0Iu7dcrMbPLQmeXOL56EH/RnLziC9szSD\r\ni/3Y0Y1trQ3+NyjoCWj762jcmpoMWY37eWrPAaAoR2XCefa7t9NK2qy4qa7C\r\nUqtLWDPPebKKBLWDT18LqhatBq1R0Qfi8JBepOS8cpW1eOrmbnl3jpHWKHHz\r\nQ+xrsyUS01ljCaQWo+6EhYXRrt01I5n66ge/c/Td5YflEHLwIZK7qE4N1T7P\r\nWk+ywmcP7P3NZMzJG2eNDLbofM09N7WUwOWnpRKh+3wRf13qk9s+86bzD1wD\r\ns8xGHoBrK58ynhIPgUuk/h0MbyXF4YA5qjBkyMx7IVhGiNpkK3uet/k/s1yt\r\nJ2UssjBAcF0wMEQTCNP3kJgpaZiyyoiiSQWgjvnLrGzmVwPr2xj8PE58SBhD\r\n8N+Ed+brlsOaJAcJ9BhsANO7GRfU2fxd5eBTXHjmj6L1Dbrrvuwqt3N2F/18\r\nDGhVtCaIGkX7jM6DD8lAdg8LQ7+zrgmJLI4FiBLoIixzN2exRm+3uQTkLZUJ\r\nullUhlBFD4h+xkBqakszaLlOvGJZ0UIk1bIzV0Qv334wLof8k33Lac1CVT8c\r\nGx9xQZ5DCPCQ1G5J8VPVWNfLEjf5Y/bO6HY=\r\n=ZXrW\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.6.1-unstable.74_1659469109929_0.32640163795547616"},"_hasShrinkwrap":false},"0.6.1-unstable.75":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.6.1-unstable.75","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"0.2.12","@sphereon/pex":"^1.1.2","@sphereon/ssi-sdk-core":"^0.6.1-unstable.75+a0af167","@veramo/core":"3.1.2-next.84","@veramo/utils":"3.1.2-next.84","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.4.0","@veramo/cli":"3.1.2-next.84","@veramo/did-provider-key":"3.1.2-next.84","@veramo/did-resolver":"3.1.2-next.84","did-resolver":"^3.2.2","nock":"^13.2.1","typescript":"^4.5.2"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"a0af1670692eed24d0ae9f5721a68d0340173f19","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authentication request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst createAuthenticationResponse = await agent.getSiopAuthenticationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authentication request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationRequestDetailsResponse = await agent.getSiopAuthenticationRequestDetails({\n  sessionId,\n  verifiedAuthenticationRequest: createAuthenticationResponse,\n  verifiableCredentials: [credential],\n})\n```\n\n### Verify authentication request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthenticationResponse = await agent.verifySiopAuthenticationRequestURI({\n  sessionId,\n  requestURI: createAuthenticationResponse,\n})\n```\n\n### Send authentication response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationResponse = await agent.sendSiopAuthenticationResponse({\n  sessionId,\n  verifiedAuthenticationRequest: verifiedAuthenticationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.6.1-unstable.75","_nodeVersion":"14.20.0","_npmVersion":"lerna/4.0.0/node@v14.20.0+x64 (linux)","dist":{"integrity":"sha512-eHNpitN2d1NRX4PlpFGffXanXpB0JF5H38lo439fT+JXspx0MU1gICsUkzZiKDvP4uafLT7wqFIPU0bK4uJDcA==","shasum":"18cd804ea11cd18a8e7fef2309ae7c20d2e7efeb","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.6.1-unstable.75.tgz","fileCount":24,"unpackedSize":102121,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDdhwLJ3GnB8aYYdMn2o6tP4zRfitHajsWzTicZMEdt5AiAG0rWq9OEYbDjKCX6ommGgdwgeQF7U/isDv821e2NvRQ=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi6Z32ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqtQxAAgBWhwfgun9gyDnYYDGjv9P8VTUodVgIiOUoeILHXKwJZi6ZR\r\nlazEQBclK8Qg+gKYhpDDs6xHWm5N6Gb0ouRsG5lNpUDGNFJRh/n3SU38y8Q3\r\nayWQWe0CY1996H3JuHGmsTfZKP/k/dvs6mmRfqu6xoA2Lnw28pCmuDVV0l/B\r\nmL2xavRH/QiFWb3/all9MSSvGgbXIy5AP1hvW8TZ97+LK9z39YY1Q41H7bfz\r\ntbmMb6XkYA5+tFzPHojLDKXrldMrLOzq21OODYKm7DR2/rIUpUIIMziJy3ek\r\nwXPj3n5fn92c6P2aN8fIp9k1oh5wDv6GrBGiyZ1wiIYnaO7VR1ElsdM91YiN\r\n6djB/kO2PB+43XHYhTQTjanSQPPNazHKAfAOY/T7LpGO6h6WCNOHiiJaiR0D\r\n40VkuKXnvpNP0JjTSB+l7h4J1P2iE4RqoFvnqnb3vLkAX8585A2y4XcUkeMY\r\nND+8YGyhv6DcXH1CnY0LTREGEE3aNyoISXqzJdzzlrzT78+/sRN2IHkqurT9\r\nYUoQqNX9sGZgrqkeBXIC+vv9I4iHy+0J3nnctt1wvnTuyni6HIUvSlHtnEPP\r\nnV6iF9iiHeEI4fZjnqM/rQ/5sEdrhG2nrlMkMZn0Lfs3FxzWscPVw53hDMBF\r\nIG5BXSwSn58urUlYvS+ZKGPvuLHFSgMUZc0=\r\n=PsA7\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.6.1-unstable.75_1659477494762_0.7401578486067337"},"_hasShrinkwrap":false},"0.6.1-unstable.76":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.6.1-unstable.76","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"0.2.12","@sphereon/pex":"^1.1.2","@sphereon/ssi-sdk-core":"^0.6.1-unstable.76+527741d","@veramo/core":"3.1.2-next.84","@veramo/utils":"3.1.2-next.84","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.4.0","@veramo/cli":"3.1.2-next.84","@veramo/did-provider-key":"3.1.2-next.84","@veramo/did-resolver":"3.1.2-next.84","did-resolver":"^3.2.2","nock":"^13.2.1","typescript":"^4.5.2"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"527741dfdfa81336210fadbe66fbcf475de98cb6","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authentication request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst createAuthenticationResponse = await agent.getSiopAuthenticationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authentication request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationRequestDetailsResponse = await agent.getSiopAuthenticationRequestDetails({\n  sessionId,\n  verifiedAuthenticationRequest: createAuthenticationResponse,\n  verifiableCredentials: [credential],\n})\n```\n\n### Verify authentication request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthenticationResponse = await agent.verifySiopAuthenticationRequestURI({\n  sessionId,\n  requestURI: createAuthenticationResponse,\n})\n```\n\n### Send authentication response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationResponse = await agent.sendSiopAuthenticationResponse({\n  sessionId,\n  verifiedAuthenticationRequest: verifiedAuthenticationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.6.1-unstable.76","_nodeVersion":"14.20.0","_npmVersion":"lerna/4.0.0/node@v14.20.0+x64 (linux)","dist":{"integrity":"sha512-H75viIsXn7/66//ptIetrcM+DWAK9NgpxggiNfBVn7JH3g1Dwhxiqp2393Ok+5d3AbS4L+fx/76urfbsX7q9Rw==","shasum":"db59a8f1abdbcf899ccb646c3df3cbd5bb54942a","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.6.1-unstable.76.tgz","fileCount":24,"unpackedSize":102121,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDwZvq/XcGDiFMNV1N2RBeeVf7UtnswBy6jmZOey6uoPQIhANFpT41UhiLi+2XWmVUQYBJtskzDaMXeOl3x4I66Te0f"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi6aiKACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmptTA//dk7z/Ob+Qg5GgQiDGkuerzz1/1432o/5GbC7vSnhPvWIHLlI\r\n13xQK0is6tEwwy/NyYmR7IYcsxHwIhIgvc5nnpNn1bm5Enpanh8/CLZo+16i\r\nGOEqSJboU2IlEFPRtaRi3jufLHRdC00eZFwoDjOWLURwE3KoRs0B2sDXlqNE\r\n3joV8AGfMIyxGDVnPbmMqif6YdpBGk1hsWu7YQldwtI7SPfOhQd5My2Y/Ane\r\nguXEq5JUfsxCidfT3kN6vu7FtHFQA1hHsceCYk4DtpfD1LSt/SqiTic3NxId\r\n2RjM/jUy4wnAgTwe0fcLRCBFhJ1fEbZklDk/xXTdGSXUY7kh+Ljtw+1gz8l+\r\n+aJM7umzs65FjGRC1wtGv1zlUiqzypq863N4Q3QfGvT0y7Rm6u5LROvDeQhp\r\nbqmjvL+y3eF/QD2TPXshR2v7CJsPf3vR0q5QAlZtyvS9ed7SpIlY3IhvPrdC\r\nC5/eSwavQ0lI84MX/mEbep6EqvHGtxK8bXbVLOxWLAPGYODtMWCsvWR1njN8\r\nX2Nke0ru8+35V+tw+lBZAMN4jhVz4ar+qr7zP5d0zMO1aLU8XXWaALVJPoiq\r\nIxf1DxA3NImc5VyH+TsdSTCmd13VQVfUfaz/fTpat9RRmkfYcPjKB+yVlVcT\r\nbcUKqEQRn3BisBEZY5rsgF6b42rtLHCHcxo=\r\n=S+T7\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.6.1-unstable.76_1659480202135_0.044173358935182705"},"_hasShrinkwrap":false},"0.6.1-unstable.77":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.6.1-unstable.77","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"0.2.12","@sphereon/pex":"^1.1.2","@sphereon/ssi-sdk-core":"^0.6.1-unstable.77+0ca5117","@veramo/core":"3.1.2-next.84","@veramo/utils":"3.1.2-next.84","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.4.0","@veramo/cli":"3.1.2-next.84","@veramo/did-provider-key":"3.1.2-next.84","@veramo/did-resolver":"3.1.2-next.84","did-resolver":"^3.2.2","nock":"^13.2.1","typescript":"^4.5.2"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"0ca5117be012752ea88fc437e88378393d7c905a","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authentication request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst createAuthenticationResponse = await agent.getSiopAuthenticationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authentication request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationRequestDetailsResponse = await agent.getSiopAuthenticationRequestDetails({\n  sessionId,\n  verifiedAuthenticationRequest: createAuthenticationResponse,\n  verifiableCredentials: [credential],\n})\n```\n\n### Verify authentication request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthenticationResponse = await agent.verifySiopAuthenticationRequestURI({\n  sessionId,\n  requestURI: createAuthenticationResponse,\n})\n```\n\n### Send authentication response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationResponse = await agent.sendSiopAuthenticationResponse({\n  sessionId,\n  verifiedAuthenticationRequest: verifiedAuthenticationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.6.1-unstable.77","_nodeVersion":"14.20.0","_npmVersion":"lerna/4.0.0/node@v14.20.0+x64 (linux)","dist":{"integrity":"sha512-8Qv2EGeJYd9SfeALeeP5HV9j63u0TW4QEBM+xwP689ySut9HEPHqs0NPt9Htd84WiDllClRPP5wbZC/M+Rhgyg==","shasum":"38cd9a7ffaf84555326f2601bcfd5021c240b422","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.6.1-unstable.77.tgz","fileCount":24,"unpackedSize":102121,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIE7CrK56fWwkKVU0LCyHa7puw7kFJwNJviUMdHoUARyRAiEA591gIsVCa9NgnRKtEaXtgvhSpfgm0ErGWEMAo6Vmzl4="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi6bSwACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpUwQ/+M09P0nP2Y68JOhUvuBIie4NeXPdEXbEpOTzkiD5oF+NDQo38\r\nqOm25gqHY9GayoAmDK+Kcf/U55zyxjWmJDfi7fqJPSKMXibex00plb10bShP\r\nGuGtnDEHCeyJDigLO/rPj6tQDRwFhbY+ednhw5u8bmtZqr536IfTQtjuJQIZ\r\nXTLcHgfJo96krt1/Uzs13zaoulppMDmII4jmn4YuhJaC3JCKWKarnb3L6JNL\r\n0nvzzhHdAWdC/6XB14aIPG/nLYsP5+DbvCchsOOe1IeAbhPlkH84OfEPYTvd\r\n0NcT4floGd+ObjLC+cQ2NFSirorY+Pa7kf3NgGQf7jUdqcj6pkVOl0kt4//O\r\nRgFbIqSqm5EchwY8MpWoJcscv5q+aKGeHZGXXLTig3MNGvWUelp/VhHyAD3E\r\nAqpYrkVGJVsIfJlww4hynhlOd82B16VsEHVwh8QKW+7mnoPfygj6XJSPDazI\r\nM/QCefRVGSuEBENjiYeBo/1Ea6bR3QwlqijzoRKKpgJXJ5fdnzwCiZI0CAHt\r\ntewrKIoeKu4AmK/H8UNec0oTPSfFjq8kB3ze49+PFPMN+HPJH+RIQaqt1NAe\r\nzjRgqWTOYHMRjrS0KxpWJ5PGmfChniTo5WhzMl7oZpOGfuKX27MAmF/nUJNh\r\n/BErSxSRpkKrm7+ufiV2aCkYfkPUi17Uzuo=\r\n=JdDE\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.6.1-unstable.77_1659483312199_0.6700130620481903"},"_hasShrinkwrap":false},"0.6.1-unstable.78":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.6.1-unstable.78","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"0.2.12","@sphereon/pex":"^1.1.2","@sphereon/ssi-sdk-core":"^0.6.1-unstable.78+689ad12","@veramo/core":"3.1.2-next.84","@veramo/utils":"3.1.2-next.84","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.4.0","@veramo/cli":"3.1.2-next.84","@veramo/did-provider-key":"3.1.2-next.84","@veramo/did-resolver":"3.1.2-next.84","did-resolver":"^3.2.2","nock":"^13.2.1","typescript":"^4.5.2"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"689ad12d9dfb15b8471e7b4ea4bd777493ff5bd0","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authentication request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst createAuthenticationResponse = await agent.getSiopAuthenticationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authentication request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationRequestDetailsResponse = await agent.getSiopAuthenticationRequestDetails({\n  sessionId,\n  verifiedAuthenticationRequest: createAuthenticationResponse,\n  verifiableCredentials: [credential],\n})\n```\n\n### Verify authentication request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthenticationResponse = await agent.verifySiopAuthenticationRequestURI({\n  sessionId,\n  requestURI: createAuthenticationResponse,\n})\n```\n\n### Send authentication response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationResponse = await agent.sendSiopAuthenticationResponse({\n  sessionId,\n  verifiedAuthenticationRequest: verifiedAuthenticationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.6.1-unstable.78","_nodeVersion":"14.20.0","_npmVersion":"lerna/4.0.0/node@v14.20.0+x64 (linux)","dist":{"integrity":"sha512-Ug0lfXy6wqLcgojeLeXWht6g0dhz2Q/uOYY5TWRQvCTwjxwtx7nH5j9ZlbdqTRCR/mlfkj16ef0FAcSaGm73NQ==","shasum":"e7c4d33d9df95335d2d750218cf124870d0ab0be","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.6.1-unstable.78.tgz","fileCount":24,"unpackedSize":102121,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDjt8osX3ZCuXlftfAhVl5XFFHejffZ4RjiIkdOLhg4NwIhAINKgTbHJ+HW8uklIxzNm3YV+zD04ZoMstfwglV5H3n7"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi6bs/ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp+bRAAi9P7noVJhE4+TdQ2woCFLG0gPPGT5qV/uKoGAUj70NimO5Zc\r\nyggOpW84vIHuvZzm5JmQibQ3ofu+sbUBNQxBBUVsBLco0YiWpb3mBhRyCIQs\r\nYFoIDvv/0Wl9ZJ4GQzKKP+jn4CfwJr7ZXlEyaCC7nHHItOeGChVdEod5e5UB\r\nlx0ATx3PpaqYJMX+CvLOSbTeiG+EMWFbQkdLFOLmvq/TB3I/Aq4JYsyTvJG9\r\n5o8LhKG2ksy1V3tVo7Ag6XxqgAyCp/BbETGWnuSDnN8qybZdPduOX0/G5oT3\r\nlTNivTf2C9ABFU6/n0y66xeCbTFCkm1hsw51wmhSOod8A4/GgydQQZA52tvF\r\n/QoJKjLd0MbiC3yZSdOs5EfTHtLjWoTuY2F7daYaAEIoG7zz+ti+hHUmo6UQ\r\nxs1uYzIT52/pz2rHPqryMLOtDrWVhoaAXU2gjhL1C4VGomvZKV4wmT5Xvu8W\r\n8tz4Qtogl+MkziIePd8A7A3BjrM/gvEHmolIBXv21YrS+A3r6B7qzPg8Q/lP\r\natrzYBQNPjZFWsDRHJL2v4+QhoVIhB1tzM/ur7b3bXHNUuO3aoheb/LaDdom\r\nB5547Fcfe/RMldJ5mLpPVAoemkKMoRBBlryE3zAZ5K3/8XjEtdtdHgTyd1Rr\r\ndUB/3wwD2T6Mr7ydUewWelXdRGvgNrntors=\r\n=44pU\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.6.1-unstable.78_1659484991524_0.6874890815514414"},"_hasShrinkwrap":false},"0.6.1-unstable.79":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.6.1-unstable.79","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"0.2.12","@sphereon/pex":"^1.1.2","@sphereon/ssi-sdk-core":"^0.6.1-unstable.79+ed4dca7","@veramo/core":"3.1.2-next.84","@veramo/utils":"3.1.2-next.84","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.4.0","@veramo/cli":"3.1.2-next.84","@veramo/did-provider-key":"3.1.2-next.84","@veramo/did-resolver":"3.1.2-next.84","did-resolver":"^3.2.2","nock":"^13.2.1","typescript":"^4.5.2"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"ed4dca756a3a1575a13a10dd5ca757676a7aa438","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authentication request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst createAuthenticationResponse = await agent.getSiopAuthenticationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authentication request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationRequestDetailsResponse = await agent.getSiopAuthenticationRequestDetails({\n  sessionId,\n  verifiedAuthenticationRequest: createAuthenticationResponse,\n  verifiableCredentials: [credential],\n})\n```\n\n### Verify authentication request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthenticationResponse = await agent.verifySiopAuthenticationRequestURI({\n  sessionId,\n  requestURI: createAuthenticationResponse,\n})\n```\n\n### Send authentication response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationResponse = await agent.sendSiopAuthenticationResponse({\n  sessionId,\n  verifiedAuthenticationRequest: verifiedAuthenticationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.6.1-unstable.79","_nodeVersion":"14.20.0","_npmVersion":"lerna/4.0.0/node@v14.20.0+x64 (linux)","dist":{"integrity":"sha512-0RAEohsg1dFR3bjdPo7VCi6H7Q0WqQJgMkd9hmiCpdIjIGD0viTTacy8RNz8w4oncVl90qFHYUZm+mnIo6N0Bg==","shasum":"fc4e21cd2c0910cf992a725de6690a2cdfc5f06c","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.6.1-unstable.79.tgz","fileCount":24,"unpackedSize":102121,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCpW3Z+8HhadZQ5e9bXFDPs1W4hZBOA6Bb/sQASaeTuogIhAPnr8gOEUqIGvEXrj3bPFrdKJYHkeWaRaDn9BQhjUFcI"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi6cCcACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrFyQ//a50cE/VzKnCN2ahCD5MVnWR3L1ZyYpozsSCGObRC32cepJsm\r\n2BA+ZRPdiaZWGPNVzEysiytxbN8C1Wb9VdN4byg+F3dTVU1vlubHLc1KVuPD\r\nDbBWmja3ahGErQJ0Yfn46fewvmjvjz2/ViSEyARa7X3kLzhJapsDUnWYYD88\r\no6DZlP+Clo6n2n+ExVTwgocFaYNZhE4x8XF/JS4TD51CL+jx4/OSmXlJjj9b\r\ne6CeKe8fSJe0otniYRZr6ru3rtv2Me1X0TCEHsIYDogkn5OBrdZH80Bp2PlZ\r\nmtYajlz7jYE/qlvwIDl8VcPXoA0pBCAqzpvTGGetkJ+n6yDcZVFyoyOG62dr\r\npptM/qvgsKB7h/8J7jHxIAoQFFyhqg5E5GqG9wsHfqvV0cy8M+o3azPyMeRL\r\nMvm1w8gjB4rBoDASyjfddXVf1tvCC23hj5xfS/XsP1FK+kFsQxcJgfkYXcK1\r\nXiyLN2uPlsnzEuniWAvpymIBkju2A22wJZLgvaeIqzVVrNUaVtkqJk7MAXpn\r\n7BEgPdsZsMBuDrf0fn1Rk5kMTVOKLBOSRBdLP8BfmiltQ6wrttA5HjnQKSEd\r\nhFpBHfuuy4EBXEPCtFHSBjZoA/ntp5JHWNeO6LF1BjJVRRd43+YOZMm0L1NP\r\nHe0kiKe5s8wLNcGtDpFJGtSo6VvhJoL0OgQ=\r\n=ChTf\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.6.1-unstable.79_1659486364292_0.3140754830297183"},"_hasShrinkwrap":false},"0.6.1-unstable.80":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.6.1-unstable.80","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"0.2.12","@sphereon/pex":"^1.1.2","@sphereon/ssi-sdk-core":"^0.6.1-unstable.80+35f316e","@veramo/core":"3.1.2-next.84","@veramo/utils":"3.1.2-next.84","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.4.0","@veramo/cli":"3.1.2-next.84","@veramo/did-provider-key":"3.1.2-next.84","@veramo/did-resolver":"3.1.2-next.84","did-resolver":"^3.2.2","nock":"^13.2.1","typescript":"^4.5.2"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"35f316eefab395c1ae2c1a279dc43cd8de6cdbae","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authentication request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst createAuthenticationResponse = await agent.getSiopAuthenticationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authentication request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationRequestDetailsResponse = await agent.getSiopAuthenticationRequestDetails({\n  sessionId,\n  verifiedAuthenticationRequest: createAuthenticationResponse,\n  verifiableCredentials: [credential],\n})\n```\n\n### Verify authentication request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthenticationResponse = await agent.verifySiopAuthenticationRequestURI({\n  sessionId,\n  requestURI: createAuthenticationResponse,\n})\n```\n\n### Send authentication response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationResponse = await agent.sendSiopAuthenticationResponse({\n  sessionId,\n  verifiedAuthenticationRequest: verifiedAuthenticationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.6.1-unstable.80","_nodeVersion":"14.20.0","_npmVersion":"lerna/4.0.0/node@v14.20.0+x64 (linux)","dist":{"integrity":"sha512-ECJWg+WKH3uG3mKOVPzRXWucHhwNiDFza0n7+jT1IAHTMFJYirszq9EseXwODFK9lNkCZTW6TUvCvakHSvbTPw==","shasum":"dd75adefc52c1353075b3f25f9ad438f0d224d18","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.6.1-unstable.80.tgz","fileCount":24,"unpackedSize":102121,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDWvrBZA6/CTBMfHKo11zzShX4Y6uIbqkuxOoA5CZ8vMwIhALogIZm3UwhB84bovX6NOAjH3HwmgcX7PjTKxRToyMGG"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi6igZACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmroaA//VOBNeVHzGAyfJD/lYsqvAyg9qBJQXNIEdGVB9kwkQsEFy9KF\r\n3RCQEWnmz3W0Q71ZqNn06qvxEmeNGoYaFMn3ZRNiAkXhVXe9uXXSA417jrmz\r\n/eU2vnvgi65MiS7UdqViPoo5OjhuGvIWRr6hvX7MEWK4j17PkWTj9TEXtF7B\r\ndE0DPM/W27iIGtiEyMBjb+7UttMp25QqEI5L+nb0nvL1xJJiVogP+Un081o6\r\n1PzkcBlPORvlLGEFHHFI85xHqbqEwNz+3VVqC1jjqocdjCCd1Ms2CDwaQ9Us\r\nQmr10LVFvNn/tdFrtQxZ3OuQo7zIodRxxpoRVM0Ji+1UuywqndW0/qpcL/nO\r\nsBpoVUiP1y7SF5XWgj2x0NPnY+39Am5A8m5vA3my9nSP+AN8iOP0wFNXy1kD\r\nBgaDBizhmZAzLuVSGC1zVy+ldXhOv3uOxjeImOXHXRTz9n3iTH/Y/N0ocItN\r\nq3pNYHnS+rNNWHTwk89lfXBwssTI2Fn50LZh2soj7aEuLCe1nUpLSlAke+X7\r\nO66c1vTZhTxWzfr8uKk235y/28RIpe1q5hsyckYZzjp77yRWfFFLYEmlqA2n\r\nUNH0nL3s1YW92qsin/9Umr158jQypzQaLWc1kRBr8IUipgetRTB1JMJBeouP\r\nBQF0uwkvq8LeYZTiz6Y9RimLCwd3FrH61Fc=\r\n=y8hF\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.6.1-unstable.80_1659512857647_0.6360045648646777"},"_hasShrinkwrap":false},"0.6.1-unstable.82":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.6.1-unstable.82","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"0.2.12","@sphereon/pex":"^1.1.2","@sphereon/ssi-sdk-core":"^0.6.1-unstable.82+0148dea","@veramo/core":"3.1.2-next.84","@veramo/utils":"3.1.2-next.84","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.4.0","@veramo/cli":"3.1.2-next.84","@veramo/did-provider-key":"3.1.2-next.84","@veramo/did-resolver":"3.1.2-next.84","did-resolver":"^3.2.2","nock":"^13.2.1","typescript":"^4.5.2"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"0148dea6b2a782c547e3e453bb933b300216ffe0","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authentication request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst createAuthenticationResponse = await agent.getSiopAuthenticationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authentication request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationRequestDetailsResponse = await agent.getSiopAuthenticationRequestDetails({\n  sessionId,\n  verifiedAuthenticationRequest: createAuthenticationResponse,\n  verifiableCredentials: [credential],\n})\n```\n\n### Verify authentication request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthenticationResponse = await agent.verifySiopAuthenticationRequestURI({\n  sessionId,\n  requestURI: createAuthenticationResponse,\n})\n```\n\n### Send authentication response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationResponse = await agent.sendSiopAuthenticationResponse({\n  sessionId,\n  verifiedAuthenticationRequest: verifiedAuthenticationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.6.1-unstable.82","_nodeVersion":"14.20.0","_npmVersion":"lerna/4.0.0/node@v14.20.0+x64 (linux)","dist":{"integrity":"sha512-TxcVkEOwMlc5d15E6Y7dYw3otrmbE5YZ7DPmbatYpDy7k1pbMavkz9Tx04iCxCyFqxfdF9quQIurLpzlvXOj2w==","shasum":"a53599a4be5025f0acbe9f66832f7e93305b854c","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.6.1-unstable.82.tgz","fileCount":24,"unpackedSize":102121,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCicZX4+kQTNmhfZwfb/jQhIaALfxqHfSvGvGrGjVj4bgIgAdzujmupBHSgG2/Vp/Em7o3O7y5AEUuoU6pxirOfZKg="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi6k1mACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqQlg/+KVSpViL8rkiHEY3gcjQkrA5KhwjlhQ1e50Nw6bhkitERthV9\r\nxzPMMsjXmY9uFEhv5BAA9Y1PQFWiW3YytXLIGTW4PZdlfSj3Vb0Acz99SHMp\r\nblXAWd71/eKvxf0B9KiXbEQuikzlE62+d+eY+Tla9giUCntENwaKihOjcLrz\r\nyigXT1gu2JDe3ixI+jLSqATbTQIv+E0YTZeJqCscCIwsyD4alcgrbbTRzNiP\r\nChL975B/dM3em8bn6u2E4qgDzDVaKpEtWy27Q4hPisgy4lM/D4eC0CuW4q7/\r\nMD91gX6TI32uWzhaxEvOJptg8ZSv++WXdg9HZIKuM9RJoL265lMroH0KkXo+\r\npECVILzHQ+ckxLiWOwHOxhY3G/EFdMSMUZqpkQPS1YPv37uUwEJAMzbYhxEZ\r\no2GN/M3yTDiCflw3Gv+tkL6ljq7zGIKWGOA3S4Ia81EQyc1lV1M3HyRTeeB3\r\nzm8mLqEAo1hEWJUnRmsOLlwlHHGMXywWxxls4s1e8Mlb08TQH9cRp4rkQHH1\r\n4z5suBPeNo7LvjfkRk1KWtC7mjVURzm39HZNDmV/LKMFxPoeXqgnTiSl1mM9\r\nI0J/uONt8WSNds8NFskcXkLNbsM1ZNqYLDS+Sjt+Xy/Dv96XdzaS02ePUsja\r\natNkXSOxXX3EZ7U1j4BZhWlU8S6p5pbF0Mw=\r\n=Vq7y\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.6.1-unstable.82_1659522406018_0.6448485376292863"},"_hasShrinkwrap":false},"0.6.1-unstable.83":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.6.1-unstable.83","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"0.2.12","@sphereon/pex":"^1.1.2","@sphereon/ssi-sdk-core":"^0.6.1-unstable.83+996ed7b","@veramo/core":"3.1.2-next.84","@veramo/utils":"3.1.2-next.84","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.4.0","@veramo/cli":"3.1.2-next.84","@veramo/did-provider-key":"3.1.2-next.84","@veramo/did-resolver":"3.1.2-next.84","did-resolver":"^3.2.2","nock":"^13.2.1","typescript":"^4.5.2"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"996ed7bcf5955afedc71fe6bdde1fb32200aba3b","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authentication request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst createAuthenticationResponse = await agent.getSiopAuthenticationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authentication request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationRequestDetailsResponse = await agent.getSiopAuthenticationRequestDetails({\n  sessionId,\n  verifiedAuthenticationRequest: createAuthenticationResponse,\n  verifiableCredentials: [credential],\n})\n```\n\n### Verify authentication request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthenticationResponse = await agent.verifySiopAuthenticationRequestURI({\n  sessionId,\n  requestURI: createAuthenticationResponse,\n})\n```\n\n### Send authentication response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationResponse = await agent.sendSiopAuthenticationResponse({\n  sessionId,\n  verifiedAuthenticationRequest: verifiedAuthenticationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.6.1-unstable.83","_nodeVersion":"14.20.0","_npmVersion":"lerna/4.0.0/node@v14.20.0+x64 (linux)","dist":{"integrity":"sha512-DymU2o2469dd3WqmydFF4Og1hPiiQaVyR81wziJ3VBDktMYl0Hgx6x+h5e8+E/mZ8CPo+ABJEDfwOTnxtIQ5bA==","shasum":"d2efa2e79f5f9fb41be0bc41a1096dee5bb3623d","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.6.1-unstable.83.tgz","fileCount":24,"unpackedSize":102121,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCt9GiYBm3lUZdCMF5BVW6sqqX97oeHk5zdN7Olacyn3gIhAIWbK3gJEc8VfDi6c1pwO/Ycw7xWcfW7XnqJmZp0Uvb8"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi6ntHACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpiXg/+MvzW3lCuAvEshdP7vgbeC5ONFhDRSUTZQu2wAgDNHwM811BS\r\nLE8Y2q36o2E7Gw9tl7J35B95kdqqXAHiFmPMjWUnI1GVzt8D0aWTtGrpRUgb\r\nCep84YIclkMxfMjDIPzW/q2ODtPNJ4yhlZUdXYgNlKQnzcptLA0Y25mCAZuM\r\nf0EQrhZMxgslVJX+Sfyui5BXY2y/Epqh4YBnpewPhyGlDX4ydWPn8HTL94/S\r\n3ZYqG3vYkvIyMMEvH5EadWQP2OApbVx40R+GwxmmzgmdFSFDbmyq87aqYdgF\r\nOFS/RLHqnygiWK91CjVJBmozJX9UXiI1SvcW/TVIyhbTumXtc6EFbKl69aA8\r\nBpRxM+BKorZXR00oHGqsVQRAJFsjvEmHWuV+vnQOozUE31Oujx/qApGlj7KS\r\ncZPm1utzHfctU9OL9LO7vE1PSP2ZWcwVHh+MtsnFlJlyx2rNOYhI2ezimtrS\r\nPt1ixMSY1AeDcL5BydDtI6cRUmV2qNzPrcX1vSe8POI7o6XfAZmHhV+KfA5W\r\n0H4OMUQuhw3zIEHF6z0p86UKNTci6rBGUlHyM2BUz/zJZ0c6SCHRLMgMLrLH\r\n/NqKrEf5/qkiCJxzGq+24TmpPmbJ480MSSFsPPot9iZhPvmTlgt3itu1BS4D\r\nGo8rWpXTu0mtzpCLdrR1xelXKU8qU6NKIa0=\r\n=lnTw\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.6.1-unstable.83_1659534150756_0.8597749481098489"},"_hasShrinkwrap":false},"0.6.1-unstable.84":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.6.1-unstable.84","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"0.2.12","@sphereon/pex":"^1.1.2","@sphereon/ssi-sdk-core":"^0.6.1-unstable.84+d4b7207","@veramo/core":"3.1.2-next.84","@veramo/utils":"3.1.2-next.84","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.4.0","@veramo/cli":"3.1.2-next.84","@veramo/did-provider-key":"3.1.2-next.84","@veramo/did-resolver":"3.1.2-next.84","did-resolver":"^3.2.2","nock":"^13.2.1","typescript":"^4.5.2"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"d4b7207bc5a97e97841c9236b8dad1b6cb6bfafb","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authentication request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst createAuthenticationResponse = await agent.getSiopAuthenticationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authentication request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationRequestDetailsResponse = await agent.getSiopAuthenticationRequestDetails({\n  sessionId,\n  verifiedAuthenticationRequest: createAuthenticationResponse,\n  verifiableCredentials: [credential],\n})\n```\n\n### Verify authentication request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthenticationResponse = await agent.verifySiopAuthenticationRequestURI({\n  sessionId,\n  requestURI: createAuthenticationResponse,\n})\n```\n\n### Send authentication response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationResponse = await agent.sendSiopAuthenticationResponse({\n  sessionId,\n  verifiedAuthenticationRequest: verifiedAuthenticationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.6.1-unstable.84","_nodeVersion":"14.20.0","_npmVersion":"lerna/4.0.0/node@v14.20.0+x64 (linux)","dist":{"integrity":"sha512-xQVSKm7bsF37+E9RAA1U8iESghanSDdkIiDrTmrFBaehVwYyv6imuBaKEGqIfnRlGu1D/0T7ENM87j5jarxR3w==","shasum":"19f8e2bd51303547238189627741efdd37993ac0","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.6.1-unstable.84.tgz","fileCount":24,"unpackedSize":102121,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDErwFxxcAGfRzoQmVEi/qX/TYSHvrhXDh700MgR0/RwwIgNwLxGsxcg50nmiM1cyLHfOIQ2LYy/T/9IP/kuwQKEOs="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi6sGcACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpMrg/+K+/JzdFmEQvTgv+Gl6YfAc7yF/An+seksSM7v/M6dfS5GAfT\r\nC6/IXUyla/kMarsFs0pshecwmhRu4cPAUlYr4GT9pyp3XHsP6uRSZj6Xu6hP\r\n7/h15kjaxwHN0T/cyynmQmV+MR1dbrKD06AWTupiMy2iHn+i7U13l6Ny6nbk\r\nJ8pnKCB7XmcciHk2TzXoQ1CEwmJInCnfGpxr/1HS/mHmZbEUONp6I/fZnJ0V\r\nTpQLYl2GqVGXBAN22EmBkVbdPwdiNjpEfwZwfXTL70rOJmDLTsQGfF4WbMXh\r\nXGV1mp6DLeudo/PCu4XZm55f7fSn9St4dVMisTd2n+t65KyF7icW+K4xTnKa\r\n7uGSaGNNwRD7cLJkB5wlMjFnTFyzcF9YWRmsL7mGqjMgPFfFBrdwj/QzgRzi\r\nntrweupbgDMS5uVKwdr0HXSY8FiEtVJKVFK80iSylsmv3aTzdjGHCwG9twnq\r\ntV5wuZEghNi7dwjeSHm+vUvAkXCnC0XBtmmonv1ycpZxn2QumWiDyJkh02yS\r\nAKf7cSGKr2DlstJdlFcZ/jY15WzlU1nZ1EtKn5Te9ZbZLdusRDBbicj705JB\r\nWuwEDPCxSAoi4gvJF5I59XrRIi3fLPoHrz9hHxo0rUU3+5wZCLTz1vckdT2p\r\nygGsEr5oaPOFMBCiln+JYv8KRBb83oi3fiA=\r\n=0Wy1\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.6.1-unstable.84_1659552156531_0.6435881636944341"},"_hasShrinkwrap":false},"0.6.1-unstable.86":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.6.1-unstable.86","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"0.2.12","@sphereon/pex":"^1.1.2","@sphereon/ssi-sdk-core":"^0.6.1-unstable.86+974e837","@veramo/core":"3.1.2-next.84","@veramo/utils":"3.1.2-next.84","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.4.0","@veramo/cli":"3.1.2-next.84","@veramo/did-provider-key":"3.1.2-next.84","@veramo/did-resolver":"3.1.2-next.84","did-resolver":"^3.2.2","nock":"^13.2.1","typescript":"^4.5.2"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"974e8371a30483c7496bde1acc3346bd8f86661f","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authentication request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst createAuthenticationResponse = await agent.getSiopAuthenticationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authentication request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationRequestDetailsResponse = await agent.getSiopAuthenticationRequestDetails({\n  sessionId,\n  verifiedAuthenticationRequest: createAuthenticationResponse,\n  verifiableCredentials: [credential],\n})\n```\n\n### Verify authentication request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthenticationResponse = await agent.verifySiopAuthenticationRequestURI({\n  sessionId,\n  requestURI: createAuthenticationResponse,\n})\n```\n\n### Send authentication response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationResponse = await agent.sendSiopAuthenticationResponse({\n  sessionId,\n  verifiedAuthenticationRequest: verifiedAuthenticationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.6.1-unstable.86","_nodeVersion":"14.20.0","_npmVersion":"lerna/4.0.0/node@v14.20.0+x64 (linux)","dist":{"integrity":"sha512-758/F0lvdOAmnfN26NWFFhm0E9sOx+fuAW7l14CPcJVwigg5wkqroBAxmvKvgXQOjeI+xDPAlPkdmGzBBVR15A==","shasum":"2a76c31528498d30dc51d72574bf465d42b91c56","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.6.1-unstable.86.tgz","fileCount":24,"unpackedSize":102121,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC1Mqzm6ryt0XFmGjxeJJTsoIRCSeF0Vzq1Ybzw7DMfwQIgQ2izbYAnnmfVyRanBEPII1GSnDjsyPHOuV3OyjRhkTQ="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi6sQ9ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmozZA/+Oqfmw7aU0RczyGWHQCocb0TcGAZ1+iOoIldLazMyN83q7la3\r\no5LyGqsJKgA601KbF9azXZy6MH9DpbUk2/K0+Ow5Q+w2JtgUxX93gU/MASER\r\nRv2FS/nQ1LAGN+gyXnPHfPK8x4NrKcnPOUTfJKazux5HvJgs/irjjq9B+FG2\r\n2xvqJG7e7+AV1AwC7gjID8ddlYwDozleEVtlnF/49S28PRRPZ9F4hMWgi9M7\r\nO8+ZGK/MxeSkZx14ke6GFMnxuxePZn1WsJVmnv6D8hT2dKE0SdqT8tjMbHpt\r\ngTK+QOBIp+1oH7PAYybGYVsRT37BMnr1UVQCS9ljD1CeOsgnJDTnEVUJsWKr\r\nx7focUXMOX3aiLzHFH/CAwLxwnDjk6/YXl0QQZz9bxqy+SloNTMjvgsYQceo\r\nZ5hG34wBQJOfmj02hjjVStS+dg2vDwofDcwyA+YvFUVwKdxGFiDQsHjmkI6+\r\nVRrsQ/k6wap2JQsQyhWmj1Uu7jYHkupHDzGDI/0M+6x6F9WsgpX5looC0tjl\r\nlRxJR1taau580EqUSAm8mv0ttjXD0TBvUPBDFyjOO7A7hBRuiAzeizDIzXkL\r\nl026VTrs0T40sDB5Yrmh4+2CoLlRtycPIXPjM8RV4lF6Ite1xQHpcMQqN6fu\r\nVMMVl9h/6xlcCoJAU1VoM/jmH76jZfBTXw4=\r\n=1muL\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.6.1-unstable.86_1659552829178_0.9212793022065318"},"_hasShrinkwrap":false},"0.6.1-unstable.87":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.6.1-unstable.87","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"0.2.12","@sphereon/pex":"^1.1.2","@sphereon/ssi-sdk-core":"^0.6.1-unstable.87+86e6aa3","@veramo/core":"3.1.2-next.84","@veramo/utils":"3.1.2-next.84","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.4.0","@veramo/cli":"3.1.2-next.84","@veramo/did-provider-key":"3.1.2-next.84","@veramo/did-resolver":"3.1.2-next.84","did-resolver":"^3.2.2","nock":"^13.2.1","typescript":"^4.5.2"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"86e6aa3b5d64eee0765b6b0d8a049dd3f2b5d4fc","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authentication request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst createAuthenticationResponse = await agent.getSiopAuthenticationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authentication request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationRequestDetailsResponse = await agent.getSiopAuthenticationRequestDetails({\n  sessionId,\n  verifiedAuthenticationRequest: createAuthenticationResponse,\n  verifiableCredentials: [credential],\n})\n```\n\n### Verify authentication request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthenticationResponse = await agent.verifySiopAuthenticationRequestURI({\n  sessionId,\n  requestURI: createAuthenticationResponse,\n})\n```\n\n### Send authentication response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationResponse = await agent.sendSiopAuthenticationResponse({\n  sessionId,\n  verifiedAuthenticationRequest: verifiedAuthenticationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.6.1-unstable.87","_nodeVersion":"14.20.0","_npmVersion":"lerna/4.0.0/node@v14.20.0+x64 (linux)","dist":{"integrity":"sha512-dHERfHCqtVC2f/SvTQw9ISgnfmDmjoVVS+jrjxQiUMSp1FS80KqVIffw8a84BY6sgaf7C94habkkBKYwS59Y7Q==","shasum":"f9f3d01000c200482f088f89b394327ac134c996","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.6.1-unstable.87.tgz","fileCount":24,"unpackedSize":102121,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCdRxdPCMSMkF+1kn7qi1VwJJGIE3rcA5INZHh28RaN3wIgV+AvwsdUZy+X/z6gCfKOZge0eakFXlD2xcVu8WS6Et8="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi6tVSACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmrfrw//aQ8ubL91p6/ScoU7z99/P9WEV3kteiJUtwK8jeTXvzpj6z+a\r\nEbjcsr60I+QOzbnAYS6OIJCoUnDWqW0jKD6Z8LNR6HagoD6kEZBFois9Ke1o\r\nH5O3+zocE7BkSi7vhkNsFHTFRmSCrFi2bEGibZ5xSZ74+9b+ykib5MphXHOA\r\nXLmiLbpF7Tfh5SBtqiAmSmPCGJtuNPIKAuuJCQs/qroXwKhah+ZiMKV3M415\r\n9qdO5MLURCePyIxwQ/JYzsJ0/5omwfhVCJbU0XC+xie20OOJxAYLJLSpRPj3\r\nlnpDhwzZlFYPU/VYwb2LEmRDG4FJ/+rsWpX2UCeEYf0afNldO2YVwpNQ1Zu7\r\nAmsY16okgGjxmrR6TLieYE1ZcW7EykpaQS3G6gQnfMUhZvD3ytfB4cOGGRgG\r\nuEBXiIOygyRhg4APWiDNwpw/kwrEkLaKXpDR5Xl6bO53NT4wlkgsF0X9LagH\r\n0uRp46prDZ+rTgEbmTB4DcLy9zZTZbDUG68v67UZpPuPCQ1YLNdMEzYyB3Ji\r\nTz+H9I3gltDs1gXzpsOlLeyLvGfYPba8n2FLmenLfWZvNyziJc+bNYwxG7n2\r\nkM1NpD9B4eIxhBPzsqoJzXnc/7tXlgRbD+e/q6Ig5oASlruzxMu3uUPXm6MN\r\n7e+0KAIvzpiK+Yx9AWodpRh6WHJushdE5w0=\r\n=xM0G\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.6.1-unstable.87_1659557201780_0.7174737111812997"},"_hasShrinkwrap":false},"0.6.1-unstable.88":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.6.1-unstable.88","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"0.2.12","@sphereon/pex":"^1.1.2","@sphereon/ssi-sdk-core":"^0.6.1-unstable.88+5367e34","@veramo/core":"3.1.2-next.84","@veramo/utils":"3.1.2-next.84","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.4.0","@veramo/cli":"3.1.2-next.84","@veramo/did-provider-key":"3.1.2-next.84","@veramo/did-resolver":"3.1.2-next.84","did-resolver":"^3.2.2","nock":"^13.2.1","typescript":"^4.5.2"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"5367e3400bab10edefedb6bbe710089e85303e7b","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authentication request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst createAuthenticationResponse = await agent.getSiopAuthenticationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authentication request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationRequestDetailsResponse = await agent.getSiopAuthenticationRequestDetails({\n  sessionId,\n  verifiedAuthenticationRequest: createAuthenticationResponse,\n  verifiableCredentials: [credential],\n})\n```\n\n### Verify authentication request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthenticationResponse = await agent.verifySiopAuthenticationRequestURI({\n  sessionId,\n  requestURI: createAuthenticationResponse,\n})\n```\n\n### Send authentication response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationResponse = await agent.sendSiopAuthenticationResponse({\n  sessionId,\n  verifiedAuthenticationRequest: verifiedAuthenticationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.6.1-unstable.88","_nodeVersion":"14.20.0","_npmVersion":"lerna/4.0.0/node@v14.20.0+x64 (linux)","dist":{"integrity":"sha512-QqY24DzAhDOew1Bh7rl5AwWhkdduNte6GizudZ0rkTuJwM5A+iKBJBJLu8FiIapFc30GNOtPDacLjrUAmFIbwQ==","shasum":"1bcc49a8f96a2c4536ce3c3d51837df01be8c225","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.6.1-unstable.88.tgz","fileCount":24,"unpackedSize":102121,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAL9uqetL4DWh/SUkKIIGtY/jGsE7tVLoPCwHeO97WboAiEAnY2E9zjUaJY054lXfH6Vi/yaVxddOtNPQefBxhH5SbY="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi6u4NACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpYxw//cv2NVbXeG0XiKiMkhPtEegzlhpUfwN3NAHbNYHNGhL3KKf5y\r\ny990v6vNeoPUuff+v6xFpTLuNCNZtrqFLxQObbXE9QFkVkKnPx1QUCXGQO3L\r\ntPvqMiZF+6fmN2u6n85y4XR0t0eNZugLW8iweugaUkeGafEBp0waEdd8wxfE\r\nKIMtMdAM7lMhlqt5WqHMSRb1MwoUQ5aCN6q9SRROMY43MopKLkiCKnyLXWjc\r\n/hU+DTOFJDe5yPHujseTCeFF1gX2rze6Sy0FsndpO5hCi7aY9pYyRxwIsDxc\r\n0V9yOWlFSleA60dfDI7DS5YFKNc64I8pTrB+oayzSWmo3CwAUi5xqpHszURs\r\n0z/TGJpuuV5NOLSlu4ERLoukEhyFeQ0knBmTDzREeOHW1jhzJzIjZGmvtORt\r\ntb0Mtaqdfn9a7TV1nvOOEihlGEeTz47qkH1PaGN8QbsYbBKq8I+TfUbEhRK3\r\nL8KtvcGkXU+6FfXGoXg4t122U1J3uwqqhOyu6ecFOeD8+NA6k9mGKdZv0CgJ\r\n5d93kw4vf84whPyi508GvcnbPdEJSO8d3pJZa660UAk0vtSjUw9JmC/TnUDy\r\nd8pZcsj7YOBzjP2Mp2l1Kq5j97xzeRQKTbqCuFE00DrX7FnispeCVnLJgk40\r\n9W9hxOIAbSB3t2EOj9299E25TsIo1LD966o=\r\n=R4Jt\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.6.1-unstable.88_1659563533076_0.1764838849787118"},"_hasShrinkwrap":false},"0.6.1-unstable.89":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.6.1-unstable.89","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"0.2.12","@sphereon/pex":"^1.1.2","@sphereon/ssi-sdk-core":"^0.6.1-unstable.89+9acad48","@veramo/core":"3.1.2-next.84","@veramo/utils":"3.1.2-next.84","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.4.0","@veramo/cli":"3.1.2-next.84","@veramo/did-provider-key":"3.1.2-next.84","@veramo/did-resolver":"3.1.2-next.84","did-resolver":"^3.2.2","nock":"^13.2.1","typescript":"^4.5.2"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"9acad48023206ed51a8e82f414ea5dc7892884a0","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authentication request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst createAuthenticationResponse = await agent.getSiopAuthenticationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authentication request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationRequestDetailsResponse = await agent.getSiopAuthenticationRequestDetails({\n  sessionId,\n  verifiedAuthenticationRequest: createAuthenticationResponse,\n  verifiableCredentials: [credential],\n})\n```\n\n### Verify authentication request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthenticationResponse = await agent.verifySiopAuthenticationRequestURI({\n  sessionId,\n  requestURI: createAuthenticationResponse,\n})\n```\n\n### Send authentication response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationResponse = await agent.sendSiopAuthenticationResponse({\n  sessionId,\n  verifiedAuthenticationRequest: verifiedAuthenticationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.6.1-unstable.89","_nodeVersion":"14.20.0","_npmVersion":"lerna/4.0.0/node@v14.20.0+x64 (linux)","dist":{"integrity":"sha512-x7tIxgwuUExbOJ3sCXd8jdeTVhuFKEnccLMumbj0hUQu1XceFx/mOLgMjD0FzAwMasvc15XopHH5dAFvIIWoTg==","shasum":"b81a80f196696065dfc3e8e22cf08d91affdc706","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.6.1-unstable.89.tgz","fileCount":24,"unpackedSize":102121,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDjgoobudycswZbtsFzPIhPN2ziMs7D6TlA6LBLXSdIUAiBqM5Hup3CfXBY1FELPk2xytuSbNzIsmAfCqwSQ3oehFA=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi6u7nACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoMgg/9GcUNWkbrqVR/XcUZl0tY8uAeRAIRiwJLd3hcPeGYI3wnlJB3\r\nXmD5vK4O9u7oIb6fWkGbWaUB40vXvCIdgPEb1SpzAv1WALbhFxgjePMG1xea\r\n6YIi5mN7ejhe80+z8YPjtYB2GxLt0OaCgVu1Y+tudwYhJOf93q8GgytFnewm\r\nV8hVYuKJcZLSihnDON5nIkFXYMHFlyPfugWhUYtrnlJ3ZgBPhjpy8VzAh2KI\r\nCXpKuAwaGCoBXReI4I9PnDTtjdsHJd1/3GL7en2JfYIvU0rmW6B/QY3Rxxfo\r\nxCjF3HhPh+fA/APrbZb+r05QvEzVK+rQhkefFmLHAA86+l/jme+IlrAwbIwV\r\nNuNq0vKCQ6HIt3tjMZZTaVkHDaLg8T+WvMpZtDUSadRn5EjTAf9asGFbxFQG\r\nzWdJ100alPzycDurhROJVvYNDR91lBaqiSIrwRpvqNmdajvTFT/b58MpdlXi\r\nhNM5jx2s5z2xSptQot9WtAgCi9+v9l7qm4OJMpDK8XK3FDSZ4QCbL3oESQoC\r\nxh/eCcnjd8H7x85IAYwLBXQRnFyLn5vFrNAAGGEeq/4A4VpSL5ZXJ2OlwsQn\r\ngEb8bp0PEVIgui+tN9sct5c6W+k8tnO/Pgo4pEkVroQQcUMmZo9JDQWhFhmr\r\n2HtDfQkszqwV1svHiNfzLJSQmIkQQaue1m8=\r\n=YP5A\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.6.1-unstable.89_1659563750858_0.8108881436942577"},"_hasShrinkwrap":false},"0.6.1-unstable.90":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.6.1-unstable.90","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"0.2.12","@sphereon/pex":"^1.1.2","@sphereon/ssi-sdk-core":"^0.6.1-unstable.90+13f402a","@veramo/core":"3.1.2-next.84","@veramo/utils":"3.1.2-next.84","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.4.0","@veramo/cli":"3.1.2-next.84","@veramo/did-provider-key":"3.1.2-next.84","@veramo/did-resolver":"3.1.2-next.84","did-resolver":"^3.2.2","nock":"^13.2.1","typescript":"^4.5.2"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"13f402a7a6a0b7820c7961c83460e77920950b23","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authentication request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst createAuthenticationResponse = await agent.getSiopAuthenticationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authentication request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationRequestDetailsResponse = await agent.getSiopAuthenticationRequestDetails({\n  sessionId,\n  verifiedAuthenticationRequest: createAuthenticationResponse,\n  verifiableCredentials: [credential],\n})\n```\n\n### Verify authentication request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthenticationResponse = await agent.verifySiopAuthenticationRequestURI({\n  sessionId,\n  requestURI: createAuthenticationResponse,\n})\n```\n\n### Send authentication response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationResponse = await agent.sendSiopAuthenticationResponse({\n  sessionId,\n  verifiedAuthenticationRequest: verifiedAuthenticationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.6.1-unstable.90","_nodeVersion":"14.20.0","_npmVersion":"lerna/4.0.0/node@v14.20.0+x64 (linux)","dist":{"integrity":"sha512-fnkt76MnQSiYH4VVrTY8mg45UICVYjCxBRulSmDpivcKIxHPVFEC3Ygdm6jHoSxHrxVNRNDZbuCA7hs6bI8RCQ==","shasum":"925947257c2a4c6656c0a8ac45196f8318050b28","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.6.1-unstable.90.tgz","fileCount":24,"unpackedSize":102121,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBV9/jDBqS5Roz2SqB4ZowqlFX4BEyLqzPfUqFKbjX18AiB2RmsAXOwFutf1JfQzVe1Kv6w8+NIErkrgb4xBk/lsJw=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi6vIeACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr7ww/+Na9s8y3CN9DdKuMcAU9WPvfz3Xhz/3aHXZknZfRzXEDvGMZV\r\nJg6/8yYByAHCJ35rhAC/ZkGrs74KzH+t4PMtdublaq90aQp+rEmlRIK8DCSe\r\n4mYPS01ZhY4h19ZRQTHTGhS6qrWJvvAsEwDTUiRSEt13XuEVycQXr56DSGsw\r\ncaSLX1oVy0v/CsY/mDfKhfx38GD6F4VptwB2JTu72yF+yr62v6hr0wl7HV2O\r\nNRJORKfhLzG3tCYw/c2LFnMEY5LgYkecgHgtbAnj1nP1BU0HFgmclVI6mC76\r\nkUHN6fPBnG1qdUsz2u7bqHY1ot/8t4ytj+Zsp6LJzIueWVjFt6xiIoXp3rj3\r\nBrw8pUJr2JNOC+n6lqrLhlnMQZ6pbmiOXPXwa9DZ1JAq4kZWHisMCataHSxj\r\nWnbuXR/w+Uh3oxi/TjUwdhTfDGIzBbutzww+mnnNTPMmC3kFGRbMiXHSLVbS\r\n4zAUdfJB5iWI1L+kRLarl2gXcNMxMXLHTFBWdORZnOHyRJA6KXzBVpOTkHPq\r\ncPSRcC7TuVt/WIijNlAoPTXCnz/CWQEENzc7uDXizEiPU2aK+CGe9hqjfq1Z\r\nmXrWvRwE3xIDYM+BdLYkPEsezGQUI+KgqLbXObzUbxI4KLEXTk2cBu/1sx2L\r\nZxZLl5dP/Bw3eUyc0nc29BuwKasoY1GXSUA=\r\n=MIOA\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.6.1-unstable.90_1659564574728_0.4878101475859553"},"_hasShrinkwrap":false},"0.6.1-unstable.92":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.6.1-unstable.92","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"0.2.12","@sphereon/pex":"^1.1.2","@sphereon/ssi-sdk-core":"^0.6.1-unstable.92+a0b2849","@veramo/core":"3.1.2-next.84","@veramo/utils":"3.1.2-next.84","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.4.0","@veramo/cli":"3.1.2-next.84","@veramo/did-provider-key":"3.1.2-next.84","@veramo/did-resolver":"3.1.2-next.84","did-resolver":"^3.2.2","nock":"^13.2.1","typescript":"^4.5.2"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"a0b2849209ca15de97eceb0ebee53c21f20bff80","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authentication request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst createAuthenticationResponse = await agent.getSiopAuthenticationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authentication request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationRequestDetailsResponse = await agent.getSiopAuthenticationRequestDetails({\n  sessionId,\n  verifiedAuthenticationRequest: createAuthenticationResponse,\n  verifiableCredentials: [credential],\n})\n```\n\n### Verify authentication request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthenticationResponse = await agent.verifySiopAuthenticationRequestURI({\n  sessionId,\n  requestURI: createAuthenticationResponse,\n})\n```\n\n### Send authentication response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationResponse = await agent.sendSiopAuthenticationResponse({\n  sessionId,\n  verifiedAuthenticationRequest: verifiedAuthenticationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.6.1-unstable.92","_nodeVersion":"14.20.0","_npmVersion":"lerna/4.0.0/node@v14.20.0+x64 (linux)","dist":{"integrity":"sha512-1d+5jX101y1QVHaDXFY4ycBWVc2usp8qStEJOCLVJXJiJDs57J/WteuCYZtiQT3lQU937nwiiZMQleY5dhORwg==","shasum":"4c28bd252ae268b5a4c8dc11ebe15d04c9b71656","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.6.1-unstable.92.tgz","fileCount":24,"unpackedSize":102121,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAkK5c7bP9J7QOL/S9AtpJfiuw7gqG32yBI0qpCc+3alAiEAlMPw3rHL7x+1RN0+WPP/wdTN/05X9bmn6sZNuszZjvY="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi6vX4ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo+ug//cgDRZuwitfwDDOMsctQczl34cAHhYlbpZM/54qXvcYFvm6S3\r\niXuI+1TdwhqoBoICuYjAalse623D7bBFnLWB2e+zSVkEd6hoAENUfMqWEbc6\r\n89hMap6Zq6DpieVWUW0C7MWdM/G5xFDrin6eRnXXutPfyiT2WwTbNclebrVv\r\nKmplTEDn66fq1Z8T6RHUwbiC0uzFCdl3zxxHlDMVA5jO+g9cwI8YLrg/TFzX\r\nI/o8HB6dQxdyK6+wHPBlpnRqZ7Igg6u44CKuxglUhBP/Ln7guVYL3AbO85oQ\r\nYCuWDKhHn1w1FRyTXx/8wh5K3eGTDTJhtZYiO2qFhfRVgtX5XoQN6mAu3sTW\r\n8UWq1NhlYbPbR7mNqZnkQd0J4WmopDrxVjPGaIIq/XOVohfWmE+0WwisnJgT\r\nmqHxRx8c8w9lMk0NxvSrjh3co79qT/olSKG4Eo2hzoMEFxBpAvD+5ubia3eS\r\nHr+a+dUjdVUHSZcgVsPxPtQ+ntE84sW/3dPoBvfA2AHDVaRUtsChb2qikkh4\r\n1ONJhEfRHBZLUCXybju2XpGjYbEI8iAuSVryepif2yZEgZ1ujFdWJaQOjZA6\r\njWgnjA7W68B91gNeYi1Z3OHYVPQNnNji9G7mhcTAIXUDDXAbyGnpArU3b7Lh\r\nner6WCAPgpn65bjhk9Cfy2CDhigg8NwFSC0=\r\n=Auu3\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.6.1-unstable.92_1659565560466_0.8611124275514683"},"_hasShrinkwrap":false},"0.6.1-unstable.68":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.6.1-unstable.68","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"0.2.12","@sphereon/pex":"^1.1.2","@sphereon/ssi-sdk-core":"^0.6.1-unstable.68+347272d","@veramo/core":"3.1.2-next.84","@veramo/utils":"3.1.2-next.84","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.4.0","@veramo/cli":"3.1.2-next.84","@veramo/did-provider-key":"3.1.2-next.84","@veramo/did-resolver":"3.1.2-next.84","did-resolver":"^3.2.2","nock":"^13.2.1","typescript":"^4.5.2"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"347272ddc49d8bb065597a9f5bf789227fa5051c","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authentication request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst createAuthenticationResponse = await agent.getSiopAuthenticationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authentication request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationRequestDetailsResponse = await agent.getSiopAuthenticationRequestDetails({\n  sessionId,\n  verifiedAuthenticationRequest: createAuthenticationResponse,\n  verifiableCredentials: [credential],\n})\n```\n\n### Verify authentication request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthenticationResponse = await agent.verifySiopAuthenticationRequestURI({\n  sessionId,\n  requestURI: createAuthenticationResponse,\n})\n```\n\n### Send authentication response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationResponse = await agent.sendSiopAuthenticationResponse({\n  sessionId,\n  verifiedAuthenticationRequest: verifiedAuthenticationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.6.1-unstable.68","_nodeVersion":"14.20.0","_npmVersion":"lerna/4.0.0/node@v14.20.0+x64 (linux)","dist":{"integrity":"sha512-NAzHsbn8gsVxtt27hCenSsZEareBFaVhcbJvLOp/A9GbTtubbJ8k0er+FfH/AYnaxyUaXsqXmVYD8Vx3ZCHMiQ==","shasum":"f5646584de79d006d7286262c0044380cbdcf09f","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.6.1-unstable.68.tgz","fileCount":24,"unpackedSize":102121,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICpRE9rrvUsJ+7QZEoGJvdfGACLDrmjModP/i6rnAMoGAiAkHDG5RbueBCgJVwjpnNfdhHGRuo2udojKNd6d16SdsQ=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi6vZqACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr4vQ//a5WO95zfM6Tm/LJnPqDVNKjt2CnxZyT/ks2YbWCImA9H+h81\r\n43qlf+P6liZrsKyrsSmuprV/7V6+aFRVNhzrkzF6ImcIcfsmM3O8Mcm8wFcA\r\nE4MY/Y2N8G/Oz5/f2lOraXNjIzI3RS8u4RM4z0q38fY1sGuQ1kxvon62j5u7\r\nI7BHXPsBOcPE4lan/gshiBLhbAwQTNHJHURtZxpiB1iwowBidLnr4ws6d0gr\r\n2zS1KcUsqfp6xYCxoM48RWrbxpHUBOpeeKt5tuQfPoNuaAutkdepYvMxd+Cs\r\nz78MnqyGLEKj0vBlzu8SCgDSt2vNufZ1xScropyFOm3IyZOAMeZofFk+JGkJ\r\ns9PpK3wxkY01+4Z/2YS9y0hMrl+2AeAahbyXEPhyPOu9CDJeT5diFbegblpW\r\naF41Mvox0fWLAoGk3NRT57p54GD/xgUnJ5CyQZDbI2h6LVeXoi08YU1bw1bh\r\ntxekbjXHiPL14W0c9ReXgqtamD/7FAO9+O9XxM6hMcZ0Bpt+cBMAJnNRzys0\r\nFS2BrzlVT2PBNuBz4GNB8d800685/o44gny+KvmAG6dkLJOIzC1bxQmEZsug\r\nEvI9qZFgh9EbRuTPRQtQF9trmK0mZU7w0dZpkLz+xWI8UMuGjajQe3/Gl7QF\r\nM1xi5GxGkTMoaJzkKCe42mLq9CA52XxJxtQ=\r\n=Y9hg\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.6.1-unstable.68_1659565674613_0.6327708718343847"},"_hasShrinkwrap":false},"0.6.1-unstable.70":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.6.1-unstable.70","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"0.2.12","@sphereon/pex":"^1.1.2","@sphereon/ssi-sdk-core":"^0.6.1-unstable.70+0d608ed","@veramo/core":"3.1.2-next.84","@veramo/utils":"3.1.2-next.84","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.4.0","@veramo/cli":"3.1.2-next.84","@veramo/did-provider-key":"3.1.2-next.84","@veramo/did-resolver":"3.1.2-next.84","did-resolver":"^3.2.2","nock":"^13.2.1","typescript":"^4.5.2"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"0d608edd8a515687ecd4dc1cb612cd8a08474429","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authentication request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst createAuthenticationResponse = await agent.getSiopAuthenticationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authentication request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationRequestDetailsResponse = await agent.getSiopAuthenticationRequestDetails({\n  sessionId,\n  verifiedAuthenticationRequest: createAuthenticationResponse,\n  verifiableCredentials: [credential],\n})\n```\n\n### Verify authentication request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthenticationResponse = await agent.verifySiopAuthenticationRequestURI({\n  sessionId,\n  requestURI: createAuthenticationResponse,\n})\n```\n\n### Send authentication response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationResponse = await agent.sendSiopAuthenticationResponse({\n  sessionId,\n  verifiedAuthenticationRequest: verifiedAuthenticationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.6.1-unstable.70","_nodeVersion":"14.20.0","_npmVersion":"lerna/4.0.0/node@v14.20.0+x64 (linux)","dist":{"integrity":"sha512-Lw6d5h4D3PhUEWlSTPTKtiMLWEM8zTLEjZ2u5f999YzlbIzIkyGAO943NOWjz8HKbe69U4ht1/u6h3HFULvONA==","shasum":"9f939e6488876c206f05a8b5839acaa71a574cb5","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.6.1-unstable.70.tgz","fileCount":24,"unpackedSize":102121,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBLF/L5qpnwcA7Lx9s3NjsGksPkL0jNVM44+pGPp51OLAiAHS5Z2JL9F3Pl5r0ExH2w7cgKcVXYet26GQPjH7YclTg=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi6wcuACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo1Pw//VQBzsHplJ+gwMQ4CSzAOucpqJhBeDK5ACucmy1nekTli6H+f\r\nAoWVzw3xH33chefCQice5J+6N1bSqrLxbVCvDWd9d7Dyr0j2dJFf/9YZG9nV\r\n6MosWAnoqrJreKNoQsHuVsDDylLoGJ3b7UhZJGyyMhhJ4k/uNDKS+ancT96K\r\nOhIdTpqgAd1Wn1NZNIAvziGZ9vmR5nYJjQYAHSMWffpw//jxBT1ozls/hxxr\r\nPzqWHuPBCLzjld8vR2F87BUTt/sikWA5bmMyCQCnRk3wE2eSzkb7jNvqCiqh\r\nf2i2UxkfjECRJ3NAlm9ZPEGaLB/WPaCaMWaYsNu95NEKmCiKLpm8QrxXATD9\r\nUi8XA7n/ezHRhOy8TXMyPr3xsMYDLhRR8lsxErXmCHcEfd1Qr1UKXATLUsLk\r\nkdO9oxLMkfJH9Ypn9yWoXbm+jFQW8MEi6f2eXRzm0ehzrn6Fc3oRLpfvxbdz\r\nP+PjMM/968ASOJEuRcA6AK6W7R3pFpPeXOvt8OG3HO52biFVr+ZXBgBWX8Lk\r\nlT/MFL8R3jZK4uE7rjN+n9blkVC6FBkTcsHlGIY7kPrILo2VS21r5lqs6ULe\r\nxyzUldt4aqn+S58amt5DnVxUWbaKHG3sNbuxA5H8ZJu75o2BImwsV/AAWKR0\r\nlQ3MAqCgQSkup7bvahAQUhpGtsh9RQVzlP4=\r\n=w+Wk\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.6.1-unstable.70_1659569966563_0.48382054418787646"},"_hasShrinkwrap":false},"0.6.1-unstable.71":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.6.1-unstable.71","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"0.2.12","@sphereon/pex":"^1.1.2","@sphereon/ssi-sdk-core":"^0.6.1-unstable.71+ed77957","@veramo/core":"3.1.2-next.84","@veramo/utils":"3.1.2-next.84","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.4.0","@veramo/cli":"3.1.2-next.84","@veramo/did-provider-key":"3.1.2-next.84","@veramo/did-resolver":"3.1.2-next.84","did-resolver":"^3.2.2","nock":"^13.2.1","typescript":"^4.5.2"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"ed779574438feb5fd4c1927ca19c6fe41366e71c","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authentication request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst createAuthenticationResponse = await agent.getSiopAuthenticationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authentication request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationRequestDetailsResponse = await agent.getSiopAuthenticationRequestDetails({\n  sessionId,\n  verifiedAuthenticationRequest: createAuthenticationResponse,\n  verifiableCredentials: [credential],\n})\n```\n\n### Verify authentication request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthenticationResponse = await agent.verifySiopAuthenticationRequestURI({\n  sessionId,\n  requestURI: createAuthenticationResponse,\n})\n```\n\n### Send authentication response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationResponse = await agent.sendSiopAuthenticationResponse({\n  sessionId,\n  verifiedAuthenticationRequest: verifiedAuthenticationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.6.1-unstable.71","_nodeVersion":"14.20.0","_npmVersion":"lerna/4.0.0/node@v14.20.0+x64 (linux)","dist":{"integrity":"sha512-yRKY5U5PX2JYyrCGM4O5Zwj6divlnPPEwskBAvg3m6OsD+g/wXC0qfEsNnacmfLqkSBxnGVsxgPfU0DyCYr4vw==","shasum":"73259689bb4df4d482199fb5bfaf39382d2f2595","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.6.1-unstable.71.tgz","fileCount":24,"unpackedSize":102121,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDelgEmdiPixyGlkGKQWFN+5Ua6q1smnP2zUte6T5urJQIgG4avxa09Qw/RCmTD/Laj5DbuJwqYx/z+uEWjxnGTTOs="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi6550ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqKiQ//f4L5vgx1luoupOriFmZDa0axpWQ1p9zPUVvRVaj/BYylBxhl\r\nyIzmV3fF5y6neS19g5D5brErfUhTgfsLvigsxvSssSahn8EMDNS7B1F6m5mC\r\nb2Aj5ef+31J00OHW08tl5sHOc1f5NRrr9ktAJSS7jrApG5322XQwQLm+u8LB\r\nqpNb/lhbi1UkrQyTnf+K/tiLHuxQD8mMjKKXT3SUi9nnQihykWHlJd12eA7V\r\n+LB5q6tQTiF9Nh4YgZOmTnQD4OCH+LbLz6HM9MHJ6FowiE24pRVvDHg5D46+\r\ne27HWjXL1dHOxrjCDBaoBVV6tGoeNjsawKSSB4vRtcC4wWC8ndxEFCpKxnuG\r\nRbp6Ouf4wrF/hPBh4Xch8OuNccOlguSmHMhHh+dV78ET6lxabAmzobJo8g8E\r\nCIdBcUpSa6vxZEGzMLSNXmOFeswdG/Ipytb9+61jOCQppRByhpx7OFzo+i1Z\r\n0R9ME9YarYO43QFm7GWSxiGK56eNBWS+9AFgnux/6eHIr7P2X8st3rWYiT14\r\nsSZ4hHeML9CRnYEKmosH5CPA6N99ss7cuAry4KT+cJDSlU/pCWXPWoeK3wiU\r\nMDtGA0bWyz2mb7isaPGdF3xHyOqw4CoBJmraju2XzAscjDMIg7HZpTGO/VUp\r\n5PQOkwFwzRPPsDx1p4vivnfRBBWGZNXy5wc=\r\n=Ej6Q\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.6.1-unstable.71_1659608692425_0.6975285700918739"},"_hasShrinkwrap":false},"0.6.1-unstable.72":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.6.1-unstable.72","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"0.2.12","@sphereon/pex":"^1.1.2","@sphereon/ssi-sdk-core":"^0.6.1-unstable.72+f1bda5b","@veramo/core":"3.1.2-next.84","@veramo/utils":"3.1.2-next.84","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.4.0","@veramo/cli":"3.1.2-next.84","@veramo/did-provider-key":"3.1.2-next.84","@veramo/did-resolver":"3.1.2-next.84","did-resolver":"^3.2.2","nock":"^13.2.1","typescript":"^4.5.2"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"f1bda5b441d8b27fb883359124dc4f68748c6e81","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authentication request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst createAuthenticationResponse = await agent.getSiopAuthenticationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authentication request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationRequestDetailsResponse = await agent.getSiopAuthenticationRequestDetails({\n  sessionId,\n  verifiedAuthenticationRequest: createAuthenticationResponse,\n  verifiableCredentials: [credential],\n})\n```\n\n### Verify authentication request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthenticationResponse = await agent.verifySiopAuthenticationRequestURI({\n  sessionId,\n  requestURI: createAuthenticationResponse,\n})\n```\n\n### Send authentication response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationResponse = await agent.sendSiopAuthenticationResponse({\n  sessionId,\n  verifiedAuthenticationRequest: verifiedAuthenticationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.6.1-unstable.72","_nodeVersion":"14.20.0","_npmVersion":"lerna/4.0.0/node@v14.20.0+x64 (linux)","dist":{"integrity":"sha512-Mu3baY0GaoX83M6TNMl5osllLOwBiAXhATL1Ypuk5zj89w5KZVKX4uK4bHCxezU/tJ5VRNwJaNL8i8lUWTlpNA==","shasum":"1774eea2bd7b79bc2367cb779e0f325cb3754117","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.6.1-unstable.72.tgz","fileCount":24,"unpackedSize":102121,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCLJg9FRBUNZXnJxB/jYJP/WnpawWR2y41HO7+9pav6tgIgOZl70+08Okar5esbVBszFjFQgUlrGTmVv1WJEcJZd2k="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi657ZACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp90g/6A+JvSrvAcS5/u9qgtBYsDjhPzEUvDlRBoNp8AYR4SPWG7yoS\r\nwwp/rMdfcEqhYas0I3vD1Az59LMp1dz0yNkQQmuL8hBRNm0o8z3Qxenrqu+a\r\n2zzVUbdKW1k9/dqGP5Bcq9MhohRGajF/LcU+JtE0rWDORKg4DLAadT4j4wKN\r\npiW4WxU0O9s2KDn25i5vWDsq6490VSuBIgo1kHGGT8nf2nR8IXkdqIO+N/mz\r\nYRS76k8I5dTiMpkOr4OUv9JHo8VIgyhKZlTX8Q0VvVNkDANSNGwasljY8wmN\r\nHjnDJUbd8GYfpLW+ydwYXQYjTz7U6WZWkoBOIeI2a8Rd2OAGecJJG8mSHdqn\r\nVZbZmSlWFKZbixJbbfl6LH9VbckNyUvSMHoC7D6Vff/ED9fxfbxZtChooFuo\r\ngpPL5K7+MNM5Y/zOWlhOPPVmUZaB+8QPL0d7lMT7gaclOpC6nM0cJAntkbz6\r\nRXyFJzRI1Xyi2Pho136dtFvnmUN2bxfJITXgLYG4Kt/IZBa21nTcR6Y3nigg\r\nsi4O18tOnauqYvRj+HKLhABA8vAlaDQZAabjJvDIFwHIyEu3AV43Sz+znHlO\r\nNuJClXM9NDFiof8M6444OXoLrElkUdn5viWuq40dsd3RjF9spRWeaRRWpWIi\r\nfRJOx04Jsg4/lFWFAkD+/lM2gJWz4A06SMM=\r\n=uC65\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.6.1-unstable.72_1659608793808_0.10076878160783398"},"_hasShrinkwrap":false},"0.6.1-unstable.73":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.6.1-unstable.73","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"0.2.12","@sphereon/pex":"^1.1.2","@sphereon/ssi-sdk-core":"^0.6.1-unstable.73+0b45146","@veramo/core":"3.1.2-next.84","@veramo/utils":"3.1.2-next.84","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.4.0","@veramo/cli":"3.1.2-next.84","@veramo/did-provider-key":"3.1.2-next.84","@veramo/did-resolver":"3.1.2-next.84","did-resolver":"^3.2.2","nock":"^13.2.1","typescript":"^4.5.2"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"0b4514625e2771a407dca9a5083d18eeabedf33f","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authentication request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst createAuthenticationResponse = await agent.getSiopAuthenticationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authentication request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationRequestDetailsResponse = await agent.getSiopAuthenticationRequestDetails({\n  sessionId,\n  verifiedAuthenticationRequest: createAuthenticationResponse,\n  verifiableCredentials: [credential],\n})\n```\n\n### Verify authentication request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthenticationResponse = await agent.verifySiopAuthenticationRequestURI({\n  sessionId,\n  requestURI: createAuthenticationResponse,\n})\n```\n\n### Send authentication response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationResponse = await agent.sendSiopAuthenticationResponse({\n  sessionId,\n  verifiedAuthenticationRequest: verifiedAuthenticationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.6.1-unstable.73","_nodeVersion":"14.20.0","_npmVersion":"lerna/4.0.0/node@v14.20.0+x64 (linux)","dist":{"integrity":"sha512-44PMzTvLoWf0Z8l/immMIHcYu9JErQ7S72teeWo4YYvZZFGlhug8JWavwlHFK/vmC8ImoadiT4WPAe7FW0bhcw==","shasum":"a2caddc21c749555ad3b65038836e3e4039851a9","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.6.1-unstable.73.tgz","fileCount":24,"unpackedSize":102121,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGNTgrwbqDhpCQP/H887Rgu/pgbgcI+LwJ2b33rrTJd2AiEAxx7IpnNVBPWgXzUHqGRDrsji9mTMsPRkpCAzRr3gSVI="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi659IACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpN3w//STWxsBFrgcPYDZ+dyX1xiLhpKJzw1aek+xqPguT7lFVLo3pK\r\nPIvcjuQ5on513IihywnZUcZK/Ez6qQ+lv/ayI0p8P8yqatbxSMRe+BcUTMLP\r\n5aEx7XUvbtymKun+ku6xNMZ510EwzO3hp/j7wlJB4YQhVKkIfNBSmJbbevoT\r\nhg07vzKZUXIFyI2gUhs/b5O7euwDoEAUT63uOEOldmxP1pDTPIMT1G8YoL1R\r\nRlZUfPFJiOGJEOab3wgTgRWjbirlYfp2IouiPlg3xwBbxkoNmlUX6UEA70CD\r\n0+RCbXFRj434G/X8mAStaRx0m38aeuDpLSXMvWyADpJU4VCiZx67y6kOXCMc\r\nBXAMXaY4HWrDUFCl6O50xgrf4PpKhUBhqtkhej90eDzC+21i33f2MDknuEd+\r\nAqs7Q9Tl8/LkIk3IpIYpDzujxQl0iKV5peucSNPp9r9T31GYNZz4++8/Z7q9\r\nXbSvJxusfhqA0w/HNo4mg0CVtgw3td+c02+Hcn0yM0wyto7ZBOEGOMRC303R\r\nNYah7SXyNN6wzz9S+plDEAQ+Z/ULXtglWKHXGd8fJD2hO1Uh2zy+2EoxzLLK\r\n8jnEOh2v4mzmwy9kwV/m98qkFxscpmOLNFtqffnXMHVwy+uHVSAXaPTxbvcn\r\nG9AGArUUUfPMoV/L/zBjj9XWQmWlWJFGFxs=\r\n=M9AO\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.6.1-unstable.73_1659608903977_0.26452492245108195"},"_hasShrinkwrap":false},"0.6.1-next.76":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.6.1-next.76","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"0.2.12","@sphereon/pex":"^1.1.2","@sphereon/ssi-sdk-core":"^0.6.1-next.76+d3987b6","@veramo/core":"3.1.2-next.84","@veramo/utils":"3.1.2-next.84","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.4.0","@veramo/cli":"3.1.2-next.84","@veramo/did-provider-key":"3.1.2-next.84","@veramo/did-resolver":"3.1.2-next.84","did-resolver":"^3.2.2","nock":"^13.2.1","typescript":"^4.5.2"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"d3987b64fba3d460639893ff6664fa6e15178458","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authentication request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst createAuthenticationResponse = await agent.getSiopAuthenticationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authentication request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationRequestDetailsResponse = await agent.getSiopAuthenticationRequestDetails({\n  sessionId,\n  verifiedAuthenticationRequest: createAuthenticationResponse,\n  verifiableCredentials: [credential],\n})\n```\n\n### Verify authentication request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthenticationResponse = await agent.verifySiopAuthenticationRequestURI({\n  sessionId,\n  requestURI: createAuthenticationResponse,\n})\n```\n\n### Send authentication response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationResponse = await agent.sendSiopAuthenticationResponse({\n  sessionId,\n  verifiedAuthenticationRequest: verifiedAuthenticationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.6.1-next.76","_nodeVersion":"14.20.0","_npmVersion":"lerna/4.0.0/node@v14.20.0+x64 (linux)","dist":{"integrity":"sha512-/wygqzVXRYpKMVY9jP8gM4Hn8U3o/I8Lw+z45fc5svQygjz6n5WTb1Tjxd2rkQVRXzjNeaWkqnkr3Uyq7cZS0Q==","shasum":"7c10374ae72590eed6700ebb8d13db5bd7ee3b25","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.6.1-next.76.tgz","fileCount":24,"unpackedSize":102113,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCjz0WL950lbO9OuZKZXB4ZNs4EB2lpAaYSEgXx6UQoUwIhAKTP8gxpVZ92jIkWt10EJMEAipqX+1wkQz2gjXU6q8ue"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi67CXACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp8gA/+KG1gexWQ0AavUQHUOOZbxVyfBbIfxPSe+0Wnbf1Zpc6naB/j\r\nLnxKV6rD5wCKpUyerXVmCHXRbi/5yBzoQqYhleVyNn3UFEgCpzjURxvKZKl0\r\nSbMThfnJPNBxPCSQ+xH8+CT+47ep0acUneTvs51yxx4QQw9YL+hYIRKbNGU3\r\nt072z9VbMPfXfz14eXQ6UJbD3WozXhqW6ZmbTYv1k969hsNg1tWWmGR67WGt\r\nP/bB7ceOqOoJVEXr1znKv1kFflssJkgGzRVdh8JF+9TzUWfVlsmonDMThxFL\r\nUuTYioRJTUYUB+LYsMyQaDHM7uUi7i/DCCz1D++lt4Q4SPwQ/WhrL6UUdSBB\r\nsM+ir+AQe1VPbLS9G89Sy2/dpYpA0V4UZV6gXfB1CO2pLqRdbs1RAaP7SZ+R\r\nbRDY3vmzpkT1K3+34m56QIMG5mZ1Xy8u8StFhSR5lYYWXhFgTVLGVgDX8voM\r\n19XHOYAP2m5hsmqFiKHXE29HcNTgrRQZaYCMbdGb1ZyEozOKYXi3nqQgPPvc\r\ntwJvFcZHK4QK3o78qhL4GWuWV9lQ/bSvLbeW7SWhGmnT1tVAeBSj8VoRfGZq\r\nEND/tJKhAqybAb623xgpb5cRxcCX56NMIhIpFFksidhuEHXd2ZxhYhUV1/Yb\r\nuyLOjELfPo4JrmQIfeJWDxsGou16dt/nZ4g=\r\n=/pBY\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.6.1-next.76_1659613334858_0.8460148136342691"},"_hasShrinkwrap":false},"0.6.1-next.78":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.6.1-next.78","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"0.2.12","@sphereon/pex":"^1.1.2","@sphereon/ssi-sdk-core":"^0.6.1-next.78+1583f2e","@veramo/core":"3.1.2-next.84","@veramo/utils":"3.1.2-next.84","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.4.0","@veramo/cli":"3.1.2-next.84","@veramo/did-provider-key":"3.1.2-next.84","@veramo/did-resolver":"3.1.2-next.84","did-resolver":"^3.2.2","nock":"^13.2.1","typescript":"^4.5.2"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"1583f2e5a7807247270b60a7e551f2fd2f8d8030","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authentication request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst createAuthenticationResponse = await agent.getSiopAuthenticationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authentication request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationRequestDetailsResponse = await agent.getSiopAuthenticationRequestDetails({\n  sessionId,\n  verifiedAuthenticationRequest: createAuthenticationResponse,\n  verifiableCredentials: [credential],\n})\n```\n\n### Verify authentication request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthenticationResponse = await agent.verifySiopAuthenticationRequestURI({\n  sessionId,\n  requestURI: createAuthenticationResponse,\n})\n```\n\n### Send authentication response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationResponse = await agent.sendSiopAuthenticationResponse({\n  sessionId,\n  verifiedAuthenticationRequest: verifiedAuthenticationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.6.1-next.78","_nodeVersion":"14.20.0","_npmVersion":"lerna/4.0.0/node@v14.20.0+x64 (linux)","dist":{"integrity":"sha512-7tUJMUwFyXMEMIDU6XHmeWrgDqbjje4wDRmPZQTe6YQSn6yF4doDz8mZkDKcU4MCeZjCmpwolynLU7CLTnqClw==","shasum":"2079c0c6ed11bf4127a03251e6d1858f6110e04d","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.6.1-next.78.tgz","fileCount":24,"unpackedSize":102113,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFc1xiScM32CZsRQguGVcLUyQ9nhfqjf/IUQtG25YPuRAiEAplv97IXeDpol2ATjWAzLPuRu5fgVCd77oK8j4mz4oJo="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi7UAfACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmor2Q/9GjzhSIldizaPx0dmqYkPo+yGR2sjZp/ySGsUz1w3XhZCdXM3\r\npHEQVDcE52iYxumTXiHJCmQ4eeu25sVvC+FECZ9aqXS7hMbxIEyUfgCc3NSc\r\nVpmd9lwLYl9BpAVFbsORJCjDADej4H700dCg/znBpWRomdahG77QxyCNYy/7\r\n9KeqV6zyDs9B8LI8As8ClwaFb759cnSmWtR37x3xFXiLssb11938xr5l/SDK\r\naUvHXk21YM8gVlN5okwK2L2o6c4GZVSFAZTQWfTOHj1NeyfP5qCVLDDiBvqC\r\ntKO9OB8PE5i2wUHfPRvBxJQqLUM2LRjwEZ9bHRzN0Km1bCVq+UaZCp2lvP2X\r\nxycKHHgjAwJy72r2OecxPw7/SysoEJ2SYDaWlBFyaAxo5Wo8ITfh2ZZygyAw\r\nt+v7BN1Q1nZ+D08ymSng5siXWelIWmnCJfzITKgxT+MU863MUmzqHAukTe0E\r\nJ3gIQyb8/WxNdnHIRoJxsUyLTBH334A7/fP7MP1q0wCJHiFWNLAQ8CMb3EyF\r\nRI2WBNxhvNyymFN4ulmVbnqV54ftosbHkyKs+fcwKJAuusKB6z12ASjnLJbb\r\nZVjOXyfsKi9rSkjY/x5c7aMQ/uYMIU9pe2QpGp4EgJpBzNIWmj/rTqQ2XYrD\r\nWhOClP8Ea9dqL0cFj3cpQDa4yTBduHzQZjw=\r\n=ZotX\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.6.1-next.78_1659715615128_0.38883365963762584"},"_hasShrinkwrap":false},"0.6.1-next.79":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.6.1-next.79","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"0.2.12","@sphereon/pex":"^1.1.2","@sphereon/ssi-sdk-core":"^0.6.1-next.79+69825d9","@veramo/core":"3.1.2-next.84","@veramo/utils":"3.1.2-next.84","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.4.0","@veramo/cli":"3.1.2-next.84","@veramo/did-provider-key":"3.1.2-next.84","@veramo/did-resolver":"3.1.2-next.84","did-resolver":"^3.2.2","nock":"^13.2.1","typescript":"^4.5.2"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"69825d9f539bbad080d96e0f2d1601d04d583bde","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authentication request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst createAuthenticationResponse = await agent.getSiopAuthenticationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authentication request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationRequestDetailsResponse = await agent.getSiopAuthenticationRequestDetails({\n  sessionId,\n  verifiedAuthenticationRequest: createAuthenticationResponse,\n  verifiableCredentials: [credential],\n})\n```\n\n### Verify authentication request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthenticationResponse = await agent.verifySiopAuthenticationRequestURI({\n  sessionId,\n  requestURI: createAuthenticationResponse,\n})\n```\n\n### Send authentication response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationResponse = await agent.sendSiopAuthenticationResponse({\n  sessionId,\n  verifiedAuthenticationRequest: verifiedAuthenticationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.6.1-next.79","_nodeVersion":"14.20.0","_npmVersion":"lerna/4.0.0/node@v14.20.0+x64 (linux)","dist":{"integrity":"sha512-c+bCsFijh2nk83IXo+wTmwXDqhn7eIHMMohe7BNek2q8jK9DxvVyZMxIDZHhLSylhg82ZR6PPvpQ2b/77HBIQA==","shasum":"64fdae2069bf68cb9466252ab280b995e94b722b","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.6.1-next.79.tgz","fileCount":24,"unpackedSize":102113,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEwEkAsYWw16BjIjoYi4dXMR9Uz7sCJ6Bc5/jQr2nP9gAiAXWeYHG7utUi8UFkwpVijAwEcdk91r0+stAZc3pxbTxQ=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi7UGiACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr0xg/+LuaotSD+hubiasVoeD7ehcp2Wl7p9D8iE4Lv+JCyLtph7AKU\r\neLkUOqWTLxxeR8E84BNNTtKGux6V6mtu3sRb6hPO/fozQs60frzHU0VBigVI\r\ndE2n3gJnBhDRjAy5F9rAwDANw6fstchpDxI9b5AapUfCeNAK4dugOs31cW3L\r\nQW7GJ2r9hcOR0V1NILLi/YLPFCs8jr/cImcsAh/LdrHhEzSqestAwb9g8AHH\r\nK7OU3BOVQEOp6Svr/G/8u3WVvowwIFso+rOmVpY1qB+NFziiKEzbt6r/rgtd\r\noR3hBvRxdjw4q79O4+hdl+Vlz0OBk/ljW3KYfGDEKkx0r34u5zBuWz0c55pL\r\n246+70uU/Km1eSwmRBhc5mpGj9Xvhkaxb0UIcJp67WuCUTSyxBxcsohM/MaV\r\nNyCJtMx3/EUnU4Z5UefhbZpCF262QneO7WA466XJgdxownBN52zX2gAwV+6B\r\naGVo2+usVhqVcAoLQG9hB6KfuBpf3vurMJ2wwz484nNc1wPzCqgucFutYAZT\r\nD6g78GArJEdUuQ4Gfa9MibPjD/O2wRvGKudv0y3v/9xTngFY0aQko64XWcyd\r\nXcDGBbUB3Ja3JEbP2wDlvNKld+4m+EJ/3Pofh08pkrq7B7Rv3+vzUxfQIGbb\r\nH6GO8OZ19v2gipZnIHd8NqiEFtLGqzfMay4=\r\n=5Tv1\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.6.1-next.79_1659716002443_0.3848331454943421"},"_hasShrinkwrap":false},"0.7.0":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.7.0","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"0.2.12","@sphereon/pex":"^1.1.2","@sphereon/ssi-sdk-core":"^0.7.0","@veramo/core":"3.1.2-next.84","@veramo/utils":"3.1.2-next.84","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.4.0","@veramo/cli":"3.1.2-next.84","@veramo/did-provider-key":"3.1.2-next.84","@veramo/did-resolver":"3.1.2-next.84","did-resolver":"^3.2.2","nock":"^13.2.1","typescript":"^4.5.2"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"c7b02995ab00955811f9069296fefb492ed64e4d","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.7.0","_nodeVersion":"14.20.0","_npmVersion":"lerna/4.0.0/node@v14.20.0+x64 (linux)","dist":{"integrity":"sha512-zr4CJ4J4zW6wqIz+wYnH/vvNhJDEbRT2jOWXJV04iuZ2CYtjBwIuUrM14R/EgRubKCKszs13jJc1tcDyRv3bDw==","shasum":"5caef21583df7d34af6bce77bcfde39a06d8eb15","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.7.0.tgz","fileCount":24,"unpackedSize":102081,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCZLOQ5Zis3UFlc4XV39otl+ovKF8IJq9X/AUCbzREbHgIhALkYV9MVwx4tqqcjilki06Lm28sTXKM4ntoKJr9oqSVz"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi7XUPACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrdSg/9ESYCE8hoiK+MTZVDxW0ylhdp+F5AKZyDV1HaC4RD5D7WheA1\r\nZGmkQoWaNiN6kBUHwBISp9fGPSHg/bd1eqgugcXsv5oymNPPqYzIjlzbuvnK\r\nicYNDTGIG9sGlMA/c6WDiESMwG/xVc/EHKxNbaEmqyutw1TaCMVp1sTffCJZ\r\nCMonWQg9yW6EQZPN5kCqQEO/87QIrtZka5HPIaR/Fm0u1Vd3vu9BlpFoOqYI\r\nANbSDR2cW0y/6tPWgvLeJvvSr1tUsIcA7S/HoVzkCzLYIZvdTLgpxPCsnzpH\r\nONBfO2wJUfTpD76VLyNRnE4QPxT8aUV6uJ8OgkMV7WC7fmMHo+/D8TUMXOpZ\r\nk8p5UbZA0I/EL7DvAb8hcOxY0vhtR61gRT4mGPu/DDAu9ctJFzgBBhKe2WcK\r\nYvL0KBqhO0KjtYZR5i6z2WWqfDmfdxbxxR5Y62TUuVy1UDLu0CLspqHlvCa/\r\nPkYhk/UB2e2WLq7WKWEXavCuGRdkewQZP+qKtFIeIjo2UVH+wO6h+Vf35JCZ\r\ncmxOjH130Dvztqzi2z/D5BVRj7vKn4jWU5exLudquqTFekoPTAI4VWwE/ZeQ\r\n65jjeK5KyJqJtC/2smO5eqCSs5hVfLg3Nnxp9xgAFGuFR+lc+1NeNySvn0oU\r\nGLIACbLcOesMeTU3IXxLGWpsbtxll3+d/BY=\r\n=YBGA\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.7.0_1659729166884_0.7294725023805171"},"_hasShrinkwrap":false},"0.7.1-unstable.9":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.7.1-unstable.9","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"0.2.12","@sphereon/pex":"^1.1.2","@sphereon/ssi-sdk-core":"^0.7.1-unstable.9+760f456","@veramo/core":"3.1.2-next.84","@veramo/utils":"3.1.2-next.84","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.4.0","@veramo/cli":"3.1.2-next.84","@veramo/did-provider-key":"3.1.2-next.84","@veramo/did-resolver":"3.1.2-next.84","did-resolver":"^3.2.2","nock":"^13.2.1","typescript":"^4.5.2"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"760f456453494b824c2d7a95fe2b7c06494f01c8","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authentication request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst createAuthenticationResponse = await agent.getSiopAuthenticationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authentication request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationRequestDetailsResponse = await agent.getSiopAuthenticationRequestDetails({\n  sessionId,\n  verifiedAuthenticationRequest: createAuthenticationResponse,\n  verifiableCredentials: [credential],\n})\n```\n\n### Verify authentication request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthenticationResponse = await agent.verifySiopAuthenticationRequestURI({\n  sessionId,\n  requestURI: createAuthenticationResponse,\n})\n```\n\n### Send authentication response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationResponse = await agent.sendSiopAuthenticationResponse({\n  sessionId,\n  verifiedAuthenticationRequest: verifiedAuthenticationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.7.1-unstable.9","_nodeVersion":"14.20.0","_npmVersion":"lerna/4.0.0/node@v14.20.0+x64 (linux)","dist":{"integrity":"sha512-EwAdczlgU1lv16ixv4XFaM3H8I/rQdP+IugssIEuqMHA5lRex3hb5hjS3SDgrjMFli1XW4bPid314UMx9z9SYA==","shasum":"b45c9c45b4b59d82588e00c4f20cf566be6f4070","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.7.1-unstable.9.tgz","fileCount":24,"unpackedSize":102119,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCVlaNs41vCo0F42R9vBfGbBDptg2B3UNSKAItAqjiHBQIhALsxeeHlhYuNRpyuTipxTHpiPbp/SBvFKiloH6HdBGYi"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi7bWEACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrEPQ/+I1UIu7HPDhh+587Z1MZIATs/SMJtD3RT5uE8EzQGJdWgFacH\r\n2Z5txFdhg3MWKbc1ySxH7pJq50fZRE+LkEvRYG5mv65nivmsLsGiDe0vpE7a\r\ntx5hcFDqt8gIVnMxn9gFgWl4RjveavL8/tf05Lauy/55Ny+fooo/LL4JqQ/t\r\n5U6OVxwQBfvTn4vmsntCPrcNdF61yGpxQUFjFYbCDuNgaFaKLgo+xeXLtSxr\r\nQl/scdecnS62/bbORTa2kHEXkX3AiLzYuw1XzbBvZ00FKdikfXiCWt1f6W2u\r\n+QKpxV4WsnXevrINTurkCM8z96a5jT/v+yCVUqDmK2ZY3EubwJY4vMD+t0AV\r\nF5WYjMouUs005HGNnJbUF3zmDkmo/bTaHM5cxi4fR9GWxcMPqsnt42opGKXg\r\nPuXmjqEHToT9zDQWSJnYbzHFFd0g9+UZkel+G1qsoE/MOTJ7UmnzGEQqeRlb\r\nGLRaEfx3DASZ/kCpulJJM2qmu52oWUhPGF+bFDS9eA11PraPrjwFt16p5sZ1\r\nIwz6tVIl+MLBDt7IZTTiMWsiAdXp447ZBgpbOiAMBhx4rDFxBZr5slFKbEC+\r\n1Yl3YU9UQWZWo929v3BjYHMb3kJzUfvgrd693F+dHC/LSPgwyuXUF9GwU9Su\r\n/pRWQnPr44v0S3z2SNlYyfhGdDXnyBMViSE=\r\n=y559\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.7.1-unstable.9_1659745668327_0.9835818804870355"},"_hasShrinkwrap":false},"0.7.1-unstable.11":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.7.1-unstable.11","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"0.2.12","@sphereon/pex":"^1.1.2","@sphereon/ssi-sdk-core":"^0.7.1-unstable.11+c3ec119","@veramo/core":"3.1.2-next.84","@veramo/utils":"3.1.2-next.84","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.4.0","@veramo/cli":"3.1.2-next.84","@veramo/did-provider-key":"3.1.2-next.84","@veramo/did-resolver":"3.1.2-next.84","did-resolver":"^3.2.2","nock":"^13.2.1","typescript":"^4.5.2"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"c3ec119dd8eff1aa095807a90ee5a4b87c624098","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authentication request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst createAuthenticationResponse = await agent.getSiopAuthenticationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authentication request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationRequestDetailsResponse = await agent.getSiopAuthenticationRequestDetails({\n  sessionId,\n  verifiedAuthenticationRequest: createAuthenticationResponse,\n  verifiableCredentials: [credential],\n})\n```\n\n### Verify authentication request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthenticationResponse = await agent.verifySiopAuthenticationRequestURI({\n  sessionId,\n  requestURI: createAuthenticationResponse,\n})\n```\n\n### Send authentication response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationResponse = await agent.sendSiopAuthenticationResponse({\n  sessionId,\n  verifiedAuthenticationRequest: verifiedAuthenticationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.7.1-unstable.11","_nodeVersion":"14.20.0","_npmVersion":"lerna/4.0.0/node@v14.20.0+x64 (linux)","dist":{"integrity":"sha512-pIFJZbuDzCg/TlCCwewhux8O5ieRKjbMlUxRzX7dxvVowx74WPSucgamSFATm9A3XNlM1tucqITIbZJZ/+iTJA==","shasum":"d8b4b6e9bf23c7e3945346014cc428aa4455b323","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.7.1-unstable.11.tgz","fileCount":24,"unpackedSize":102121,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC1C8xTz/79tEFO/FqtStc07BGYjIs2upgiUSQLw859LwIhAIs4bqlOlpw1Uvw6xmWrceBFmWbbgvEghNpFOpxMJzGz"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi7lYZACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmps+g/+P0X2eR149AJVgYbgQV0VxUBn9APFdZgE7GEre+nswsua+NFl\r\nWxPkllTDdPfENuEJcCcdlkfOoDqFy5qnotw7dmolKqwkHJiAM3ewaShFRklb\r\nknTZPOwChaZNhuCE3arEHxDzM/5moEO2ji8FkG9B0gbiQtLq/3E8jCGOcVP+\r\nGAShO7fHMog6K5IZsUURoLSA8OkB9IQLO44jKvVWfC3+KipwXe2CKxX/lRad\r\nF2RAb+ZXn7QLtj55HFjJQIug4YhDs2cJqKcVmsgj9PGysVgkk/6x/GxGdA75\r\nzdmpX+BrSJbKZxQRW5ppoYx76UPF5q3ZfRESWFgiW0YwApu8gWOSHUXc2FU4\r\nDDRdc2yi2Gbpb5zZuvbCnxkpkGHna9MEPPhD0c5gfJ/bRlZU4wnyGF5+mHOF\r\n+WL2VaEBTErgB1Uc7iKZ51F+9ULiA7yuI/UnhLDC5IqgM/3CkUiYdySXf0cc\r\ntn1+7DuV+Sf3cGBpdLd0/juBbI4mVQv6HQOpUI/lVzFw7SN6hZYmYKutGGNt\r\nRQ1VvaC5CrpQxNkS9y7+KBm67QIzJzPNdRtO7ZJqEP7xhOwiKZIIzlUYuaJm\r\n2fnfPpkQN1veX3cnc0pfYFbLihgmAgqbLfeQPLR2lEEkqRhEkBuv92YX6H5O\r\nvaOPrN0PyisW368155dBspttqmiFHDpZBW4=\r\n=Jk/D\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.7.1-unstable.11_1659786777601_0.22673610731298766"},"_hasShrinkwrap":false},"0.7.1-unstable.13":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.7.1-unstable.13","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"0.2.12","@sphereon/pex":"^1.1.2","@sphereon/ssi-sdk-core":"^0.7.1-unstable.13+c74fb25","@veramo/core":"3.1.2-next.84","@veramo/utils":"3.1.2-next.84","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.4.0","@veramo/cli":"3.1.2-next.84","@veramo/did-provider-key":"3.1.2-next.84","@veramo/did-resolver":"3.1.2-next.84","did-resolver":"^3.2.2","nock":"^13.2.1","typescript":"^4.5.2"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"c74fb251cc3afc16bcac92731eb0fad114c6bf0d","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authentication request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst createAuthenticationResponse = await agent.getSiopAuthenticationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authentication request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationRequestDetailsResponse = await agent.getSiopAuthenticationRequestDetails({\n  sessionId,\n  verifiedAuthenticationRequest: createAuthenticationResponse,\n  verifiableCredentials: [credential],\n})\n```\n\n### Verify authentication request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthenticationResponse = await agent.verifySiopAuthenticationRequestURI({\n  sessionId,\n  requestURI: createAuthenticationResponse,\n})\n```\n\n### Send authentication response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationResponse = await agent.sendSiopAuthenticationResponse({\n  sessionId,\n  verifiedAuthenticationRequest: verifiedAuthenticationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.7.1-unstable.13","_nodeVersion":"14.20.0","_npmVersion":"lerna/4.0.0/node@v14.20.0+x64 (linux)","dist":{"integrity":"sha512-dajP3BooBzfm4zI6hzHlZmGd4959uwBIJCj7oQYiROj7c4INGn08FBegEmR0XLqWuB7ACARnRLB1tnrFDEsPMQ==","shasum":"64f288ef87c2593b0ec26d50214e8f13c676bd90","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.7.1-unstable.13.tgz","fileCount":24,"unpackedSize":102121,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDrFr9hE/py1kvTSkfQVgkrdIsVE8uGh0aEBM5PQ7oaIAiEAqhSOhBP/36WvBuHHQnPTVsgxY79TmM3+YU2FN3+7guA="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi8FTYACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqNCxAAnp4ESy6lf2t4iQp+4aoepGAsWt8KTL+H5LPrnVOK9dtSkzw9\r\nGwgdmZbz8s+NWw6/ubzMceNJNX7UxNvPlavmLK4HDhU2F+YA8TwfxqLCDW4I\r\n4OrPmAAA+IVXX72MXKpEtxdlgUMQlCneHwi1zZQJgYgWxB4W1ROyeWfqwobp\r\nK9L0On/s9TDSK3bWetbkq0RkhdSKJU5BDcAN3y0Z/RLReoRFxf/dVJ3fpzfD\r\nQ1cU1jaCYRc3bORteiz85TtyknelH4WG2uGV/P09oI0WI/aFeSa81YuGjgou\r\nG5aa7PTZFCRXtvGICjSvUujDsznlKp+7AfM8wjbd9PCgfqfKOOBAjzWSK9v4\r\nGNIJLovbnhufbmhFW+tpofhR4vGOGak8a7wpEBY5n+a5saDoJQR/GEW3t2NW\r\n4Gqr4FD8h61Kt6H1YSIeXm+Tr1VQwY+mWU2LJHOyaG8VG59kpNh1wI6Y4a8B\r\nY/c11RfltCDBR48Kdw+WlRRu7ui32AfKQSZGUGUF4YXp8g94vqdRELYBcCII\r\nylGYdoECq72bDPO4iB5r/Fm4527qDDv7WZRCOqB32sh5laPp04AfK2Db8U0r\r\nWbXd0CuEoSQQ8tlizxhV4ycAlZZ2PafBRRp6I9yb1mKPMf7ZTh5BplYmPh4p\r\n6yrVoBoaEZaaMnhl9Y+VUegkw3NRrevvDcc=\r\n=yb0e\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.7.1-unstable.13_1659917528764_0.49422790661439664"},"_hasShrinkwrap":false},"0.7.1-unstable.15":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.7.1-unstable.15","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"0.2.12","@sphereon/pex":"^1.1.2","@sphereon/ssi-sdk-core":"^0.7.1-unstable.15+3d615ac","@veramo/core":"3.1.2-next.84","@veramo/utils":"3.1.2-next.84","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.4.0","@veramo/cli":"3.1.2-next.84","@veramo/did-provider-key":"3.1.2-next.84","@veramo/did-resolver":"3.1.2-next.84","did-resolver":"^3.2.2","nock":"^13.2.1","typescript":"^4.5.2"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"3d615acba0695472d9581a04966057bf0f78206a","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authentication request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst createAuthenticationResponse = await agent.getSiopAuthenticationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authentication request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationRequestDetailsResponse = await agent.getSiopAuthenticationRequestDetails({\n  sessionId,\n  verifiedAuthenticationRequest: createAuthenticationResponse,\n  verifiableCredentials: [credential],\n})\n```\n\n### Verify authentication request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthenticationResponse = await agent.verifySiopAuthenticationRequestURI({\n  sessionId,\n  requestURI: createAuthenticationResponse,\n})\n```\n\n### Send authentication response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationResponse = await agent.sendSiopAuthenticationResponse({\n  sessionId,\n  verifiedAuthenticationRequest: verifiedAuthenticationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.7.1-unstable.15","_nodeVersion":"14.20.0","_npmVersion":"lerna/4.0.0/node@v14.20.0+x64 (linux)","dist":{"integrity":"sha512-mUm9DH4sK0Hj3/wV7wat37xizkQiRkRAMG6BPsrY4YF4WyD0qMoHiLlgBYsO7ks9t6vsNFxAOB+cwURcPKqjIA==","shasum":"9a4f23a8ee95a10bfdb5874cd17283ec9f76961d","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.7.1-unstable.15.tgz","fileCount":24,"unpackedSize":102121,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCID/IC5/AZCvXdRobeeHr7BiezGxglUUbYM4XWKVsA2ExAiEAjLvI4qP7YvtFAQHrzynHkexCjB6eq7Jh1lguqBRvIKw="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi85dVACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmouWRAAoNT072dUEEQTOrsyStE6a7aO+Pw87x/LMvXjpyBPW3v/jd3s\r\nPib/9+s+Fs+UoI60M5MCL2mMFfO6QPchqzcxAiT/FWsIKFfTXoUtIO1Hb38d\r\nENkDz/zsplJZaKlSTL+dXd492BG2WINMW/wpjFsqGQMOCqoanjuvnofgB5Kt\r\nOe44usuoMMekiV2lhNnGU6XzLEUY7TecnzIfJGaknAbMIa6EyKSZWfysaf/1\r\nFWuk9cLWyYN4DZa6FEoFE46PWSd5rkJVmnhWNhh2mzOnFGQqZvVPUbHYljn9\r\n/TZszl/Nr2JG8HXQnH72K9dD7E56EnOfEAgs6nis28a3wHFVGedXEh4FvXcq\r\nosQOsqsOuRyvKWmzd987lE8OV4NO3ZpUp6BxkqpmNyOSKt/4mIRtf+uMBK+u\r\nmp+5JfvoT6MJEZwSDuv7iKu3yu48NS6PGU8EpoRQwSGgWiT14Plg7r83u+rq\r\nDK9MdnN/M5STfg1eYxyKBenmQvkYj2jGSPwXzTcMkK9wGPflld52mrzgamyj\r\n5sUnMvSOY3CZNvTUuZK9xVlnoghvg5Y2zxyEzNGQC1MY+sUtPTQqgahvHKcd\r\nvo+Oj+ydsDgRq/u6bOHFHjYzc9OvgbWYrcVF6awfe8GU99spT/f91YNqsjRt\r\nJnevs+rIzGxusJ5pvr54+V9hXkwpGwzPSSg=\r\n=JjQX\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.7.1-unstable.15_1660131157644_0.5055941396600947"},"_hasShrinkwrap":false},"0.7.1-unstable.16":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.7.1-unstable.16","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"0.2.12","@sphereon/pex":"^1.1.2","@sphereon/ssi-sdk-core":"^0.7.1-unstable.16+e2ec3e9","@veramo/core":"3.1.2-next.84","@veramo/utils":"3.1.2-next.84","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.4.0","@veramo/cli":"3.1.2-next.84","@veramo/did-provider-key":"3.1.2-next.84","@veramo/did-resolver":"3.1.2-next.84","did-resolver":"^3.2.2","nock":"^13.2.1","typescript":"^4.5.2"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"e2ec3e9bb69c59f9546b3eb874ffafe425268261","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authentication request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst createAuthenticationResponse = await agent.getSiopAuthenticationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authentication request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationRequestDetailsResponse = await agent.getSiopAuthenticationRequestDetails({\n  sessionId,\n  verifiedAuthenticationRequest: createAuthenticationResponse,\n  verifiableCredentials: [credential],\n})\n```\n\n### Verify authentication request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthenticationResponse = await agent.verifySiopAuthenticationRequestURI({\n  sessionId,\n  requestURI: createAuthenticationResponse,\n})\n```\n\n### Send authentication response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationResponse = await agent.sendSiopAuthenticationResponse({\n  sessionId,\n  verifiedAuthenticationRequest: verifiedAuthenticationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.7.1-unstable.16","_nodeVersion":"14.20.0","_npmVersion":"lerna/4.0.0/node@v14.20.0+x64 (linux)","dist":{"integrity":"sha512-A7CVYoJSDypCKGb5Y9FHPhm2hpnbhZO4mWpBtn9Dd+jkA3+ONEZWOMhdiD/BF9TYPncsqxR9elrDxaGStYAmbA==","shasum":"59f59a4a3108b64f930faf5f4ccb890084a0b4e2","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.7.1-unstable.16.tgz","fileCount":24,"unpackedSize":102121,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIF0hR+PG0EVsLBpnaiiUXwdoLKdpRAiH4LYElbbZrTLTAiB93Wqu09YT62fdEVB3KJLHvMnKJWGmsdXImA4xDf9RjQ=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi855CACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoGzg//dZHBQKU6Hcu6qv5XcTgDJMGpNuwwNE4tTW2irGo4YI9aD7o/\r\nSmwlfqjx787UZ3fT4mJVWw2mYs76brfunzzCG/6NLoVaczGbiB5IVORYjsHx\r\n09cmVWr8e11s9shXTMXTqYOThkK+avv8Itdr+M94A4MvNB8sJkDA1GHAH+kQ\r\nPVhZEDmMySVwXTNvJmahJxXMhHr3GAS5/uYifftnSdSvGKknFkFnPqPIIXNr\r\ns43MpCDfq4Cic1OtFTqcCA5fw2GeN2vqR93MK6z6F5AxgmXqlN38fCV/LO98\r\nY4ZviUaurXwlSIPgN4lwL621kzuMJalK9pC+DgdcuI/qvrYVEp15f0t/iO+k\r\nUm9ksmHgSjDcSX4JgTI8TU3pUCN/FNENcECmj82OprKeDsPuQodV12r2hjwa\r\nIPCmlxV7eBCiL9gosl3EnbwAnBVKbPyQu4E4wAVIdaStTrNOguWUjobaoY7h\r\nm5E7E5SD37DGYfm5gpvF1AUNKvnbH4gkR9s5l5bug6B4KRllkhCiKgWC/330\r\nyDb4RPgdHdAx4W4iOYrOBvCn7+TOYnqgyiHBzMeMt0Uj9E0O5sfI8SjZD9eB\r\naK95mpWusYVw3953vonE1ID6VugI5GiSACDMQXNA/AQ/PZqSo43VLEI6rjvH\r\nhx8vkMxDNi8eS9ypnHJu3SpjN90RcyP1rkU=\r\n=x7fP\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.7.1-unstable.16_1660132930758_0.9132740827790189"},"_hasShrinkwrap":false},"0.7.1-unstable.17":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.7.1-unstable.17","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"0.2.12","@sphereon/pex":"^1.1.2","@sphereon/ssi-sdk-core":"^0.7.1-unstable.17+9046468","@veramo/core":"3.1.2-next.84","@veramo/utils":"3.1.2-next.84","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.4.0","@veramo/cli":"3.1.2-next.84","@veramo/did-provider-key":"3.1.2-next.84","@veramo/did-resolver":"3.1.2-next.84","did-resolver":"^3.2.2","nock":"^13.2.1","typescript":"^4.5.2"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"904646897b11b117e143a4da57fcafe2e0fd76f9","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authentication request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst createAuthenticationResponse = await agent.getSiopAuthenticationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authentication request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationRequestDetailsResponse = await agent.getSiopAuthenticationRequestDetails({\n  sessionId,\n  verifiedAuthenticationRequest: createAuthenticationResponse,\n  verifiableCredentials: [credential],\n})\n```\n\n### Verify authentication request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthenticationResponse = await agent.verifySiopAuthenticationRequestURI({\n  sessionId,\n  requestURI: createAuthenticationResponse,\n})\n```\n\n### Send authentication response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationResponse = await agent.sendSiopAuthenticationResponse({\n  sessionId,\n  verifiedAuthenticationRequest: verifiedAuthenticationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.7.1-unstable.17","_nodeVersion":"14.20.0","_npmVersion":"lerna/4.0.0/node@v14.20.0+x64 (linux)","dist":{"integrity":"sha512-McvCn1lLmE2pW9hqm6KKmAWwgP1Spfv0aW9RHAjoCvLoTidRtZTZN8a6xbdCapYr/QUxGUk9krrxQ7DdGg0DMA==","shasum":"9cd0aced51af1075abbc8d5c36d15ddf02cd1973","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.7.1-unstable.17.tgz","fileCount":24,"unpackedSize":102121,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGnlaS24Ir+7GZfzFeiXdsiRmCOorS5xtVLD5NIE3kYcAiEAi6+o9UrFEMoMOhqa8bEh7BUdtm5LKl3xsaxgHmIDnec="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi86y7ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmotvw//XCor9iiYjJrmfDd7+v6BnO40qCNjkxRawbDQ0py1FiQq61wT\r\nvGzmesjc+l5F3EAVXjwTkNdjyPJ7c0GgV/LWHCWf7HPBTqpfPlO7EvuPEVKZ\r\nRQgWZJJOSTsPW0DmohGclChZinFrn6X2v0ZinpfbhNM09QiGpWZ1WwWeQ1ey\r\nvKY6JLX+xLAd8+bsO9PBrwe6isoJtsLgloiCZ+1loPcseGsrXtvJu9xmK/+b\r\nr+9axrRCOYJWUl9Vi33t8EOJupeMS2DLDjzkGLebgOkn2Fflszl8VWb9ZyAF\r\nD3iK/MOZpOqOs0m+kycFmAW8bnCjakBHIH+yhjoFT5U7LxA6OkrWjlOAD4PJ\r\n3BQd8Xf1wyrVguSDCQgRrwFG/q20xCf7Vo9lhtD1kfgbKwKlTUZXvNfypvVl\r\n4lqyW0mCzY01/GHDbMS/+gAR6MQ6zQtkJIYl+i9F64MD/ai090mhEfb3bUzr\r\ns7zFzk9noJbpu08fRess36oPSYh2+gc2/rywp5tJwnPYffja0Id+cBvBbBW6\r\nwHAw7Rab0R+dsiZhOpuE6jYYT0UmLGmAA95g9U4f1sGAfwxHrIYUqow4Z5I1\r\nx82WF/NXvCPyUSlv15FGHYx0G6s16loO1VrkgJYpA/miXvZ80AhYBmrvss3S\r\nREH5X6/toEsLUFoYtW65ZbQVAlyEQnUzsMM=\r\n=5l0y\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.7.1-unstable.17_1660136635143_0.2930882946812745"},"_hasShrinkwrap":false},"0.7.1-unstable.18":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.7.1-unstable.18","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"0.2.12","@sphereon/pex":"^1.1.2","@sphereon/ssi-sdk-core":"^0.7.1-unstable.18+db658c8","@veramo/core":"3.1.2-next.84","@veramo/utils":"3.1.2-next.84","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.4.0","@veramo/cli":"3.1.2-next.84","@veramo/did-provider-key":"3.1.2-next.84","@veramo/did-resolver":"3.1.2-next.84","did-resolver":"^3.2.2","nock":"^13.2.1","typescript":"^4.5.2"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"db658c83320480a98f29310b5289a5cb53030e07","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authentication request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst createAuthenticationResponse = await agent.getSiopAuthenticationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authentication request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationRequestDetailsResponse = await agent.getSiopAuthenticationRequestDetails({\n  sessionId,\n  verifiedAuthenticationRequest: createAuthenticationResponse,\n  verifiableCredentials: [credential],\n})\n```\n\n### Verify authentication request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthenticationResponse = await agent.verifySiopAuthenticationRequestURI({\n  sessionId,\n  requestURI: createAuthenticationResponse,\n})\n```\n\n### Send authentication response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationResponse = await agent.sendSiopAuthenticationResponse({\n  sessionId,\n  verifiedAuthenticationRequest: verifiedAuthenticationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.7.1-unstable.18","_nodeVersion":"14.20.0","_npmVersion":"lerna/4.0.0/node@v14.20.0+x64 (linux)","dist":{"integrity":"sha512-p7g8sGu0eIj8Arygo+1qSRDgbWzFulsZYGKsLXAqhNDbthVFnEDe9dyYGOnokV/vz5sH8mwDPbKg6oUgAQJBSg==","shasum":"4c77e3f4169919a4359c88789e4bea669da5e867","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.7.1-unstable.18.tgz","fileCount":24,"unpackedSize":102121,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIF1cDS9yz4ECSZl517aqAwGSnQlo28ng2LHyU1Gx2jULAiARzqiXLT+Z/sKBWAvV6BZEGy2SLworkUNUhL62qYO3Eg=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi9Ao/ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrXRg/+KO2aNZOPJJLpVqPaGZbdXo/FQsQWc4ND0t+oGPRfPRMCosHO\r\nam5lzl8pP0U4+2pQiWgyuRWeer/9/VrV1KktU9QHZok0EDd6G3P63hpn5OWF\r\nygPTI8uhHFjbFIkPYyRJEk0Heou1XsM5p/TbpUqeVoZJhquqRGyPqeKnwqXX\r\nZW/FRKch9jnFv1jKxTfwXklBP7r3QKN7KvDwBXH600lteb80t6NG+fZE8lWJ\r\nXR53fLBzAoUuM/zBqAsjuCeIqbDLUCiuQ8mkeeliVqvFMrKP9qhxB9/xH/gx\r\nYOUoXKayeXkjSC4jLS2OiGke5f71VKCXqlX0VE2prHZJYSCoGsr9NtoxUCTy\r\nY7+d11ceAV5oIEjP5OlxEtfEfwLNDgiXZj2hc8yC9CTHeteqBetpwi1EKxgu\r\nASii8DkEFpjSkW39FsIpujOrp+EhBdPbTJEQhO2Hc5ncgnrXTP4IgDPH7QIS\r\n+QxLRFdBpTcjBLb7smgh0EAPwZw7ou48GvvPihH0Qi7RUOGxKORlTGhIxAKI\r\nb1X2fq0nQxLWFSRM8+zhYcch7likdNa8toSy86XwLRhKbYc7o034GZy8Z5Lb\r\nRptLQbaQjl/hZJv/t+OrAVMuysLS1Y9m6goHGL+H6NZbydjQmKBOyhVPrsbE\r\ni1KJXZ5hOuHx/ytktBQieMLiWBVc7OU5tZI=\r\n=U2gh\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.7.1-unstable.18_1660160575172_0.9991689190070843"},"_hasShrinkwrap":false},"0.7.1-next.18":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.7.1-next.18","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"0.2.12","@sphereon/pex":"^1.1.2","@sphereon/ssi-sdk-core":"^0.7.1-next.18+26f3ede","@veramo/core":"3.1.2-next.84","@veramo/utils":"3.1.2-next.84","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.4.0","@veramo/cli":"3.1.2-next.84","@veramo/did-provider-key":"3.1.2-next.84","@veramo/did-resolver":"3.1.2-next.84","did-resolver":"^3.2.2","nock":"^13.2.1","typescript":"^4.5.2"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"26f3edef541a35242769a076a8d630e15bd2e03b","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authentication request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst createAuthenticationResponse = await agent.getSiopAuthenticationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authentication request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationRequestDetailsResponse = await agent.getSiopAuthenticationRequestDetails({\n  sessionId,\n  verifiedAuthenticationRequest: createAuthenticationResponse,\n  verifiableCredentials: [credential],\n})\n```\n\n### Verify authentication request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthenticationResponse = await agent.verifySiopAuthenticationRequestURI({\n  sessionId,\n  requestURI: createAuthenticationResponse,\n})\n```\n\n### Send authentication response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationResponse = await agent.sendSiopAuthenticationResponse({\n  sessionId,\n  verifiedAuthenticationRequest: verifiedAuthenticationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.7.1-next.18","_nodeVersion":"14.20.0","_npmVersion":"lerna/4.0.0/node@v14.20.0+x64 (linux)","dist":{"integrity":"sha512-FvC9Mce8/5GQA/frQfgkt998HnWStS91NsD7YUEU11dfG/nGdzckjnbX9he6QFt8Uzp8xM3iSMp3AWZyZ+S8lg==","shasum":"a6e25a18c4ddc4704737fb170c93d172e41f9f67","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.7.1-next.18.tgz","fileCount":24,"unpackedSize":102113,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICdXNEVI0kB0Rwzs7lzqyJbK8i7U171SBef3n+nScCi0AiB75BQJnEJ1x9cj6V1Vj/JRSP3RXnRZ1kqZY3TkwgEE0Q=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi9hFXACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr+nw/8CjYpMcARbMyuGM7FFM7gO0kjkQTxnwnBGtrKoCxLQk2VmpwB\r\nSCqdcHzRlj3zFclbtDvu9z6SGPh0vqPU0Zkt/bzHwu/l8NSKCyNUVK/nbfsu\r\nQC6ToKOban5WWOMJb/lfiNLrmMbhhJQgY94IqZuP07j900r15UWbxTcoV2bi\r\noPxkMMhN2YtSxLefCKE3+4biLlaT6qZ6AbR4upTlfepGGP5s5g0lKRA6ffNt\r\n6fuZEzH4AY5BBPTWc694uTKCEmACHm2Ehu+TODnxKYhQSIzK0Kntt+eZJ4ey\r\n+sXBXPpC9ybc3hM3tDLQC/3i1QXXUCpIzFPpGA34ERk6xVilWihq5efHXbPg\r\nVsBwqXc41eHku5Oua524hyxG01PKXpr2LI+9ndN1f3IMhQc5z/V1W+gxKtNX\r\ndfsswLH6jhhuwT0ey3C1WV/zUOsFqcGBTPBOkyb3zz05SJhkE/V+4Pq1gEHJ\r\nDgKE5U0aw4yoDRIrMMnNct+pMPfT0MjfiTNP7A3QgZS/JMzFQ6pQqGwOhdqJ\r\nJtO7vNcufFs61OF1JDQSNcYXTN/PrDlhijJNwsmx3NOlIPeZ0nz9D9lR5pBz\r\n30xA3+oJBfCriInKvcBW/BitBWhJ2qC1pe95hcq7Q/MmT4eLx2N8YPJEXJcx\r\nfp05dLjuIRdzVrFzB9rc2Rh+U1rz9dePDCM=\r\n=lem3\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.7.1-next.18_1660293462885_0.020959135085792058"},"_hasShrinkwrap":false},"0.7.1-unstable.67":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.7.1-unstable.67","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"0.2.12","@sphereon/pex":"^1.1.2","@sphereon/ssi-sdk-core":"^0.7.1-unstable.67+4f3798b","@veramo/core":"3.1.2-next.84","@veramo/utils":"3.1.2-next.84","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.4.0","@veramo/cli":"3.1.2-next.84","@veramo/did-provider-key":"3.1.2-next.84","@veramo/did-resolver":"3.1.2-next.84","did-resolver":"^3.2.2","nock":"^13.2.1","typescript":"^4.5.2"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"4f3798bc8314b8a08760a15fff94d3f9b050d72f","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authentication request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst createAuthenticationResponse = await agent.getSiopAuthenticationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authentication request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationRequestDetailsResponse = await agent.getSiopAuthenticationRequestDetails({\n  sessionId,\n  verifiedAuthenticationRequest: createAuthenticationResponse,\n  verifiableCredentials: [credential],\n})\n```\n\n### Verify authentication request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthenticationResponse = await agent.verifySiopAuthenticationRequestURI({\n  sessionId,\n  requestURI: createAuthenticationResponse,\n})\n```\n\n### Send authentication response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationResponse = await agent.sendSiopAuthenticationResponse({\n  sessionId,\n  verifiedAuthenticationRequest: verifiedAuthenticationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.7.1-unstable.67","_nodeVersion":"14.20.0","_npmVersion":"lerna/5.4.1/node@v14.20.0+x64 (linux)","dist":{"integrity":"sha512-1QAoxZDrMz2l9vKOstOccqgdHvsgN26mKVOwNlBFc/Uht7I7t/0xutPEVlTsBL/nLTuDXAXCLm01xs+0Xq6bpA==","shasum":"d48fa81ab253f1d41b51806e93eaca58e753e8c3","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.7.1-unstable.67.tgz","fileCount":24,"unpackedSize":102121,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCgiO7d8QMDGCti358k1OE8fKz4BbzB9tHnqOzAoYXNcAIhAM6Sx4WvFZHYtjRTV3m6vzfZelrVdYiWg3Pc7sQKVeq8"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi9oUnACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqVjQ/9GUqnYtg3neuSf6ZzleIzlEt9qSycH9aemanpXnpPoPB9Maia\r\nKgI10m3s5JJs0LZbY+Mr1ECZ9oMblNQV1jZsU7j2PMMkYqArx3EAQt9w/5S0\r\nT3F2YH+13TuRwYkjNdB2+ZzJ3QVjofIVOKQDjdQhQdCseg9x+djPcfCELr4A\r\nuDxEadfDmbCsq5MCQAUXGleKsucE9rtFBAOdldoeX7zjfXXv72KQRYxQQWv3\r\nSLQZSqTCufGuQKr82BBdgOB8CwMQImc0560nV874aJnMfbc4YIjkomM25Swy\r\nCtWwyYfD43k9xTxdMylwUw+A07bB29cnw/YFO/+TLLh2HjlUE61aHql4Hkl5\r\nLTQAK4xBwr+2SvG/wn+sKts+d5KWiXVDx+A3YsUodqUSllBXATi+AI8Ef/f0\r\nWKnwhPEnksCVglXyw3VH101D/KOd3ZEPRP45a50eAOWKaB3GKcPcJ5XFBI9D\r\nRLAqxe4iMjIYYsvq13a8DYqRLmHSIjTx5P6d8UoleFOOAIg0E1/0gm3HOaZi\r\nTKn/c1Qy9qYR21MIs12+C8iFbqs3GKuNVcg3twNhcvaQkmSuA4mbwnLNcHzP\r\nY8LI9uP8+Yuv2YGvwp+dFGcyFze8fK0FrA++X9a1gC02RXDcLHX74O3Z5HLv\r\nB9SOAuEAT5Cp3BMg7EYyrRXxQXPWyPOnkZE=\r\n=LiPE\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.7.1-unstable.67_1660323111755_0.5329594670070352"},"_hasShrinkwrap":false},"0.7.1-unstable.39":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.7.1-unstable.39","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"0.2.12","@sphereon/pex":"^1.1.2","@sphereon/ssi-sdk-core":"^0.7.1-unstable.39+dee730b","@veramo/core":"3.1.2-next.84","@veramo/utils":"3.1.2-next.84","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.4.0","@veramo/cli":"3.1.2-next.84","@veramo/did-provider-key":"3.1.2-next.84","@veramo/did-resolver":"3.1.2-next.84","did-resolver":"^3.2.2","nock":"^13.2.1","typescript":"^4.5.2"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"dee730b73e2c451da459e244190a87a6442a83bc","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authentication request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst createAuthenticationResponse = await agent.getSiopAuthenticationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authentication request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationRequestDetailsResponse = await agent.getSiopAuthenticationRequestDetails({\n  sessionId,\n  verifiedAuthenticationRequest: createAuthenticationResponse,\n  verifiableCredentials: [credential],\n})\n```\n\n### Verify authentication request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthenticationResponse = await agent.verifySiopAuthenticationRequestURI({\n  sessionId,\n  requestURI: createAuthenticationResponse,\n})\n```\n\n### Send authentication response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationResponse = await agent.sendSiopAuthenticationResponse({\n  sessionId,\n  verifiedAuthenticationRequest: verifiedAuthenticationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.7.1-unstable.39","_nodeVersion":"14.20.0","_npmVersion":"lerna/5.4.1/node@v14.20.0+x64 (linux)","dist":{"integrity":"sha512-oQa2NZ7C1RHAKfJvRfwQGVb7jan2Y3GHJGLUC9i5c/LEwNa0sY5VOU5Z64xeP1debnglzpWDdShLdehX1mfUqw==","shasum":"653bebfe537641d64479f1d5d4055fd570232a68","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.7.1-unstable.39.tgz","fileCount":24,"unpackedSize":102121,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIH1tCCdUcjz2XCl+UZhQ0Zhboy6hUTWjQffTjUNv7CSsAiApyjdeccshVAKEG68KsgjWU1MYEx5wnx/VneoBr89epQ=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi9ovyACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp9ihAAjcSLti3HuQzbdVPmxy+FTnBLDItbs7TCsye0sL37u+sBqxZn\r\nu4BGRd69sMeIA51mNmNp+YLrX9GA53GqxZ6uZZtOLagyYsr6a2r0He1GP9ML\r\nHekYq2trpu0on1tZzZVxZyaMhsYy+9fmFyku5FRg4C8xgiCG2HtuGx5LXmCH\r\ny4ScTJAYVhracvmH5fx8iUYobGAJFwSK1UKt71m/fOU48UXZRZfEE9t85va5\r\nVTXNMHudoadpJtwW9pf/KEv0gr/uI+/EXqWiCl6cU78BF2TEtOVokyYS+pVT\r\n9vEiasF1IsfucB70TIF1Ghqr7kirf/ajmwb38jHWJZAC0N4RzhgJqGqjWr3D\r\neGzsK1kRIwoszIqmwleNuTt2uVaL7/rmnXR2UhTSUk8WmrGkd+/qSdrI9D3z\r\n62znsg8LFVbY+h5PhAL2u1JCaSdyUDj0ifsVgPDp0SL3olqljq2tf9aKNnb0\r\n8cdpluMx5J4oSR5uk0GarwKw2uIJA2lLcdjHjM/5WFThTYV+P8KunpPKs5WX\r\nkW1QwBv90feY0ADgfjxNY52XS3XMf63q7rGETUTYq6PxOXynxgRC/+LZF9+J\r\no07n0YRhdf4RmZ7eMdPepjxPb/OW/ZYs0vfaHi+Tz+owIHS8Pf2ODhQ28399\r\nCb2beJjRo9bu3Xa9w90Jg8DAMhxVB1InUSw=\r\n=0jMb\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.7.1-unstable.39_1660324850785_0.13611789032964539"},"_hasShrinkwrap":false},"0.7.1-next.38":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.7.1-next.38","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"0.2.12","@sphereon/pex":"^1.1.2","@sphereon/ssi-sdk-core":"^0.7.1-next.38+e6783a1","@veramo/core":"3.1.2-next.84","@veramo/utils":"3.1.2-next.84","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.4.0","@veramo/cli":"3.1.2-next.84","@veramo/did-provider-key":"3.1.2-next.84","@veramo/did-resolver":"3.1.2-next.84","did-resolver":"^3.2.2","nock":"^13.2.1","typescript":"^4.5.2"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"e6783a19e978e7a14225987522ada3e88bd61c40","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authentication request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst createAuthenticationResponse = await agent.getSiopAuthenticationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authentication request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationRequestDetailsResponse = await agent.getSiopAuthenticationRequestDetails({\n  sessionId,\n  verifiedAuthenticationRequest: createAuthenticationResponse,\n  verifiableCredentials: [credential],\n})\n```\n\n### Verify authentication request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthenticationResponse = await agent.verifySiopAuthenticationRequestURI({\n  sessionId,\n  requestURI: createAuthenticationResponse,\n})\n```\n\n### Send authentication response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationResponse = await agent.sendSiopAuthenticationResponse({\n  sessionId,\n  verifiedAuthenticationRequest: verifiedAuthenticationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.7.1-next.38","_nodeVersion":"14.20.0","_npmVersion":"lerna/4.0.0/node@v14.20.0+x64 (linux)","dist":{"integrity":"sha512-HA+JPUO5Ds2dOIBg+OZHiImRw4GvshXD/I7TxsDkuRPecacegu5uFd+x1VrPw/xIoGBL0TJvaKGdEToYqVedjg==","shasum":"580f50dbdd7b7658b18c4a5ecb472ea54546b94d","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.7.1-next.38.tgz","fileCount":24,"unpackedSize":102113,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIC3c/g4FemYD7pg1O4NcJbetr4IxVkAeftJ9YcOuV+wNAiAGMYpuvAwWus99rJ2IzZ0KocxERz9f1QlMGsDS3Syy2g=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi9oyCACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq/SA/8CsLh6gooFwk+4FC2PVNouv3n3GM1l77IIdT2iCV3xZbGZiMk\r\nfhHMHx2s59YYqXkeZX/XV4TXpKWweSlwn8DJVp26N7rsp46Y0QYt4brcret9\r\nE/TemfxarvpD6mAcBqs5m4SN+9P2RPpal/lLiAEe1amyDpxFDXB7qkA3B3GE\r\nQdy+GtOa1yD91rDQrWYfB0G/ylna/q3wwoE9zjm40PCusBHKqlQb0iyUUYGZ\r\n1Jv+fA2zMehKnO3CnOueHbhy0wWR2/VV+Z7meX0CXEZ9uY+vpTZJRSTq42nu\r\nLPn8ygPNuLRYyxi9NVchM1HmtblnCFWsTLy1voHO7IwxPJPrlkkJLWNd3bn7\r\nhv5As4TTt+T7Fx8yGP7velQDAp3mAMtROvM15u83hmEScUI43mTEYCyIfxQW\r\n1j+iSi/ZEMPOIzI0uRFQ7i1DvYW7+zetl+T+75dMDnhc1qayrtjyqn6Zccpo\r\ngSAa2oTWfG356zL+JRG/oDVq8qKLjqZoedKgiggoBWF49rt0+bbWpIPFvrc7\r\nEXd9ITvIM48L/HYvQYXvJk2l2bSgGu15LZZFEqGW5dbBY+ma13XsTqNBMfWD\r\nhYAhnPeSWHc9zn2CvAb1fax13B5VP7fMvYRoOc3x99Ua1X06RLntz0mr+WTB\r\nCdPi+wFy85yaNv8Q1F7cogYydBe23gouqxc=\r\n=fB1m\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.7.1-next.38_1660324994694_0.9244698239182654"},"_hasShrinkwrap":false},"0.7.1-unstable.40":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.7.1-unstable.40","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"0.2.12","@sphereon/pex":"^1.1.2","@sphereon/ssi-sdk-core":"^0.7.1-unstable.40+0b9a628","@veramo/core":"3.1.2-next.84","@veramo/utils":"3.1.2-next.84","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.4.0","@veramo/cli":"3.1.2-next.84","@veramo/did-provider-key":"3.1.2-next.84","@veramo/did-resolver":"3.1.2-next.84","did-resolver":"^3.2.2","nock":"^13.2.1","typescript":"^4.5.2"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"0b9a628b4e313eaaf767154f862cd88c58b31073","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authentication request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst createAuthenticationResponse = await agent.getSiopAuthenticationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authentication request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationRequestDetailsResponse = await agent.getSiopAuthenticationRequestDetails({\n  sessionId,\n  verifiedAuthenticationRequest: createAuthenticationResponse,\n  verifiableCredentials: [credential],\n})\n```\n\n### Verify authentication request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthenticationResponse = await agent.verifySiopAuthenticationRequestURI({\n  sessionId,\n  requestURI: createAuthenticationResponse,\n})\n```\n\n### Send authentication response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationResponse = await agent.sendSiopAuthenticationResponse({\n  sessionId,\n  verifiedAuthenticationRequest: verifiedAuthenticationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.7.1-unstable.40","_nodeVersion":"14.20.0","_npmVersion":"lerna/5.4.1/node@v14.20.0+x64 (linux)","dist":{"integrity":"sha512-13/69vV/TgAA6J+xhZOGf8rvu0QnYYxAeZKWyFb3PJ7/R2Zvq8tgFOID5TvnGFYVe8oD11KUBsLuuEgvpt9DMg==","shasum":"03ec1cc189b8fd2f688704eb4253d3df7e973ba7","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.7.1-unstable.40.tgz","fileCount":24,"unpackedSize":102121,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC74QIkR2nT95dNRNCbZ3ebWpOg/fIha07/hDfk0h/BRQIgJ5zaqzhP6poDnkmF50HDQDo7uOtF1DcGaCahp8fFcss="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi+mu5ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmrwxg//Q2gaqC8p6r6IqIV03IArfPFj1tQqir7CduEEEnBXb7tIOx/a\r\nwY+V+DAItG0juBFkELlaR49tXnzjA7HH4QbQDTQk+FMHQkZu0nUuoIRhZVGV\r\nYLgNUSO3s3y46/AGpuBXzH7FNkja+/oLAuVUzPjP95lXtCVs3yeL7/G5WtSo\r\nsMztcBmIhNoqODxi5IUqzHuJ/Jl/JJgF6xZIXhbbJ3Jfi+AaiqWcV7r6HJ92\r\nKnuraGW+hMCq/Qc6QWsLnbjJxbrkniSArnVSIpP1P9NraCLM4TMwt+ajQgnl\r\nPWGao3ITxLrIAR317IuAnLkhucTzuJSpU9CcGgKzEH7oE6ePzi1siuePljEy\r\nwyGjRvXq3OWTatIuT98vbKLsJVM5X59W06SSQbG1y09DE+cp7vQmwVAw/oh4\r\ntUllEdJJ6EtBHQWW4D042rMVT3U4X+V7NkfAPzUE6baaaINrM2MFoNz+UiKP\r\nsVihCcuX4ohvuZa7Y6JMFxC9eZdFsqTkxrndhyc3S+XEsYJ8D4pR8OrCSauO\r\nwqCYYsxbMA/DMBZYrMbUT7hUnvW5efeNxDEeXxVsHvYwbWz/d/W44BCgO3o1\r\ngloD0Ah3FcXcVXLZ+ySp9rJj3PmqKo2iNuMU5PNTvmZ7nEKz8RhbYs+VMTQA\r\nQamc8Tck7QZC5MW4AqbTlUqMt4QU0wm1uKc=\r\n=njlA\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.7.1-unstable.40_1660578745521_0.9991747517970468"},"_hasShrinkwrap":false},"0.7.1-next.39":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.7.1-next.39","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"0.2.13","@sphereon/pex":"1.1.3","@sphereon/ssi-sdk-core":"^0.7.1-next.39+2aa7169","@veramo/core":"3.1.2-next.84","@veramo/utils":"3.1.2-next.84","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.4.0","@veramo/cli":"3.1.2-next.84","@veramo/did-provider-key":"3.1.2-next.84","@veramo/did-resolver":"3.1.2-next.84","did-resolver":"^3.2.2","nock":"^13.2.1","typescript":"^4.5.2"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"2aa71696258eff9e8dd07217a6ed7b8c8198a63f","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authentication request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst createAuthenticationResponse = await agent.getSiopAuthenticationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authentication request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationRequestDetailsResponse = await agent.getSiopAuthenticationRequestDetails({\n  sessionId,\n  verifiedAuthenticationRequest: createAuthenticationResponse,\n  verifiableCredentials: [credential],\n})\n```\n\n### Verify authentication request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthenticationResponse = await agent.verifySiopAuthenticationRequestURI({\n  sessionId,\n  requestURI: createAuthenticationResponse,\n})\n```\n\n### Send authentication response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationResponse = await agent.sendSiopAuthenticationResponse({\n  sessionId,\n  verifiedAuthenticationRequest: verifiedAuthenticationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.7.1-next.39","_nodeVersion":"14.20.0","_npmVersion":"lerna/4.0.0/node@v14.20.0+x64 (linux)","dist":{"integrity":"sha512-uRnVaPGp9jYQmqaevJMxGkhiU5G/bSaBd231W25ExT3agO9PpUhEN7TVoYlyAWoWIZ5nJMJoBvIyOqWJSVuzuQ==","shasum":"34b7a3df0c9ffc99773609174abbe92e91bfdffc","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.7.1-next.39.tgz","fileCount":24,"unpackedSize":102112,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICzS1LQY8ptmXzqkSkZdLTmrPAEKx3502fsA3HaLMiTfAiEA4Pb3G3zbc0PlI8eU89/FwBWWml8AL7czF3YT55+AxPE="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi+m3HACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmokzg/+KEkWaIzpqcr6jgjf32RiQYafXWbYrWrjSKvWlfHjxRIhfiXR\r\nwd97cvmZlHzuoBAOJVd3ZUoDZwmjYsM66/2ZjltrOWfbT3ceu5qfUIYAP9yx\r\nS76cW0mKhzVrWhTuGj/PeR39X9CNLFYPu1K59GVAM2zWDAH9zBBE1dOX40A/\r\nmKtPRsK2wFDYLH20PqOW65uDh2thHerYzdwpYOsLjl57O1JPYZ0qTWSwl0gU\r\n/GD05h8H1eqorV/nE1yNvHvHJwqtN6MR35Muvvy0qqrYitJI/NWW4tf0fWdh\r\ncq4n+1NR4lS66YKFn685NGFrUUvILktfpCy7kM68YezB0+PqT6q0jjm/E0Pd\r\neWJtiQ39dIF1xjpH5w4jcvErL2QJDMXsQ2PO03VGmZbqSdqYxvwPEuzEMMfY\r\n7Q07NBUseFPx5uNkkJ8dymHaPk17a3E4+fgawwAobMdDqa9emORfpQG8k6YN\r\n4yLAV1sZr9zjKFx1e4hvqEyhpXExu//plSxhMJ+Nm0Q5uWrimU0zFf4EIShQ\r\nIln24773Txu3tulY4WaLdTMjeTygrzAmfWu56jtHl6aGVPdv3fsko37Pr2ax\r\nUjZwliIl6yWElNy//e7IEn/3r3jcnWqKFtTnFyXBO9HhruAA+CNghZt8hSOL\r\nJkoEY/W0/WwA4Ax6baeCcUPPKa2JCixFFkQ=\r\n=yyLK\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.7.1-next.39_1660579271076_0.004083022705965389"},"_hasShrinkwrap":false},"0.7.1-next.40":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.7.1-next.40","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"0.2.13","@sphereon/pex":"1.1.3","@sphereon/ssi-sdk-core":"^0.7.1-next.40+b9a4b43","@veramo/core":"3.1.2-next.84","@veramo/utils":"3.1.2-next.84","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.4.0","@veramo/cli":"3.1.2-next.84","@veramo/did-provider-key":"3.1.2-next.84","@veramo/did-resolver":"3.1.2-next.84","did-resolver":"^3.2.2","nock":"^13.2.1","typescript":"^4.5.2"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"b9a4b4320113c013f37e7a6d7304e461fa69e12f","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authentication request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst createAuthenticationResponse = await agent.getSiopAuthenticationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authentication request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationRequestDetailsResponse = await agent.getSiopAuthenticationRequestDetails({\n  sessionId,\n  verifiedAuthenticationRequest: createAuthenticationResponse,\n  verifiableCredentials: [credential],\n})\n```\n\n### Verify authentication request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthenticationResponse = await agent.verifySiopAuthenticationRequestURI({\n  sessionId,\n  requestURI: createAuthenticationResponse,\n})\n```\n\n### Send authentication response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationResponse = await agent.sendSiopAuthenticationResponse({\n  sessionId,\n  verifiedAuthenticationRequest: verifiedAuthenticationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.7.1-next.40","_nodeVersion":"14.20.0","_npmVersion":"lerna/4.0.0/node@v14.20.0+x64 (linux)","dist":{"integrity":"sha512-1y4mCUT2/76mDZGtmgYv600/7PgeG/5qM/1bwpoST8xy0m2vCkS1sdVCn4QfrxKfUHqa38Q6kkcW81DJ3nLJCA==","shasum":"5ac03ba8ccdfa7e1685e1e6fbac4adbaae518ca1","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.7.1-next.40.tgz","fileCount":24,"unpackedSize":102112,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCIe5aR5mK63RLzokK9cAK/RHY3xm1p+T2VML8DoEx5cwIhALOAppn8m5OA8HpIAoqOGNj8iT26fIplCBVvXwGnv1gB"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJi/Y/PACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr8eA/+MvH5xYNyXXGM5VsIzG9CzHkrEGo+0bWzpClh3xK81kSuQUm/\r\nl1vXw+JTQ/bhWXWsuD+Ach0uvFjPQNRH4MnCEUjc64s1DP9VLB3cRaKyz5mv\r\nWrBe2ydbsG52SJfE9Y7vJMPFaKZMd+5Os1YGTOPk5DVfwUIpzHovPu+Af5ih\r\nNw0LayzPDqT7K5qrkWsh59NXkNYMEeO5YtvZzrPrX+d1ffJ0bHx4D8vfKos1\r\n4S5EJTmjron5aiZoKokmYBZCBmBi1DI3XN+cPGbfJuLkNEw8xoe4X9gkBX2V\r\ndAymmYj9Cs/8lIHBPZPnl0GFkSdEtKhFXqI3JLFl63KA2NF4Dtcl9dAWZCEe\r\nNbu+6PHdYbvUtYodNixWm0vaPT0tNijn5GgSv6WNQj0TfILTdYr+z5LFpuHJ\r\nqilCfoCqiTHa0XSPEF7xCukB8b9/GTk0BIXGo8amw5Y1ad7rouYa1dfuA8p9\r\n3MLIKYPm7nVtor5Wnln591ACySGx/DC0ryytyJIdcI42ZRvX5/dqN55071B6\r\n/xYybtGEyAbX/HuEmxJt7ucEj4R98safpLS6+AxYxzy3LksXmpv/W7WUitSP\r\nmTvFMinP3ieR28rBgXd6mR7SF+0ItZKGInceT5HjIkvqMpTr8T0XcrmQYNRL\r\n4ImOSz3PLSmGPDQKx6GVFs10xZH6QQKaEv4=\r\n=QdCw\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.7.1-next.40_1660784591123_0.0705405141346187"},"_hasShrinkwrap":false},"0.7.1-next.43":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.7.1-next.43","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"0.2.13","@sphereon/pex":"1.1.3","@sphereon/ssi-sdk-core":"^0.7.1-next.43+6389a80","@veramo/core":"3.1.2-next.84","@veramo/utils":"3.1.2-next.84","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.4.0","@veramo/cli":"3.1.2-next.84","@veramo/did-provider-key":"3.1.2-next.84","@veramo/did-resolver":"3.1.2-next.84","did-resolver":"^3.2.2","nock":"^13.2.1","typescript":"^4.5.2"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"6389a80e4d589b359af61cd1759cb0c38c5047e9","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authentication request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst createAuthenticationResponse = await agent.getSiopAuthenticationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authentication request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationRequestDetailsResponse = await agent.getSiopAuthenticationRequestDetails({\n  sessionId,\n  verifiedAuthenticationRequest: createAuthenticationResponse,\n  verifiableCredentials: [credential],\n})\n```\n\n### Verify authentication request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthenticationResponse = await agent.verifySiopAuthenticationRequestURI({\n  sessionId,\n  requestURI: createAuthenticationResponse,\n})\n```\n\n### Send authentication response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationResponse = await agent.sendSiopAuthenticationResponse({\n  sessionId,\n  verifiedAuthenticationRequest: verifiedAuthenticationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.7.1-next.43","_nodeVersion":"14.20.0","_npmVersion":"lerna/4.0.0/node@v14.20.0+x64 (linux)","dist":{"integrity":"sha512-XJTFOXRvIag0rVsUENaz+em6ypgMZumRW92g6IrgAAplocX4IqArOsD5BEIrzdk1nJeHkyJMCWQiToVzKjGYuA==","shasum":"d481d8a95100399c9db0969a14fb703c361467ff","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.7.1-next.43.tgz","fileCount":24,"unpackedSize":102112,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC/kVlremGEgFLwi2cT6GOgnGdPQ/6LWNH7WSreDlVumwIhAJeqO8X4Cq4a8o1HS21bHD7r+ntWqaSsl1XRspgaOTmP"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjAXk7ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoD/g//fdLlBjaEEKV1XNbYcXhDhBqD2lghRoLLjZ1R5JJKbYZMKglR\r\nqAlCoPiYJUaN/pvmnwinjOVNRJCIoSjDGnt74kKLyNAIX8jV1RgcrQ/V6e8R\r\nD2o1ATxssgiOmnah3dwjRwB6f59W0ovXWVa+auTZER4EHvKkaHqKA9CxcnvG\r\nlpY3+zKPYuuHl5D8uwIpczQ9c8Ah45vcP4g9YqfoWuGhv3WKJQmf7+rRXrdl\r\nIOzSWbHydyCxxbPwhmV0vJyX+SLYxJFzFw2TmRCZfUPiIR9tlLP2NQ9NzZ3R\r\nLN8WurC5ae2qlSc3/ma2awY0ld2D+up6kYRHCztlA28KHPa1ggRsYj372oR8\r\n12xpuy1yb+y1/a1EPl/bSxfxL9pauAPXJb1GjV+SUSnmAJWirg4qm0sV+oEm\r\nD+70XTzgQ0zqUMjHQZkJRYvOuowKon5a+hinx/ViQC/RUmUcWmhQRXWRrbIc\r\n8S6Ma6Ea1v/S4+kFMDKIH6Xbyxacsz+EI94aP+dmmFAko7KSIJ0gb6H5gfHT\r\nblBzH5dQ8eeqyJ5gmDDYNJHGiIeBomg/GTWlfJa8AbO0D++PT8vNgl6kASu2\r\niGVoW5OC8ia9p5YpEPi87qnX1RZw9XUeYWfvFxD5yHRyJpd7a+rJh4F8xm+R\r\nYJMyoUXjesdmWJoZnfLLJR976CYBJ06VfeI=\r\n=NRI5\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.7.1-next.43_1661040955156_0.873564358181226"},"_hasShrinkwrap":false},"0.7.1-unstable.43":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.7.1-unstable.43","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"0.2.13","@sphereon/pex":"1.1.3","@sphereon/ssi-sdk-core":"^0.7.1-unstable.43+6389a80","@veramo/core":"3.1.2-next.84","@veramo/utils":"3.1.2-next.84","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.4.0","@veramo/cli":"3.1.2-next.84","@veramo/did-provider-key":"3.1.2-next.84","@veramo/did-resolver":"3.1.2-next.84","did-resolver":"^3.2.2","nock":"^13.2.1","typescript":"^4.5.2"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"6389a80e4d589b359af61cd1759cb0c38c5047e9","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authentication request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst createAuthenticationResponse = await agent.getSiopAuthenticationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authentication request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationRequestDetailsResponse = await agent.getSiopAuthenticationRequestDetails({\n  sessionId,\n  verifiedAuthenticationRequest: createAuthenticationResponse,\n  verifiableCredentials: [credential],\n})\n```\n\n### Verify authentication request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthenticationResponse = await agent.verifySiopAuthenticationRequestURI({\n  sessionId,\n  requestURI: createAuthenticationResponse,\n})\n```\n\n### Send authentication response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationResponse = await agent.sendSiopAuthenticationResponse({\n  sessionId,\n  verifiedAuthenticationRequest: verifiedAuthenticationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.7.1-unstable.43","_nodeVersion":"14.20.0","_npmVersion":"lerna/4.0.0/node@v14.20.0+x64 (linux)","dist":{"integrity":"sha512-v5CPVtIsdHOFGAi2cSUSpBaIbWZi0WNWixyB3gLHkaCRDyudUeP6FBaOuatBq5mwxWeH1fTeEK89rZAFEoBPNw==","shasum":"ed06078fd08b2185a3d2fa88cbe2c1904ea96171","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.7.1-unstable.43.tgz","fileCount":24,"unpackedSize":102120,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEOGcswO227/Rd+iUiMykBlLHPioZH7ZfULA+RkhE3pjAiBJI8VbL3pHhTSYPzFlKpVFejMsXXRmWnQSKwUe43dLDw=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjA72dACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrawQ//SXkFt7zb6TuXffZhNs2ENgRa/L2Ke7DmCfNySalCPMGolSzR\r\nxlRhqbMaEAhSHP3lpJjyUM2OvwvzHPGSPHZXgw4Qv9HfIRPPgeLcN/3YOi9E\r\nMMHAJwWBPWvJBcqvAnG98AVCQnocVPN9BRXTuG/qSCz9gMalTrsbHKZFTjc2\r\ny9doLuLXi/rE8cK9DixfIQ2xWP2d1dXDKI77/0O87G8SOusr7bgl3iROsrAP\r\ny17WKZ6pA92d2+xEHwyx4HjIg4O02UPsjjX17RImvWm/7kf/X9DQE0nvCCSx\r\nw6QnHl+iurOpZ/x1H6lgpT8iBdbUc6BXK4DGYfGnk4NSVQNPoJtgpTERpFY0\r\n5UtpzGrTc+9nPExdEnbDOCJzLSCqaxTFkXWQHtZqNc1dz40ih4UG0VA7PxIh\r\nBoNlRKas7kD7ZZUTtzmzVyIow/gHJLQYmBqviH88ArWTOTrhpUXu05h3tYKo\r\nWcq7nj1Xblw37fYCi1xff0WhJTxNaDKGGH/8sEt0ashPKZ840mdpY5AofiIH\r\nKyj3cfygtsfhbZkBTpDVMrvvpCVHRbU1VN+W+2hdfWJZSZN8YM0yquJ8P5J7\r\n01VVPTrOnv6p/TwbSAk/0fE8dtiJjBt5buvIBmp7CHQ437ENWNc+M3xyWySw\r\nJK/P59lNtsmjbiLJDH1XWi9ZSunRMUC35YM=\r\n=LNfK\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.7.1-unstable.43_1661189533779_0.4882521204315424"},"_hasShrinkwrap":false},"0.7.1-unstable.44":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.7.1-unstable.44","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"0.2.13","@sphereon/pex":"1.1.3","@sphereon/ssi-sdk-core":"^0.7.1-unstable.44+8c1bcf6","@veramo/core":"3.1.2-next.84","@veramo/utils":"3.1.2-next.84","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.4.0","@veramo/cli":"3.1.2-next.84","@veramo/did-provider-key":"3.1.2-next.84","@veramo/did-resolver":"3.1.2-next.84","did-resolver":"^3.2.2","nock":"^13.2.1","typescript":"^4.5.2"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"8c1bcf68b3592c1e26e5c4ffcc7725da5b42d736","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authentication request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst createAuthenticationResponse = await agent.getSiopAuthenticationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authentication request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationRequestDetailsResponse = await agent.getSiopAuthenticationRequestDetails({\n  sessionId,\n  verifiedAuthenticationRequest: createAuthenticationResponse,\n  verifiableCredentials: [credential],\n})\n```\n\n### Verify authentication request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthenticationResponse = await agent.verifySiopAuthenticationRequestURI({\n  sessionId,\n  requestURI: createAuthenticationResponse,\n})\n```\n\n### Send authentication response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationResponse = await agent.sendSiopAuthenticationResponse({\n  sessionId,\n  verifiedAuthenticationRequest: verifiedAuthenticationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.7.1-unstable.44","_nodeVersion":"14.20.0","_npmVersion":"lerna/4.0.0/node@v14.20.0+x64 (linux)","dist":{"integrity":"sha512-k16+enxfNLHgEQafnfOcl0Rmcofp7BxUsDgl+N5zUIzjiWmXOaBTI5NB3lGhlQ+nouF7gaP8v2GTd2lqfQNvaw==","shasum":"eaf24e696eb0e2887f5d9ba85c71c7249187e8dc","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.7.1-unstable.44.tgz","fileCount":24,"unpackedSize":102120,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIG9djyRkeXS1S8LmQVG8etbair+WkGXa8tMEIMPgJ4SFAiBeaJ3XAV3Z9ZxXA0ijGJhJzJ942np5t4KaQAZnbQzs9A=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjBPSdACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrgYw/9E9aNdwq23+hQki2JQO795Lf5MdCnWbrku9B9k6ECY73WS34a\r\ndlrcp5gYoH2y3jfqN1ONJjgAOyYDlhZneweJvVOkvQSVx4cktANgfiMqHofb\r\n6T3ercRtrjJJeYFTbIWz8uyvMubmTDw5waadS9mZZCdOpO8B7aNnAVOWf6NL\r\nZQsxAIUu5qDh7ZaEeKSBoVPVONE/oSrEdgH8xI+NWO6JDLMaHFmSwBzGzGQR\r\nFOmUa0uwzrSBlWYrhCy2g2Cm9BtO4kXBPFWqT/3pFX4WpyQuLGxsI8TplPr/\r\nTMFNpbG6IHPiSrunaiiJgxYt6fO8v5zMK8mV9C6Xt4eJdaAfs2gQI6RgP08/\r\nXG7K7TKJeyEQvS5wtdAxRcs2MK7EaoahaE6OQv1ef1vH0GC8UY+zJJ0JCtF5\r\n4y0yLMIsuEcv9aEa6k1aZPgn9X6G6Fvb630C2/HEopMcUDOG9SQBUp149IUh\r\nVg10pQh1x/NE9A+0ewWmVpreLHs8Z4QNAMOeLpTI+hQLYPbAs4+ONlzhlP1x\r\nphxSUgj4sA79mXTSaYCimmiHhPThzW1O4hpF7mqSef1wK0rBJE/ZVVs2Daci\r\nIyZlqCEFPYOjheUfinpQIKDRZhUY9WctiC9amvh1b2+3W9I/nz7bd/FEIjRU\r\nXU0jDcE2SabP52x2agMgHh2ej40uDFefdUw=\r\n=oH7h\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.7.1-unstable.44_1661269148893_0.4760829126230368"},"_hasShrinkwrap":false},"0.7.1-unstable.45":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.7.1-unstable.45","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"0.2.13","@sphereon/pex":"1.1.3","@sphereon/ssi-sdk-core":"^0.7.1-unstable.45+080808c","@veramo/core":"3.1.2-next.84","@veramo/utils":"3.1.2-next.84","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.4.0","@veramo/cli":"3.1.2-next.84","@veramo/did-provider-key":"3.1.2-next.84","@veramo/did-resolver":"3.1.2-next.84","did-resolver":"^3.2.2","nock":"^13.2.1","typescript":"^4.5.2"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"080808c185ae370102187781106cacaa422e7c87","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authentication request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst createAuthenticationResponse = await agent.getSiopAuthenticationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authentication request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationRequestDetailsResponse = await agent.getSiopAuthenticationRequestDetails({\n  sessionId,\n  verifiedAuthenticationRequest: createAuthenticationResponse,\n  verifiableCredentials: [credential],\n})\n```\n\n### Verify authentication request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthenticationResponse = await agent.verifySiopAuthenticationRequestURI({\n  sessionId,\n  requestURI: createAuthenticationResponse,\n})\n```\n\n### Send authentication response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationResponse = await agent.sendSiopAuthenticationResponse({\n  sessionId,\n  verifiedAuthenticationRequest: verifiedAuthenticationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.7.1-unstable.45","_nodeVersion":"14.20.0","_npmVersion":"lerna/4.0.0/node@v14.20.0+x64 (linux)","dist":{"integrity":"sha512-wN1EeYJn2lZPodynLbU4qIr/La8HKP71VZVENkODiyNoUnzHRl6LSgHikY2pBFFKau7HMiulT9M1mApqpTpV7g==","shasum":"3cfe6bf0c4723438fa23fee7a824eaa74ac820d8","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.7.1-unstable.45.tgz","fileCount":24,"unpackedSize":102120,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICK3u/+6rNCE2Vv6mZp8TtNXjdLQKh+vvBzY1+UtWYMTAiBpGth9NuTPOSdEJ5kajdeWZdNKw2r7HjeO0la9vOPtdw=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjBQdSACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqIjw/+LKbaLTCnI3utz6WPueru2zla2cMgpbfhSJCdqmSqPqfXcEni\r\nI22QtNANUZLz85sB7EFVbD4pk2Q5o/sD5kpgWkUpl5jSOOZb8fF+fQnpM3oB\r\nlHDKYAX/EfGlfl0YBBoEcnlE6ke9WVSBw2mmF/4zsNAlVc2nYZBtFancvXJJ\r\n2QRy6k8TnRci+GGekyyoemjlcLk8YWtgvZ/ZPvWfEmB5sgBxAZZHP9HhO+O9\r\nVH8WtDf8uEytOkKRxo3bTXGxwiWJWP5DHrxC22zSK/X7DueZJdb4yCwqRwca\r\nqYO+T5SsCnuR+ddcVsEk1SPoho5HktENY4ORPCLiqdudeBFDdOvbzYfxcelf\r\nAOco+AMsnGaWdx/qBFFqNtRYzL0duug5Ij/WSQJ38L/AvL1S7bov3riVsTYX\r\nJ8E3lcIXV6uhjtghLZDuYpUr2LY4UiWcVdDjkfZbUOrfswa1UHAoud4yMX3P\r\nxcw7ARLfD5IVS55KzCMCabF36vzkPY89mfuVRWxGZ/gYYS1v065kSf+3mVHI\r\nBnBmzipfdZ7fyCJFpLviyN20SgOJqyInQYoCG6/XSLEaRjVPs5lJJ6awXNQ7\r\nELu1bd37mZqU6xCLdGK8U+/q28cm2/6DBilnXuEphQPIJfmzwWBbHhAmwgXc\r\nrdcLA8pd2G5wv+OahdIEct8ERQVT5S0/fIU=\r\n=ITg8\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.7.1-unstable.45_1661273938741_0.6931283076996537"},"_hasShrinkwrap":false},"0.7.1-next.54":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.7.1-next.54","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"0.2.13","@sphereon/pex":"1.1.3","@sphereon/ssi-sdk-core":"^0.7.1-next.54+a9ccba1","@veramo/core":"3.1.2-next.84","@veramo/utils":"3.1.2-next.84","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.4.0","@veramo/cli":"3.1.2-next.84","@veramo/did-provider-key":"3.1.2-next.84","@veramo/did-resolver":"3.1.2-next.84","did-resolver":"^3.2.2","nock":"^13.2.1","typescript":"^4.5.2"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"a9ccba1270296fb1e8e74e1be73f0d2a49ae6969","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authentication request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst createAuthenticationResponse = await agent.getSiopAuthenticationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authentication request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationRequestDetailsResponse = await agent.getSiopAuthenticationRequestDetails({\n  sessionId,\n  verifiedAuthenticationRequest: createAuthenticationResponse,\n  verifiableCredentials: [credential],\n})\n```\n\n### Verify authentication request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthenticationResponse = await agent.verifySiopAuthenticationRequestURI({\n  sessionId,\n  requestURI: createAuthenticationResponse,\n})\n```\n\n### Send authentication response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationResponse = await agent.sendSiopAuthenticationResponse({\n  sessionId,\n  verifiedAuthenticationRequest: verifiedAuthenticationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.7.1-next.54","_nodeVersion":"14.20.0","_npmVersion":"lerna/4.0.0/node@v14.20.0+x64 (linux)","dist":{"integrity":"sha512-w8gZjHz5uSMyHtOlwk98rVPaqNFy8mtbR6K0dHjPn8/GZjxE4Ha5Db1ELFNJGiTLZJ4pCiWfgwB2+ya5IyBCXw==","shasum":"9c4c4e943bef3c01249ced241f79066cd5e6687a","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.7.1-next.54.tgz","fileCount":24,"unpackedSize":102112,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIH0kZbOzi9qldzcwCG3bW6JWcWIqjMt97TS2FTmuClz6AiEA24X7IYEqS4lsNnYDC9XcOrryaYfZcFQuIS6nqVHyGG4="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjB2OBACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrCHQ/9EeD3LZFhbBGDYCMEzFAATx2EXUmv6B1ijqMzRkhiyxdIvvx9\r\nU/+GeI4v26Sb6idzp/SZsVNuVTi7RxKylTFZAlGKrUUdAVgGzzGLzF8xWLqZ\r\nL0XWMq6KdHrUaWPLkoPRMiRMgb8Qf+gD6sD0bK71V2rs96aVyyXRnrzN50vR\r\nFKYydZyYItJ8LFOu7/uG9O4vTAux0NoaoCkOmPOnXPYBCsmlI198GeaWKr1y\r\nz1+lTLHmadW7EO3rlJPCODWV/BM0pENM0SbVOxOp26upqzkPMcD/pwt1EfzN\r\n6lLHPZY1OWvqy4z/glKAQSBRRaPRI7veTdD7NtMBIZFva1LYQT8AF7vw/wfQ\r\nZY3ycf7IcN7HNxPXhMApDGULO8hwbFwxcN24Jg/1It9HsCqa744n67+3+CRu\r\ntWpmaxuKX0GUmJwSg8IPE2jNLP+gj/XJv8UKaeH3xsTzC9m1Y+m2xmrT28cZ\r\n5kIVLcA8Jc5WPKmx9eg0RLuQqD5H+Dw/ywS5PeAsW4Ta8mq0Ui6Fp+bqxe5z\r\nhzsFZqhJDRZE4bsiGovkbTb9cE7bxEkIi0tz92D2+xj71rgtQwocE7aDtMjC\r\nlvFzRxuWstZJQDyL+rnGfGo9hl1WLJi0Li+ld7SL7L7xMhzb69wRAYUuR+q8\r\nH800PDHnBQDK6ebwqm+gcDZV7JbJM+HCiNw=\r\n=jMRc\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.7.1-next.54_1661428609058_0.46622875806231945"},"_hasShrinkwrap":false},"0.7.1-next.66":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.7.1-next.66","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"0.2.13","@sphereon/pex":"1.1.3","@sphereon/ssi-sdk-core":"^0.7.1-next.66+b4151a9","@veramo/core":"3.1.2-next.84","@veramo/utils":"3.1.2-next.84","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.4.0","@veramo/cli":"3.1.2-next.84","@veramo/did-provider-key":"3.1.2-next.84","@veramo/did-resolver":"3.1.2-next.84","did-resolver":"^3.2.2","nock":"^13.2.1","typescript":"^4.5.2"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"b4151a9cde3e5e5dcabb32367e7a6b6ab99cb6cd","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authentication request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst createAuthenticationResponse = await agent.getSiopAuthenticationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authentication request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationRequestDetailsResponse = await agent.getSiopAuthenticationRequestDetails({\n  sessionId,\n  verifiedAuthenticationRequest: createAuthenticationResponse,\n  verifiableCredentials: [credential],\n})\n```\n\n### Verify authentication request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthenticationResponse = await agent.verifySiopAuthenticationRequestURI({\n  sessionId,\n  requestURI: createAuthenticationResponse,\n})\n```\n\n### Send authentication response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationResponse = await agent.sendSiopAuthenticationResponse({\n  sessionId,\n  verifiedAuthenticationRequest: verifiedAuthenticationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.7.1-next.66","_nodeVersion":"14.20.0","_npmVersion":"lerna/4.0.0/node@v14.20.0+x64 (linux)","dist":{"integrity":"sha512-TYNKMtXdJqOSMY7Ofqt2wo3N9y7FFn+H5sX+aeBpeTnIce2gssP3oXq7sOPPQdxQx79l7x0Hg/ZzbSi25byHmQ==","shasum":"2e50c957dfd7dcf8a220aa8d03056bdbf866c284","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.7.1-next.66.tgz","fileCount":24,"unpackedSize":102112,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEG1RDJ+Qd+gEHO2vBSAYpv6TQhO3YYWI3IJ1IuO2QKlAiBPVfD5X2dknbn6mHvFvPcGUFsYHggPCktGT8n+vBpqIg=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjEoXYACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmrdqg//d/VpmN7Zp4REX/sHMGjtPLLSb1AO/tvgGrUMAQO8QZOfNIUq\r\n/CN4dkIAJUAQ7gKvUwpfDEvoIyqXG2mqKQ4n+dKFfxdqpJNf61YQqIpqCCfv\r\nCH32ge3AW3n+Sw2jgaXvU5SpsRMyjdZqOeRr9z8e52Y80ai+bjWTOP76kFbA\r\nlUdyF5M5n2A9Kb8SDoaNFFQRHcydz4dDnfYoWRVqIxU1jxIY+Oh/tAP9s4Md\r\nOmXvNk2O4vkWxuxl0xynfZ5B+fvGjCp7IW2aNvffgnBJP9K/VXLske0qBs0T\r\nqDKhk4a6Ui2itGEaLrRrlce40aXmbpgqHQ7qULicHqPBPj2zCFO7lhDzgHFZ\r\nMh5EIG6ZeQQXngQZmNdPNeu6OEyAoFj868U3teyvABjwPBZDMN1DTb30r6Dm\r\niLiw6PJWPt0ayJcMwOutCa8GxFEWn97+8PSlZuUvg0Qs5Qv6X8a3TSCZuQlR\r\nffC5b08OBfBEyNRf7aungAnIDhJbeKy1CYLwnYz/ZTKBQirkbrGgPCkkacMP\r\nIHBCriGD6JZcMF6toio3WmHtQcTjmNS0OJ+RzVqXkeEZkEvo4CpvMljY/pai\r\n0aUupgT9Z1WpBZ2VxrfqQjbwbAP8x9V5udMKkxBrQPLbrhLKgGS6C4SHiIdo\r\ne+ITQXWoyqp7zMXPWiJilGi0NzcAXmTGQ7A=\r\n=iKed\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.7.1-next.66_1662158296473_0.29630370896958413"},"_hasShrinkwrap":false},"0.7.1-next.68":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.7.1-next.68","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"0.2.13","@sphereon/pex":"1.1.3","@sphereon/ssi-sdk-core":"^0.7.1-next.68+00c9747","@veramo/core":"3.1.2-next.84","@veramo/utils":"3.1.2-next.84","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.4.0","@veramo/cli":"3.1.2-next.84","@veramo/did-provider-key":"3.1.2-next.84","@veramo/did-resolver":"3.1.2-next.84","did-resolver":"^3.2.2","nock":"^13.2.1","typescript":"^4.5.2"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"00c9747efd89f125fc77330af0fc6ca6accdab74","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authentication request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst createAuthenticationResponse = await agent.getSiopAuthenticationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authentication request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationRequestDetailsResponse = await agent.getSiopAuthenticationRequestDetails({\n  sessionId,\n  verifiedAuthenticationRequest: createAuthenticationResponse,\n  verifiableCredentials: [credential],\n})\n```\n\n### Verify authentication request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthenticationResponse = await agent.verifySiopAuthenticationRequestURI({\n  sessionId,\n  requestURI: createAuthenticationResponse,\n})\n```\n\n### Send authentication response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationResponse = await agent.sendSiopAuthenticationResponse({\n  sessionId,\n  verifiedAuthenticationRequest: verifiedAuthenticationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.7.1-next.68","_nodeVersion":"14.20.0","_npmVersion":"lerna/4.0.0/node@v14.20.0+x64 (linux)","dist":{"integrity":"sha512-51MgkuDQnEv/dSEmyiU+y/lUZExrY9EQVfFjszVg36/F8IQOrEm6ttMvXq5vjyt3CQBaR+wSlc5ftZYGGiGEXA==","shasum":"fcb48f3628e7cd6e04f577418c1865d13472e8d8","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.7.1-next.68.tgz","fileCount":24,"unpackedSize":102112,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC/Y8NtJW1UaURo8fmrNcylRZukpCkiuU9sg4seAZ+P3QIgJ8k2taW5um4kyjJTIh79pCeW3l0tjvIip8e+R6hpZZc="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjEpdbACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpbNw/9FceqPymUrl1eWfPrBncreqiYMuZ53uZPmIkhbU2s7EFnManK\r\nvy/miHjQZfiq84IRDpPM/saOqLPltbhQrdTtXo/0NmT5L5D2UPGYaNG95dQK\r\neKYEN2EkjUKBBSpqawDKBQo2+tBK+zQRTO2+5rvEeMfJffxkf3ihrP8j9iFU\r\n+4QLjybhleNjtNaFtPutCCvBBQKY5VgvyZnarMy2gnoMS4DbeprmXWyt1Cid\r\nHIBXxPFSasDrUMO0DyrauEI1+c40ggvIYMhHXoK69SQaaife4nsTEkJytzqq\r\nxWQktCXYawb7BeU80Va+1h1wfqBm0ixJ7md7I8q6Rh3snwwxJlXWJOAdCqdx\r\nfEmWZ/XX/tlLAKsNVP6GAqNa+HAkR2J5UpATgt7Xc8RXOO2UmSQCW3Jdwzrr\r\n99XS8Ronj/ZLV9krdM8V7z/nkPTmN4IhzJJUUd4CNKg4CL/HGCiKzNUCjjJ3\r\nG9jx8qi028mtgnsft95bAbueC8oAqiZnYdlgaj7pLrNK4p0XTrG5vAmd/z+J\r\ny/mCNI6LIfiCKJshfw3tEsYo3H2VNKpa+M0cj/P0vKzmkNl6S5g6hoQ/GeMw\r\n8NuIUkUk55WHusR2rM4hKNTLNAP7waXdXCThEDLxGtccMLG0jC7qST3C8nBc\r\n+q6WGq+XXQaOIsmdwDimXKdnGX4V5Ii9BeA=\r\n=AzFA\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.7.1-next.68_1662162779242_0.8623872797108498"},"_hasShrinkwrap":false},"0.8.0":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.8.0","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"0.2.13","@sphereon/pex":"1.1.3","@sphereon/ssi-sdk-core":"^0.8.0","@veramo/core":"3.1.2-next.84","@veramo/utils":"3.1.2-next.84","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.4.0","@veramo/cli":"3.1.2-next.84","@veramo/did-provider-key":"3.1.2-next.84","@veramo/did-resolver":"3.1.2-next.84","did-resolver":"^3.2.2","nock":"^13.2.1","typescript":"^4.5.2"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"1032feb5588568edfbca0110f3ff9e6c38894135","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.8.0","_nodeVersion":"14.20.0","_npmVersion":"lerna/4.0.0/node@v14.20.0+x64 (linux)","dist":{"integrity":"sha512-Xm20KV3PO9VqktaTIcLgtDjzulxKnP1p4dkWoi3bmPjQFwoS6Xn81RgZWXdhJjIHJjjL8ydExjSswiAGgpa1RQ==","shasum":"b35436e27045c2fcc2fd5eb9a408771b3a0fb053","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.8.0.tgz","fileCount":24,"unpackedSize":102080,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDC7zdSHEPX7y+ubM6tn1PUHezt4Aky7M9ObrDwUaXR2QIgUP72mL/Jjcf0XUrcbNjTKwHdSO3B66MKbTVqccS4lK4="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjEpstACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpZFRAAmffHR6c/ofy8FsTJhRj5z1JLQxDysEge9EbzVr0Kk5ckOmhJ\r\nAKF2jrTw3SbDpkXOyn1mv+JxPSgLW3zVWGG4Q9ufEvjUM6JEHFY1SwM9IFSm\r\nt1PQk4B0+t89yBukWvFnLo0femQpRRGw9fmOOO/0aDNIAIEZwx0vqELeHJ1v\r\nYgG2p9+kkPqtcFVvUhIvv7EExbW8BF39Oza9cWRvwuNGwUtLIAwO6UR06MxZ\r\nXACxDn0+AuFyt0dOStIqgJhW4FGQYoyj6nNhEbxWPreBia9bie/BfnY8iTJ7\r\nvJLh4R1RZwfhhYvbPrVCPQ2/1YaDBCU0HVHBzR+/sB3TWkPTBRydNCXq4ck8\r\nf1FwzOZ58nEDTXvfCvqfGrgJp3HYNw79DwLL3rMB6j4/RuDP/eg4CGm0yQhu\r\nV7YIsCPm9EprgoY+24guJ5y6NFLwskwdjEbHZye2rrR4KGPk9HhsgMMxRYk9\r\niHHTJTG/pCMBxADorfKlzCQPdbBFSPQqeXpQp5WYP8PLjr9jR11fpPQJSwjW\r\nNPSa+JxmspnAyCQZR7AeujFQXW4M5mRxSc/1jujlcfRaLB8vb5I6XbNIlBYK\r\ndx+7eBiABXapxgXc14ZL1KvFGtSYIsQjAeCP0sdNZk7grEFTmZxpGODWlZ7h\r\nlcJURdKNTQbJ0khz2dzj1aysZDS57cCDMds=\r\n=woSM\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.8.0_1662163757150_0.7792070605380079"},"_hasShrinkwrap":false},"0.8.1-next.2":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.8.1-next.2","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"0.2.13","@sphereon/pex":"1.1.3","@sphereon/ssi-sdk-core":"^0.8.1-next.2+0b28de3","@sphereon/ssi-types":"^0.8.1-next.2+0b28de3","@veramo/core":"3.1.2-next.84","@veramo/utils":"3.1.2-next.84","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.4.0","@veramo/cli":"3.1.2-next.84","@veramo/did-provider-key":"3.1.2-next.84","@veramo/did-resolver":"3.1.2-next.84","did-resolver":"^3.2.2","nock":"^13.2.1","typescript":"^4.5.2"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"0b28de3de21afd0a224d3d174103e072162231ed","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authentication request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst createAuthenticationResponse = await agent.getSiopAuthenticationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authentication request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationRequestDetailsResponse = await agent.getSiopAuthenticationRequestDetails({\n  sessionId,\n  verifiedAuthenticationRequest: createAuthenticationResponse,\n  verifiableCredentials: [credential],\n})\n```\n\n### Verify authentication request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthenticationResponse = await agent.verifySiopAuthenticationRequestURI({\n  sessionId,\n  requestURI: createAuthenticationResponse,\n})\n```\n\n### Send authentication response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationResponse = await agent.sendSiopAuthenticationResponse({\n  sessionId,\n  verifiedAuthenticationRequest: verifiedAuthenticationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.8.1-next.2","_nodeVersion":"14.20.0","_npmVersion":"lerna/4.0.0/node@v14.20.0+x64 (linux)","dist":{"integrity":"sha512-xmHcHpY60sgPI4DsTOUM0iz+jvUL+9lEIk+UCxD/AuWFzUSVQGrFFU9SsvgA8yH73B0vg8ug0tzlgbTO/CsAtA==","shasum":"a136fe962a04eed47dfc875e116174b06e040def","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.8.1-next.2.tgz","fileCount":24,"unpackedSize":102141,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCtJDrtwgw8HHKF0AXxpC6ttVpaClXG9MFLkaJVcI+sLQIhALY89Qsy5jlCVZCSsVMaqgpvMG19bWz+pQZgIzng77Fj"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjEqZYACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq3ZA/+Psgr9a4TFcJ6nZQpkvW2NDKSYjjbJXLnLWsv3WKu5sQbmw5V\r\nTHeREU2rq/iTU8Q9UcJiSw7azHiEBY81+ZlwTafoH7nKPylY3xUjGmbPbaOV\r\nFgl849Kkd0Ngf/mH/YYpJn5Lsw389Fj6OroMmrKQbhkd072pstzWT1i0FbgP\r\nG1L2apVFKONAuyycpJYaiSi5PNZmsl4bZmWtFfKvz97ml6lfI1ltL+R223/e\r\nnURuSsNJiIPb39U6xS11QWAFgXOU7+3gzs6y6pULI20C3kCjSgiQlSBX/oHF\r\nOCdOgTSrq4IeaK0RMEGnmZAFpGdG7fd5cH0qF9WYvLcHIyEG0KAD4qvU5ewl\r\nRf8pljBP4dfQtzKBnbG6d5G4ou1on0B5x3s/2eviY4cRBdx0KnF9qBMlwt85\r\nOjSiabbHXFFp6ibZQIcslyx9LgWL6/larpXvjVdDNlESbxZwglPE8WiQJj44\r\nVXKpgBMyVgWiMVL1aHHcxNkSCM7adYMjQBuJsqLYWCVl/kD6gAsssg8pWJ+6\r\n3RtlC/qyYxfuFU8/lxrZggy8fiAIz5ZljmGVBUO39RsRk35sQADCp+mioTOo\r\n3j7VxtMiWJMGlZ6JN/nfD8wagoRn/kM8QLFnWBRjv8BuhhJFastlBVgmzWwk\r\npM4T37f9KWlcr+4B/VKG1X4ej++6OJ97NOk=\r\n=Btad\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.8.1-next.2_1662166616686_0.03191018629594122"},"_hasShrinkwrap":false},"0.8.1-next.3":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.8.1-next.3","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"0.2.13","@sphereon/pex":"1.1.3","@sphereon/ssi-sdk-core":"^0.8.1-next.3+0c75aaa","@sphereon/ssi-types":"^0.8.1-next.3+0c75aaa","@veramo/core":"3.1.2-next.84","@veramo/utils":"3.1.2-next.84","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.4.0","@veramo/cli":"3.1.2-next.84","@veramo/did-provider-key":"3.1.2-next.84","@veramo/did-resolver":"3.1.2-next.84","did-resolver":"^3.2.2","nock":"^13.2.1","typescript":"^4.5.2"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"0c75aaa73635bb037c226183071e10a184dfe549","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authentication request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst createAuthenticationResponse = await agent.getSiopAuthenticationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authentication request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationRequestDetailsResponse = await agent.getSiopAuthenticationRequestDetails({\n  sessionId,\n  verifiedAuthenticationRequest: createAuthenticationResponse,\n  verifiableCredentials: [credential],\n})\n```\n\n### Verify authentication request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthenticationResponse = await agent.verifySiopAuthenticationRequestURI({\n  sessionId,\n  requestURI: createAuthenticationResponse,\n})\n```\n\n### Send authentication response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationResponse = await agent.sendSiopAuthenticationResponse({\n  sessionId,\n  verifiedAuthenticationRequest: verifiedAuthenticationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.8.1-next.3","_nodeVersion":"14.20.0","_npmVersion":"lerna/4.0.0/node@v14.20.0+x64 (linux)","dist":{"integrity":"sha512-eOr2HIZbtwm+v6DXx1xjj7w3cQc31nIcgFzta25cASYwXOkUMzbQBcLDtijYWK4RucPWe8ov8DbGtpWiGhAc1g==","shasum":"23d295ac3db9cefeaa8dff8231bffef9d27bbf01","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.8.1-next.3.tgz","fileCount":24,"unpackedSize":102141,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAtKozSolEvGP2dzshcCueLCPlLMiVxFIBriYWIkhJQiAiEAmpCU+zQbmb1yagu3hmGSpfIK2cCrLFMZ0ztWLBiveO4="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjEqlfACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmrcqg//edDzytN70Lv0PWCDqLiZN8QeV7MkNj3RxbbaMHKz1pzq1SOu\r\n+jgNBmsQ9695J1WJ/Y9Ntm9E/ANuMv4FG05giyAXRFKLSRQuTY2IsOklxxPA\r\nUVnk0lTHH5YYTcmk6EJaJLIZbj/nYGyYJJDA26gqBuYWT9rjyehnmJuoPFO/\r\nyzI8ZANIbOEdpHXF5GTavatzDQeFweaww8Ihz6n3PxDARo0kyyRE6evKxcqR\r\nJVQ8cCZyyC6RApWI43rb25uQQE7i2yvvVUK+vr7VCnr8SP1Tog0Z+mAcFkEH\r\nTd+ymI5RsjNB3Wx1Fou6hb6fL83dFuzgRYp0VYL58RqErygtS7HRcarKwbn6\r\nrhBuNX63nxJ4pZTMbbVExViZZxSVrMx/JBX40uqQFn5r/12+8Cby+B4HcUK9\r\nlylLdVCj1sR7xpthHIQ71xnMeRsIggBKamsqKivD5Ru8lSpSJM6vySaX2NZX\r\nntt8cenjFy3hv0bLpHhqH77pcjsHiIF2l97dol3slFnQuMg8anfXdwA4vFgi\r\neDLmowI2yGNzuYWuL1ABn8Wga92NTku0LpFerogh4ZxWlbLy3RxNjcdU6r5g\r\n8SA78C7GrO+oOQ7fbLxOO6hz6c+noiirxuMMXH3sukrBTGvObkVGzb9B59PW\r\nrmtky95/oTc+1pO/tvUhwLywhVVsSfnGchE=\r\n=h75W\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.8.1-next.3_1662167391561_0.14288213476101896"},"_hasShrinkwrap":false},"0.8.1-unstable.4":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.8.1-unstable.4","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"0.2.13","@sphereon/pex":"1.1.3","@sphereon/ssi-sdk-core":"^0.8.1-unstable.4+e8c9e78","@sphereon/ssi-types":"^0.8.1-unstable.4+e8c9e78","@veramo/core":"3.1.2-next.84","@veramo/utils":"3.1.2-next.84","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.4.0","@veramo/cli":"3.1.2-next.84","@veramo/did-provider-key":"3.1.2-next.84","@veramo/did-resolver":"3.1.2-next.84","did-resolver":"^3.2.2","nock":"^13.2.1","typescript":"^4.5.2"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"e8c9e783b4a8b61a176213a8e465cf18db2f63d6","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authentication request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst createAuthenticationResponse = await agent.getSiopAuthenticationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authentication request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationRequestDetailsResponse = await agent.getSiopAuthenticationRequestDetails({\n  sessionId,\n  verifiedAuthenticationRequest: createAuthenticationResponse,\n  verifiableCredentials: [credential],\n})\n```\n\n### Verify authentication request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthenticationResponse = await agent.verifySiopAuthenticationRequestURI({\n  sessionId,\n  requestURI: createAuthenticationResponse,\n})\n```\n\n### Send authentication response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationResponse = await agent.sendSiopAuthenticationResponse({\n  sessionId,\n  verifiedAuthenticationRequest: verifiedAuthenticationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.8.1-unstable.4","_nodeVersion":"14.20.0","_npmVersion":"lerna/4.0.0/node@v14.20.0+x64 (linux)","dist":{"integrity":"sha512-etPMzMijOzeCGB7eSxcqkJlP584NuT5fQJ5o9pD20u93XIuWWb2h6iBZKmfroVn774qpqNFgcPbqkiuBJLPI3A==","shasum":"9837e20b867102c01339b74f4ceb308f803186b2","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.8.1-unstable.4.tgz","fileCount":24,"unpackedSize":102153,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCOI8xHyID5TtDg3vhrSYsb5AORCMxW0CiKH7Ubyrb3XQIgO4n/Q3jVA/EtHrqc9LrnReCWUCot8rRCuVj3osLtWbQ="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjIum3ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmozdBAAmP0bDzP+Ktv1mPZ0SNHoKVumaUY0dm9SEYDeU1NYx19yrXHb\r\nt74kSPKy+oDrp3LRgTEOtzlgYu04ES7TIDtPrezPO6vu9Ek0OE8mH4SCcF7L\r\nBmweox0xM8ctpIQ88RTimBixeD4nc312UzaX09UupuzZOD8/HMfhZtgMrptp\r\nmTcp4MsOlEcGlrqrMASx1BRTJHQJTTaV4VLuTEhMD0+nuF5DHQaehBDm30Nh\r\nRXOWhXRT7BPP8LHYQ74dPxVP99JW9ImZkWSCURifFLn/DFPWEiGi93BbdV1d\r\nkdvnA6N0CDry+vz5E59vDuySXizDWeNMqk9lOqN7keroKnYIAOCitGq8DY68\r\n1WZfkQQhkHdCO5wJliHaAiNWZM2MkOie5B7pmp6fsQVgwbYr3puFthgJDRF/\r\ngPRf6Irg53DZ7hxjAwGibEWBQm+AHkDp7ED00/FYR5UGhO5hDiQe0bzcQOby\r\nKNOtXD3N8I7RoF+wUwJwujPAPT8V5PUr5wCU8C4viSzqHmQ44B/Fd9NaQfIT\r\nO8mZu0uJdAdzs584NzDkwg0eTHj99j+9orsicyCxqrlD24AnLl8uSExilObF\r\n4mJ7QdDfaei4TNExumLKdobnTkAS7Aew6sFdHkKHuzvA8VxDsmDJviWc5WjU\r\nvKeQCn6nFZ/KZ3hlYwb4CGqBgUCKDMpF344=\r\n=WN5w\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.8.1-unstable.4_1663232439365_0.8211697166817411"},"_hasShrinkwrap":false},"0.8.1-unstable.5":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.8.1-unstable.5","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"0.2.13","@sphereon/pex":"1.1.3","@sphereon/ssi-sdk-core":"^0.8.1-unstable.5+ed329f6","@sphereon/ssi-types":"^0.8.1-unstable.5+ed329f6","@veramo/core":"3.1.2-next.84","@veramo/utils":"3.1.2-next.84","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.4.0","@veramo/cli":"3.1.2-next.84","@veramo/did-provider-key":"3.1.2-next.84","@veramo/did-resolver":"3.1.2-next.84","did-resolver":"^3.2.2","nock":"^13.2.1","typescript":"^4.5.2"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"ed329f67a9fa92473dbbb1e42b23e7a7452f8686","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authentication request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst createAuthenticationResponse = await agent.getSiopAuthenticationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authentication request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationRequestDetailsResponse = await agent.getSiopAuthenticationRequestDetails({\n  sessionId,\n  verifiedAuthenticationRequest: createAuthenticationResponse,\n  verifiableCredentials: [credential],\n})\n```\n\n### Verify authentication request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthenticationResponse = await agent.verifySiopAuthenticationRequestURI({\n  sessionId,\n  requestURI: createAuthenticationResponse,\n})\n```\n\n### Send authentication response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationResponse = await agent.sendSiopAuthenticationResponse({\n  sessionId,\n  verifiedAuthenticationRequest: verifiedAuthenticationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.8.1-unstable.5","_nodeVersion":"14.20.0","_npmVersion":"lerna/4.0.0/node@v14.20.0+x64 (linux)","dist":{"integrity":"sha512-Lu+qPPy9pz9I0SFgaTUnhXopriQFMZLgzKwyzvTtL/e4yJ3YycZ5lpBMaQI65rmPljYweSQ9VsmWHbP6JPWjiQ==","shasum":"fa26a92179cee6e535b57215e219242a5d1158e2","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.8.1-unstable.5.tgz","fileCount":24,"unpackedSize":102153,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIG5vrKi004AhF+EHYjaHskQcbxQf73G+UtprwJtt8b9BAiAQbnboS2to7m13ywJq0Y2Q6qph6HXUtT1tDKrY6EHwDg=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjIu2uACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo0/w//dY4+VjpF1aF6aeCrlHxrShdvsZyFmDlUEMRbUsnhsFGisUUW\r\nR1Ksyo2Wfn+FnHmdxiG+PYGo6c4Eq33KM05wmLDoXUft4HHlHxTVnkhAOobp\r\nBWv0IXFspB/23wE1Zz9PScorAc875QM402fu8OwMxDlPsiaOyVwlHoDLIZeH\r\nRSqr53R78cGkVXfm+SN6nzR/83U2E9uY71zGNyb1WUcQO32ZP+G1RldXEIy9\r\nkUMtTLWWraEW6AH8ICO3v9aC8e13580UwMin4kUNzbFIjfdYljSavrlmsNNG\r\nl5ZnKQAALY6soL6wyt+kCJqpXwoah4isbCas72TCPiUsTIHW15nsG+2fNz63\r\nd875sXHCEXvio4C6KuSdq6Y8AlduHTD/toVffzt3+sk57E67jZhoD0HUAS2k\r\nZPlnNjYRSpUAWqLQV9Cl1Mrudwms9EpOJeDasJEuzMlvzmZmwDh6+ZJAXLFc\r\n9ZrmkG2/MvugiqqTzpGpjzZJVCzzT8ckLB4vZ1JN06b8DPBJrQJv+eQCuoUI\r\n5EVq6U/IgmTK1B+4ypra12roEoqo015Xjo9UyvRz9EvkQUgtY8Wyb4pNqy5W\r\nh0mBeTyAzXGmh9uNQsDY5IQJVFVV34LYMv9i4AkDor3QFfeXvCVVaNw9VfZr\r\nLEJY6PaWil8LYsqBAKUHj2CBLWaKmabJJ/o=\r\n=W32+\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.8.1-unstable.5_1663233454238_0.42048083343964104"},"_hasShrinkwrap":false},"0.8.1-next.6":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.8.1-next.6","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"0.2.13","@sphereon/pex":"1.1.3","@sphereon/ssi-sdk-core":"^0.8.1-next.6+27069f8","@sphereon/ssi-types":"^0.8.1-next.6+27069f8","@veramo/core":"3.1.2-next.84","@veramo/utils":"3.1.2-next.84","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.4.0","@veramo/cli":"3.1.2-next.84","@veramo/did-provider-key":"3.1.2-next.84","@veramo/did-resolver":"3.1.2-next.84","did-resolver":"^3.2.2","nock":"^13.2.1","typescript":"^4.5.2"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"27069f85062685aa678ccb7846cefb84b253990f","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authentication request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst createAuthenticationResponse = await agent.getSiopAuthenticationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authentication request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationRequestDetailsResponse = await agent.getSiopAuthenticationRequestDetails({\n  sessionId,\n  verifiedAuthenticationRequest: createAuthenticationResponse,\n  verifiableCredentials: [credential],\n})\n```\n\n### Verify authentication request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthenticationResponse = await agent.verifySiopAuthenticationRequestURI({\n  sessionId,\n  requestURI: createAuthenticationResponse,\n})\n```\n\n### Send authentication response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationResponse = await agent.sendSiopAuthenticationResponse({\n  sessionId,\n  verifiedAuthenticationRequest: verifiedAuthenticationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.8.1-next.6","_nodeVersion":"14.20.0","_npmVersion":"lerna/4.0.0/node@v14.20.0+x64 (linux)","dist":{"integrity":"sha512-WBqpQuihGV0paMOrFnjnfTS0ByII0l04sCmquw5kVpgsyqX4F1onrwRyr9zQ7fw+zulw6UPKc013i/nf4HPSiA==","shasum":"315550c85342b53fbbf2f6f1a81f5446fe2710d7","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.8.1-next.6.tgz","fileCount":24,"unpackedSize":102141,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFRGd6Mw0NPP/kejpx9jkaXGJhOMZ1ohdnrPp3qC0sO1AiEA2QK5ckWZWu1gvGab1GSjbBosphOo65nOcrGOJqDH4y8="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjIvERACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoLKg/+LXHtJsrw8K56buE3BHrLrixQmAUEE+inkXuU9XAu6TSMANhg\r\n5XdVAO348xaxjHYjagQwxLgk+mMeFyMg7IZ5YxJODDXD9/tDH9FFrkCjIvIx\r\n6s4i6gBcipk6g0bPDGY3/WZjSqaYXX4E/oJPNYUG+91kdMIeS0wU5by/Dseh\r\nEYwnazLfN02wyf3CVqjDPGVWYL7ckPHdIhWgXpZzXtFsiIXm/ICrMAAouD9u\r\n0AaKatNBHb/+aZW5s1SajF1OJa27QM4LtNPVEh6jZzIn3cwysTEpnwLwtjyp\r\nYv+ijrFZq+5tw5T50jy8/do4dIrqADPzayWPEVIda3YbAtc48ZwMdcrZ8Pe5\r\ntxPSJV0Y9CWqS1MT9xPFWtrhgFdPr3S7OJ9je6XsfLQD4AnSF4G0vVfnV51U\r\nBU60V60OujCB9hW0yGT7YGwi5DkvaAPuo5AN8gZ/x4A/CH5BxCQGk9eQugj9\r\nfV0JTqGhL6AfYaXgpIC/ZJDyBmdHaG9EqvZXrDH8tf0R4PXJk0KzEjXABPtn\r\nhMoP8AjjUKXpuWmZR1GpNH/XVujWVLrzUyxi6YE2YCNArZDxp8nktmbkGpLd\r\nf1qQ5YdUMcJ0htfvhk9bgefyKacnX2c/Et3LyVp33XOWO9qrpX8ZCd4ncr6R\r\nD0vcBXRmJuqpDwqrjyygRERgzbMTEakWiuY=\r\n=IADv\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.8.1-next.6_1663234320962_0.13543629906022026"},"_hasShrinkwrap":false},"0.8.1-unstable.9":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.8.1-unstable.9","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"0.2.13","@sphereon/pex":"1.1.3","@sphereon/ssi-sdk-core":"^0.8.1-unstable.9+af7f532","@sphereon/ssi-types":"^0.8.1-unstable.9+af7f532","@veramo/core":"3.1.2-next.84","@veramo/utils":"3.1.2-next.84","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.4.0","@veramo/cli":"3.1.2-next.84","@veramo/did-provider-key":"3.1.2-next.84","@veramo/did-resolver":"3.1.2-next.84","did-resolver":"^3.2.2","nock":"^13.2.1","typescript":"^4.5.2"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"af7f5324bc1718f724e3258c3f218eb85e4199cd","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authentication request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst createAuthenticationResponse = await agent.getSiopAuthenticationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authentication request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationRequestDetailsResponse = await agent.getSiopAuthenticationRequestDetails({\n  sessionId,\n  verifiedAuthenticationRequest: createAuthenticationResponse,\n  verifiableCredentials: [credential],\n})\n```\n\n### Verify authentication request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthenticationResponse = await agent.verifySiopAuthenticationRequestURI({\n  sessionId,\n  requestURI: createAuthenticationResponse,\n})\n```\n\n### Send authentication response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationResponse = await agent.sendSiopAuthenticationResponse({\n  sessionId,\n  verifiedAuthenticationRequest: verifiedAuthenticationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.8.1-unstable.9","_nodeVersion":"14.20.0","_npmVersion":"lerna/4.0.0/node@v14.20.0+x64 (linux)","dist":{"integrity":"sha512-d71peov8p9ikvEJ1YtvW+BzgFRRlcEnx5Xg3LoBcU2JlhdO7E2EklaU5z6LRvwkBYXfkOK2546Lkeg9JHdNs4Q==","shasum":"9175f3562bd4fb9256c70a09c2c9a06b40f28e62","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.8.1-unstable.9.tgz","fileCount":24,"unpackedSize":102153,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIE2Qdp5TFDudCg4GL2EzacwD8+DWBw4uTXcSAgwhNWD7AiBDhnWBlCWkefOEzT38oD62OQB2pmH9TjmcEqrjM7R++w=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjJl7RACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqXmA/+KcOH/VkQPpw0GmoDHj7gVf5Xz+yxJGoTIdjTSi6MaBV1/WcW\r\nFWeb0XLMGIAnHPb7GZryumaUeKguTmrPifw4KsW8lKpDxpTD9FcGtahH2nHj\r\nJGwNZwZJLpWcA2X+iB3Yd3MHWCKOvdWWKNLFMwoCQYWD4jNV9zB5r21/wZUg\r\nErGiAq30pyujZwSfJGPd4kJ58klf+PMM62fLp3pAQ20/Oo3Kbq04WXrO5Sng\r\nKQ4KRciakrUeIGFNtUlUyM1xV6CpkfH3gdTu7UlREfG2GVyE32C3cOcKcl9g\r\nwlBOVvtyLIIuIDrSfu7Sc9TYh0czL/LJM6+hX6+IqZ0uGrsMrNYdOW+DvHLj\r\nieOQwxEZukOzQKW8Y3NB6Pq7Z7KTUj/GHqtrY14vHW5Wy1A/vNUPEw9S4FF+\r\n27ZfiYHwmVsUFQ6eGtYwKFNvtnvL0o/tDDogZw7bOT3bEXrbsk/v1n7HYupa\r\nM1/yye6rx76jX6ESf95xYvPG4cGNMjRFrKJatNZUE4vGc8cP8jH2P/yqOIBr\r\nk0MlQHHtYhuPlBVv6ATVf2LZkuqTVCYhX6eR34xYNfJJN+EKt5SUW7j7uFsm\r\nH8EkOiQrcSHgRLsRZVZoKE82X501Y1fc5qBVEzByIxIQDhpz0HHlPf6unvpC\r\nt+mBAm6B6pOO5LkGu5PtO/X+Cw9EyNksay8=\r\n=H5GI\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.8.1-unstable.9_1663459025163_0.3831351473827489"},"_hasShrinkwrap":false},"0.8.1-unstable.11":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.8.1-unstable.11","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"0.2.13","@sphereon/pex":"1.1.3","@sphereon/ssi-sdk-core":"^0.8.1-unstable.11+e5fd396","@sphereon/ssi-types":"^0.8.1-unstable.11+e5fd396","@veramo/core":"3.1.2-next.84","@veramo/utils":"3.1.2-next.84","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.4.0","@veramo/cli":"3.1.2-next.84","@veramo/did-provider-key":"3.1.2-next.84","@veramo/did-resolver":"3.1.2-next.84","did-resolver":"^3.2.2","nock":"^13.2.1","typescript":"^4.5.2"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"e5fd396f0430a594fd72f590136d281355f61408","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authentication request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst createAuthenticationResponse = await agent.getSiopAuthenticationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authentication request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationRequestDetailsResponse = await agent.getSiopAuthenticationRequestDetails({\n  sessionId,\n  verifiedAuthenticationRequest: createAuthenticationResponse,\n  verifiableCredentials: [credential],\n})\n```\n\n### Verify authentication request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthenticationResponse = await agent.verifySiopAuthenticationRequestURI({\n  sessionId,\n  requestURI: createAuthenticationResponse,\n})\n```\n\n### Send authentication response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationResponse = await agent.sendSiopAuthenticationResponse({\n  sessionId,\n  verifiedAuthenticationRequest: verifiedAuthenticationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.8.1-unstable.11","_nodeVersion":"14.20.0","_npmVersion":"lerna/4.0.0/node@v14.20.0+x64 (linux)","dist":{"integrity":"sha512-2pZwTAmLl1mEil+Xs4Yp2jyJoF/QKoIlKnsdqn70RTp6Navn5VbYaWqEDAwmwM4OmY7SdZLZoMvt2UVrom/CLw==","shasum":"881c771bd0c8d2b1ca178a094c6af9e826e6befe","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.8.1-unstable.11.tgz","fileCount":24,"unpackedSize":102156,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDTpYkqCQT9ZodAtmJeGF50fEEgqyWODw38M9EGcWSG2AIgGWaznmflVjwIFtE8752LSOgo+mb1MuNwEJfenMy8apk="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjKHZlACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqkEA/9FtRYph/z/NNoELa92mQ/xLCbShOSDupI9+Pkf+Z7LG0az80e\r\ng+tctbe9ptsmtCf2W2kCKi8QxSolgWt7zR2EvRXjoPEWFHx+vdzHHuZ+aG+4\r\naUea8vmFkA3AuyePABhMru56nLtTyirM3GKMdBDTmDgAQw+UvmBhYP7I9Tz+\r\nyaZGzjJBkIme2XAWJfAqE4EB/aY7B1u5z6g0M9pNPF77ij+TWlZSEqh6UbKb\r\n0B6IgPSU6lgLAgvwoNjL7+lrZEn1zichpEt8yPUuh7Ve/T+36nSvms+I5Lwx\r\n1XEmFX+m00/0z+AE4w8FCd//BNPYyDGCoFlxQXfFiFpRngq9EWy6/czBv7RC\r\nxnR8kje4/VzyPmrRW2ZxCahctDrA3KJaKHmzp9YWQ+yuf5ouCHVEESK4UABG\r\nou7O8jRPSUdd4sltuLoiZ2MJw8Bhsl6rbPpTBPbgVzySXV9avftmJ4Cr9v3L\r\ncvMF1CSTynGOmzs5ffUUaFS+yiFZkttDsAdysvMU7a4lOHcKkjhs7++1+2QN\r\nviRxelOHBr9+sxOFUdkUM4StKKgqTeGK2mb51GPmyd1cvLbM/0oMauxis70X\r\n8V7CNBrvbG8G4lkvq4fWIexT+TN2UulWP7/rAUbEwzZCAtEsXGiSF7EJ1mm0\r\n/dpXI6bNaMstg7Lbm0OnlBB8j1IGPOqGh6k=\r\n=FAqw\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.8.1-unstable.11_1663596133195_0.7863332375171921"},"_hasShrinkwrap":false},"0.8.1-next.12":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.8.1-next.12","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"0.2.13","@sphereon/pex":"1.1.3","@sphereon/ssi-sdk-core":"^0.8.1-next.12+84fb570","@sphereon/ssi-types":"^0.8.1-next.12+84fb570","@veramo/core":"3.1.2-next.84","@veramo/utils":"3.1.2-next.84","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.4.0","@veramo/cli":"3.1.2-next.84","@veramo/did-provider-key":"3.1.2-next.84","@veramo/did-resolver":"3.1.2-next.84","did-resolver":"^3.2.2","nock":"^13.2.1","typescript":"^4.5.2"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"84fb570f29ecd7a4fbd6477fd22284f47e814ab8","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authentication request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst createAuthenticationResponse = await agent.getSiopAuthenticationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authentication request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationRequestDetailsResponse = await agent.getSiopAuthenticationRequestDetails({\n  sessionId,\n  verifiedAuthenticationRequest: createAuthenticationResponse,\n  verifiableCredentials: [credential],\n})\n```\n\n### Verify authentication request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthenticationResponse = await agent.verifySiopAuthenticationRequestURI({\n  sessionId,\n  requestURI: createAuthenticationResponse,\n})\n```\n\n### Send authentication response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationResponse = await agent.sendSiopAuthenticationResponse({\n  sessionId,\n  verifiedAuthenticationRequest: verifiedAuthenticationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.8.1-next.12","_nodeVersion":"14.20.0","_npmVersion":"lerna/4.0.0/node@v14.20.0+x64 (linux)","dist":{"integrity":"sha512-9uSCi03uoX6W/AU1NJgh4g06xscs+PDcM+twgFAV81SwSst7eFVvoVmtYFMQA91T8zYT88kiH+TLtOAz0+/SuQ==","shasum":"ba211e6c718fb603dbc00387f53af78d4126db25","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.8.1-next.12.tgz","fileCount":24,"unpackedSize":102144,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIC/H6FNi0COVRrdBvfv/89/+Zhz5q5crEWMW3M4CwINYAiEAozigo3JqtYO3PppYkAMr5SQ1Xm3anb1GmziOyF8O+iQ="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjKIamACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpQ0Q//XUlNgdiCDJM7n7ZnG0IAyontT6p2Ly3lgpIq/NtFPUN+oMTS\r\nMS9H1dWZdzlLs1443/zlz9tmOPVCGQe6QKiiKcuOTDPAQzgB/6LkKHk8xESf\r\n7k3WoxEHK2udedEVRKf2RhKVlfrQDfj9kTC72XwekscojzyNLkQ3IxB5qgtD\r\ntX4Foc6kZO9pWRItJvbHiscGtviOE7Pv0Uj9p6VMXn9nep9cZElpk130p4uv\r\n0L1eZ72OcBYzJSJWu53P69ucbCOZ1XuGMzTtvqJMdjvbI033xZn1jv8CPAGC\r\n2/pcDUp8EzWSgjyZXaVO3pIyE5phDpXBBc1ULEyvVL9fzmQy0tP43IKrrZrk\r\nXYXdqd0hGTBTxlbrGbe7CDpfwb3OxxuaknltK/Ze8s1i5vf1X7RCWwhVqZMZ\r\nGZBE8QUT79sdF/R9Rto6sJlZ2ZfrEbBXKoL2SaF47TcEf9OA+6To2pDM/URM\r\ninOX/TsVuf4xdHux3/WC7qU8L+hEk/R/BW12yvaVSn4DBeMczaD0uvswXjFy\r\nah/ntMtERme1tElPCXtL0ix+roEfGhjPF9fIzYrAxRQ2bssqhEE81aaAtbdo\r\nPCaVI21qpUeVRJGBjfBUTrAe99u6CheUxVPv7L8Laet0FusDSVNHCXYh1Wp+\r\n/pySXK93Won2cr862UaJj3aFaBLLnO9o57Q=\r\n=BAHR\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.8.1-next.12_1663600294371_0.3514015792135263"},"_hasShrinkwrap":false},"0.8.1-next.18":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.8.1-next.18","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"0.2.13","@sphereon/pex":"1.1.3","@sphereon/ssi-sdk-core":"^0.8.1-next.18+71e09b8","@sphereon/ssi-types":"^0.8.1-next.18+71e09b8","@veramo/core":"3.1.2-next.84","@veramo/utils":"3.1.2-next.84","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.4.0","@veramo/cli":"3.1.2-next.84","@veramo/did-provider-key":"3.1.2-next.84","@veramo/did-resolver":"3.1.2-next.84","did-resolver":"^3.2.2","nock":"^13.2.1","typescript":"^4.5.2"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"71e09b8e8cfa8237d8e3d0a6b0be0ed4f3beff48","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authentication request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst createAuthenticationResponse = await agent.getSiopAuthenticationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authentication request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationRequestDetailsResponse = await agent.getSiopAuthenticationRequestDetails({\n  sessionId,\n  verifiedAuthenticationRequest: createAuthenticationResponse,\n  verifiableCredentials: [credential],\n})\n```\n\n### Verify authentication request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthenticationResponse = await agent.verifySiopAuthenticationRequestURI({\n  sessionId,\n  requestURI: createAuthenticationResponse,\n})\n```\n\n### Send authentication response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationResponse = await agent.sendSiopAuthenticationResponse({\n  sessionId,\n  verifiedAuthenticationRequest: verifiedAuthenticationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.8.1-next.18","_nodeVersion":"14.20.0","_npmVersion":"lerna/4.0.0/node@v14.20.0+x64 (linux)","dist":{"integrity":"sha512-3TbL7sCgy0FcZ01MT7/kDIgyuYICRkFHJPfvxVB4tNZQYUXtX1pR+kCafu1d/mPDaRLiZzAIDcnB2khykYAv8A==","shasum":"b75245be9fa76781a02d7ecb7b9a942567fb3474","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.8.1-next.18.tgz","fileCount":24,"unpackedSize":102144,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCID2nsJ/D/uzt71VSkIL75YM3hizIopZzyEEiR4ZrXB5lAiEA6ObJ8WcSocLpSrt4F4Wvr2M58wLfRQ3lfZ8rrG2H5kY="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjLHteACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr4fg/+LlZKYIluqfMnhKIKC6xuhTTEG3x+mXird9/aD1ty5xb02xTB\r\nUHoA/ZjmLOYeLSLwUeH6p2xkWckoIGWmYXnkwsdNShQBzmihjh87chdmfZbe\r\npQjxNIGBBCP8yP5erEMGdS2JCGnr8LpjIhOONgr83Hoh0C7dYuHIJiRJe0G2\r\n3ikcSt2blq9G8X5zhOk68sivlhYTiTegpdzmKCv8MhgLlDSqgNujhs45var8\r\ndXR9lSfns4fZrTD+3NGZB/BwV80M59AxiKwoHF3m1sK2RsDEmfzKi53EEqlz\r\nXEH3nsOiZw6Dnhh/5WWUuDT2ifQVCbW4pZYcuvkad4FA0q6FuPC55YwJ0n6u\r\nFSyNjPfvExNyMqvfGAfXeRjgNvB/5JFpyRhi0jLahX3Y8VP0Bt2qLsAMlNzo\r\nU8aBxRhGKfchheMpXt/YAq9IVzvmZPy6knDjwaatvqi1IsPnPRB67hsVng93\r\nUUlkdX4Z16J8FQWJKBUkUJo3eRCC5+5V79rcHtTAHm+uANs702lrjqtkwZNO\r\nODvdERew9WekavQdQZDf1sGHUXse+WLM0bMS/J0RW0rioOIgt+1pVj1k1PLh\r\npEzxrY2ArtrT1Hsbw9w7fbyrfr7DybxRji5HI8sfZFCJTEPE1BGDJ9DjWQBa\r\nDYi4TojbaHrKhR3bmzwhJkSmGE5aDIHXJ+I=\r\n=j4vO\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.8.1-next.18_1663859550212_0.43458389769957195"},"_hasShrinkwrap":false},"0.8.1-unstable.24":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.8.1-unstable.24","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"0.2.13","@sphereon/pex":"1.1.3","@sphereon/ssi-sdk-core":"^0.8.1-unstable.24+5e407ac","@sphereon/ssi-types":"^0.8.1-unstable.24+5e407ac","@veramo/core":"3.1.2-next.84","@veramo/utils":"3.1.2-next.84","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.4.0","@veramo/cli":"3.1.2-next.84","@veramo/did-provider-key":"3.1.2-next.84","@veramo/did-resolver":"3.1.2-next.84","did-resolver":"^3.2.2","nock":"^13.2.1","typescript":"^4.5.2"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"5e407accd822ccb099677876df192e850b17ccd1","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authentication request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst createAuthenticationResponse = await agent.getSiopAuthenticationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authentication request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationRequestDetailsResponse = await agent.getSiopAuthenticationRequestDetails({\n  sessionId,\n  verifiedAuthenticationRequest: createAuthenticationResponse,\n  verifiableCredentials: [credential],\n})\n```\n\n### Verify authentication request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthenticationResponse = await agent.verifySiopAuthenticationRequestURI({\n  sessionId,\n  requestURI: createAuthenticationResponse,\n})\n```\n\n### Send authentication response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationResponse = await agent.sendSiopAuthenticationResponse({\n  sessionId,\n  verifiedAuthenticationRequest: verifiedAuthenticationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.8.1-unstable.24","_nodeVersion":"14.20.0","_npmVersion":"lerna/4.0.0/node@v14.20.0+x64 (linux)","dist":{"integrity":"sha512-z2zKRwDDPwK9szJ+vn6e3JIJagiWERWhPwwZYvXh+5pW8LciVES8KDkIpmxTC6b+p89soIWojq+CvGoQ+PKTyA==","shasum":"7469fc356ad85fd23f92adc39805337a2f749865","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.8.1-unstable.24.tgz","fileCount":24,"unpackedSize":102156,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDpTu51wo4j3kKopmUF1nlsio+Cf20W0imXDosN1KIePAIhAM/fjg0CmyT4nR6Qolq8Za6TG7x5VeQUaYTY1cgcS1gR"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjNgjsACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoerA//aSJgyGEk4I6Rai0ykFQ2y6Y9ZLLLU0xHGzqabb6wObjEeHH5\r\ny49XZxxGLxwRRKj39fcES2ktZ0xBNQQM117gF/cNntT4BXEPopFxzJvRpCFX\r\naOFLvEQKq6+f/tYVbKQ0QGwb9XebN3OAgVxtEPpVzjXiyOSlY3V4MXkw5HKJ\r\n2eUhs10HYCrrig44kSQmCv/CXmqYD5zWKiArN5F+S08aXDFTLvF66z89l7lO\r\nAjC9vx97Lc7xazvxwT1nQrdrBgz5prnkohDH3AYg7v2P3avYkrR66zCjGi7s\r\neXfb63CTTEqCRLgFZ3LXMPGj8vZWJKF5Bo20sGWd1sBvt9szEdHIWtu7d/4P\r\n509VllUFJJ+c5+/IC9ZkpVQn7EfM4Ojx+17I/mbtOaU4T85ceDmA04XBdjAZ\r\nVgGQf0X3dv3+wwR05FZszbKSqNTBnz7oYKNovYWKcgsaIab3+DsLztvIv7ST\r\nBkp13DzFMQKrTTybZcRDetRZHTZSTmdaXP3Z0UrWnMqOEuKnGDCsU1SS4s/P\r\n1L/MoSJNds7Ys9mUK4cmZrqc8VIcssCrzEpEOHU7rsGk6lzcH8hafeGHuzGq\r\n/JqYdd713dhfXIQQ6qjBtr7aWK99SogCgdABeknaWpTgWHOv49AzvjlZ9HZV\r\nRvnVybaO+lbcnLT8tnTl0WELgtpy/RQrLkQ=\r\n=ru0q\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.8.1-unstable.24_1664485612539_0.4891201486878589"},"_hasShrinkwrap":false},"0.8.1-unstable.25":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.8.1-unstable.25","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"0.2.13","@sphereon/pex":"1.1.3","@sphereon/ssi-sdk-core":"^0.8.1-unstable.25+8c8420a","@sphereon/ssi-types":"^0.8.1-unstable.25+8c8420a","@veramo/core":"3.1.2-next.84","@veramo/utils":"3.1.2-next.84","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.4.0","@veramo/cli":"3.1.2-next.84","@veramo/did-provider-key":"3.1.2-next.84","@veramo/did-resolver":"3.1.2-next.84","did-resolver":"^3.2.2","nock":"^13.2.1","typescript":"^4.5.2"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"8c8420a269feeb27374aa810986b4400d2a6c6d6","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authentication request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst createAuthenticationResponse = await agent.getSiopAuthenticationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authentication request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationRequestDetailsResponse = await agent.getSiopAuthenticationRequestDetails({\n  sessionId,\n  verifiedAuthenticationRequest: createAuthenticationResponse,\n  verifiableCredentials: [credential],\n})\n```\n\n### Verify authentication request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthenticationResponse = await agent.verifySiopAuthenticationRequestURI({\n  sessionId,\n  requestURI: createAuthenticationResponse,\n})\n```\n\n### Send authentication response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationResponse = await agent.sendSiopAuthenticationResponse({\n  sessionId,\n  verifiedAuthenticationRequest: verifiedAuthenticationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.8.1-unstable.25","_nodeVersion":"14.20.0","_npmVersion":"lerna/4.0.0/node@v14.20.0+x64 (linux)","dist":{"integrity":"sha512-owhsAflh0zwzzNcYlqc/+GzXqCtL3NHYfd54Z9OWQ3ou53Ucnvp+/MA4GMNF8KH0VYkeFY1n7IaFtjkY+DLZWQ==","shasum":"19bfdc30ca0b02a051d403b880a97e803a735768","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.8.1-unstable.25.tgz","fileCount":24,"unpackedSize":102156,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCJgw4rm8eMQclQp5sddlybfsXjCzEDJhavklCxHZJQPgIgYA2ShGKYYH3cMF5NjPB9u32P/bdsQ+2/gNmsSThWScg="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjPJUPACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoHuA//Wsdhiev8pnoiAMoevfyhmIRekMW4nKgwn6ZRorkI3orSetRk\r\nPfgH2toLvaes+gX5wpxWYCa4SMo02kEmK77w9eoieclr5JmB0W5662RBP/x/\r\n26stI/h3kfVDIsYdqPDYrbaQR6rv7RfawM6wqPK4Y0cx9zD3T3X5DTgaBLmO\r\nUVSj7aB6RpzwAQm7ShO86ce60P1BvFJaXv6XLHlC5TWIbr92+lwi9gt6vxg0\r\naeSVzLEHNwGub0HPF83i4++90tKWg6ApvGKJXt3IPMg1m2ysBpW3FDT5jJm4\r\nz/fctfACC2t4C80FAidZJ9JDa/WgXkP4xq7V8vgtFP0y69uNIiobI6KCOx78\r\nYY3qWcGSRBW5wMZe+lYsN1Odh+EFBqA9WL5teQiILprGjpyJwxYCyihX1LiR\r\nKtt3MZ4KUcx9uaa/XGvRK/WKI/QH1/Jhhj6bu8kqYDmRhtzKA5X5rxVkCur9\r\n+WBAgLWTqweBx31hYusBBkur2zuRzkbhpU/chDlmwGkpAb+hBi8fYtLk9Zsq\r\n95GB+XPwV2NReac0LAvCGx3MOIehnjE+RXNjh/NWhZM/jhYorkBF6wdPFbmE\r\nyQlFDxOi6mxf1Yx4M71mXhYgKsKRUiMK5QB5ssUPsK2SqkDJh0gWp7xKV8Gb\r\nKv/Ho//LOAjUzUC4lC1+zVuWThpxlo7I+48=\r\n=3FzJ\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.8.1-unstable.25_1664914703467_0.9316354979017814"},"_hasShrinkwrap":false},"0.8.1-next.26":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.8.1-next.26","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"0.2.13","@sphereon/pex":"1.1.3","@sphereon/ssi-sdk-core":"^0.8.1-next.26+4dc8dea","@sphereon/ssi-types":"^0.8.1-next.26+4dc8dea","@veramo/core":"3.1.2-next.84","@veramo/utils":"3.1.2-next.84","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.4.0","@veramo/cli":"3.1.2-next.84","@veramo/did-provider-key":"3.1.2-next.84","@veramo/did-resolver":"3.1.2-next.84","did-resolver":"^3.2.2","nock":"^13.2.1","typescript":"^4.5.2"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"4dc8dea175ff9eb8526ce6f1abb4b72ffbb58128","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authentication request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst createAuthenticationResponse = await agent.getSiopAuthenticationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authentication request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationRequestDetailsResponse = await agent.getSiopAuthenticationRequestDetails({\n  sessionId,\n  verifiedAuthenticationRequest: createAuthenticationResponse,\n  verifiableCredentials: [credential],\n})\n```\n\n### Verify authentication request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthenticationResponse = await agent.verifySiopAuthenticationRequestURI({\n  sessionId,\n  requestURI: createAuthenticationResponse,\n})\n```\n\n### Send authentication response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationResponse = await agent.sendSiopAuthenticationResponse({\n  sessionId,\n  verifiedAuthenticationRequest: verifiedAuthenticationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.8.1-next.26","_nodeVersion":"14.20.0","_npmVersion":"lerna/4.0.0/node@v14.20.0+x64 (linux)","dist":{"integrity":"sha512-iT1Gllei8EaF+Egk0duNHju7e97fYKPAsfQcYgc/KlbwrInDQI00yGlRvqzTbOVRCJXBT0zLb674asyAfL/HHA==","shasum":"1def1c8903033f4bffb84fafae94e2642de8a781","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.8.1-next.26.tgz","fileCount":24,"unpackedSize":102144,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIE8nAyUVMbBNaLaajA2B2Q2ue/CRUabGlAyq7UA07sAaAiEAqJZaO3ROPtk5IiV5npPcJiybmt1MrPpR7FtFus+njI0="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjPJyBACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoE7RAAnnJzd1iHpEXcrca99wBapPUd1mrz8LKlkkqHq6mw6+CpQltc\r\nm1Ny1n2DVk9JfvFQRRaPSlfFtIisMgzp9MG9cbb+fcSpBxqPOHgPXXGKFZrI\r\n3kAuiSdxJsIaywrDDC0gKI5NpVjjJfk70qDZf9FT33TxMwo3wzoxnvNfowXN\r\nmRMvyaGIVPGowT8QQIkev/fKnzfKJ+DTvIx6UqpH3mPHqDs66+OQp+Ry92o0\r\n5xvx/ZecMsqjkY+9wr+eeYiw4E2SbqD+7daP2W8QyNEZrj6vtYgjKuGYjwPZ\r\nJxONF6aDFiO7jYbZrdkFnKvss3hMN7oleDLycQ3T3CEgtfEfv7GBdnerr1kp\r\n9PMZVDASP5cjt3R722QySSI3hFul3+PMvJibUPaRrvr6NHh/fYNHHqb3j3/w\r\nK8JrlQmKVK3q1pTkUUWk4Q9LtHxuo5a26rll66IfVlcpn9o8oZm1+D5PMHSc\r\nAeV6gsTb/BuDaam+w3/JStrVFZm3AQ5vTPtClWLTmCrjsfSEjiIkkCM6qx3q\r\nyTR4YSOpZRKbIuM9DSzbnskz7q8i9uwHW4Tlxgyqhr2V95XFbOAP7XTunFDe\r\nAlOIc1/YWbWfHcOXB4asryMxb5QuvmWbj0eFBtSIKm3B7SSj63MtIg0tI4Xf\r\nEcTp32V9MbSdNG3OVJ68YwwZe9Xhv9UbmyY=\r\n=py0C\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.8.1-next.26_1664916609324_0.2254062218586914"},"_hasShrinkwrap":false},"0.8.1-unstable.27":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.8.1-unstable.27","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"0.2.13","@sphereon/pex":"1.1.3","@sphereon/ssi-sdk-core":"^0.8.1-unstable.27+b3caacb","@sphereon/ssi-types":"^0.8.1-unstable.27+b3caacb","@veramo/core":"3.1.2-next.84","@veramo/utils":"3.1.2-next.84","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.4.0","@veramo/cli":"3.1.2-next.84","@veramo/did-provider-key":"3.1.2-next.84","@veramo/did-resolver":"3.1.2-next.84","did-resolver":"^3.2.2","nock":"^13.2.1","typescript":"^4.5.2"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"b3caacb4d7850e5ac9ff2cc6b17b203871d2af12","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authentication request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst createAuthenticationResponse = await agent.getSiopAuthenticationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authentication request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationRequestDetailsResponse = await agent.getSiopAuthenticationRequestDetails({\n  sessionId,\n  verifiedAuthenticationRequest: createAuthenticationResponse,\n  verifiableCredentials: [credential],\n})\n```\n\n### Verify authentication request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthenticationResponse = await agent.verifySiopAuthenticationRequestURI({\n  sessionId,\n  requestURI: createAuthenticationResponse,\n})\n```\n\n### Send authentication response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationResponse = await agent.sendSiopAuthenticationResponse({\n  sessionId,\n  verifiedAuthenticationRequest: verifiedAuthenticationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.8.1-unstable.27","_nodeVersion":"14.20.1","_npmVersion":"lerna/4.0.0/node@v14.20.1+x64 (linux)","dist":{"integrity":"sha512-cNdPnmXVtr1s7hXb+lnz4WK9RIGaJ29V29gshvSnIM4SUpVzVIgMCCM2WwosWf7dI3wBF27Ti557TrrxzfWIbQ==","shasum":"0afb88324a07509163909b8e1250bc16a655f0a2","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.8.1-unstable.27.tgz","fileCount":24,"unpackedSize":102156,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDrWDd8IYfbDSk1ZSEO5cu2Zeszb+4k1d4k1rrWeDYpsgIgERTH2/SqegD3/hg8Kdllag6wIjDVTNClAr7fb33ZCZk="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjRpwVACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmqf6A/+ICh0Tr2sqIG335ZV7RwdLCdnswHOWfSPw1d516IQo6Nl1C/m\r\nqcHGbBLRpWV8e0sjIZeiRKCGj0TqSqBrA7uTrKOp1u7DlXMwclvxnPv3y8zA\r\nhC8sOPWiq7dijlkhnT+P4GuMzQEEx65xPNW8Cj4irSxaRxwyVZrM5wUBV8N5\r\nddQUQ+MDXHz4i1opZ8XHCyyvnm3BlzUUnnVO4PznLeBuJ9sCuqNKE3a/rZy/\r\n2ca6YJGlHbgMl47C56V0O+Y8DNskfnektMERtI/LoA4fh2kRd3hLzLTyWIuj\r\n+B1jskdhS6EoLqXcR6DBB5pBaL2AqevBHRTp6bK31SbAVULXdnUzuW15Hy+j\r\n8hbkaZTBnkP6uVq71yXml2gnPNA5W8fAKnQgmR5IMWRhZStRLoZZYDFk42si\r\nJTtYATFoUM0v7Dx+QgkQCf0dbFvDAExqJGq8+as4+3SRZbDeiJmzBg4iwAVQ\r\nB1LOjD9tj03o3V+jUFE32LXcIeefOLIoZK0AWMgimHUgHN4PK0C/A8ZRpDMX\r\nWhjEmMa/UhVUJ0iRURaSRV/OJczubArWPas9yshLPtiFc3lq19ntAIYYZHup\r\nmyH0aPLoEEQRd3IapLi+BdSZNKXYkz0hwTrc79l5wXbiG0oYDPIyCq3nLKUe\r\nYE8VXoqvtR3w9CxNqcbtBHTfls9p/NLzECU=\r\n=EZQf\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.8.1-unstable.27_1665571861296_0.37661711856734303"},"_hasShrinkwrap":false},"0.8.1-unstable.29":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.8.1-unstable.29","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"0.2.13","@sphereon/pex":"1.1.3","@sphereon/ssi-sdk-core":"^0.8.1-unstable.29+f5e1817","@sphereon/ssi-types":"^0.8.1-unstable.29+f5e1817","@veramo/core":"3.1.2-next.84","@veramo/utils":"3.1.2-next.84","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.4.0","@veramo/cli":"3.1.2-next.84","@veramo/did-provider-key":"3.1.2-next.84","@veramo/did-resolver":"3.1.2-next.84","did-resolver":"^3.2.2","nock":"^13.2.1","typescript":"^4.5.2"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"f5e1817d3a1e1abcf902b9a9760c76e5ccb990bc","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authentication request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst createAuthenticationResponse = await agent.getSiopAuthenticationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authentication request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationRequestDetailsResponse = await agent.getSiopAuthenticationRequestDetails({\n  sessionId,\n  verifiedAuthenticationRequest: createAuthenticationResponse,\n  verifiableCredentials: [credential],\n})\n```\n\n### Verify authentication request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthenticationResponse = await agent.verifySiopAuthenticationRequestURI({\n  sessionId,\n  requestURI: createAuthenticationResponse,\n})\n```\n\n### Send authentication response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationResponse = await agent.sendSiopAuthenticationResponse({\n  sessionId,\n  verifiedAuthenticationRequest: verifiedAuthenticationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.8.1-unstable.29","_nodeVersion":"14.20.1","_npmVersion":"lerna/4.0.0/node@v14.20.1+x64 (linux)","dist":{"integrity":"sha512-Ng8mHV6P3/INxsI4ca52yVZw9P2ORTKhGYWzRm0BvBrngt/K5iI87BcUiPPEWfGSSZgeb+xGj3L0w0iYzcXD9g==","shasum":"19abd95e57027b6b2ca9331b7b9215f05bab982e","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.8.1-unstable.29.tgz","fileCount":24,"unpackedSize":102156,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDr29PJhYTPavzCyWGq7yyzjaGAoUB5iLUogKclnfzR2wIgTP6Exk5OU7R93z0Blow7kCMxs3yeg9nZ8A6G3m3nO/E="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjR7pAACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpGZQ/+Jt91ubaqBdl+svLuS/J/RBM7Yxg6tH5Ujtcp4AkZ41tEYCuu\r\nJdtE9EcAnljI0bVqI2g81mq2oGvwHWFk6Jr9axh0jnE90xSHOK7Q0ySz+Jz9\r\nubMCeZ7MhsEZ5C45Oj6+1A7gvAxfkzJf5qktq6B9ueBes+1O2OfFN+cZwHZq\r\ntyEYA6RXF88a7itJMOYx9JDO3BZh0AuoGJ4kuW4mCH22cxk8w1664xQJxQ9Z\r\n7EBL1mVCZtLyx4TEkwdKXidl3w4hRzNwC5D7zC2a+p2cjei2pbosRPyZXzKJ\r\nN9v9DRQvChWKhXTqvxyv1DN6cFc6aFVEKbnC+EEzOWIUDx4noGtgan/Ju+Mn\r\n6Aa+rialgIzJ6qQEP65faNHARmRZ4kbz/WytJEfpFkRGglwOmk3RD6bxpM3d\r\nhyauslHe/oOSU9PMB+e/rLSW765B8yQDTMUBFBlaj4YxZr0ImHQV5QeUMIWU\r\n/RkY8XTPj5OBV0C7Q93O1Az6a++T1vfdwsrNOqOdx/fhZ6JbxCiyAOz6WWJi\r\nq/i/EZDeCc/7Vg3+m6JK1gzVkUvAbzckvMSzRXPtAID+kdyrfE+Tqtmr72EG\r\nPI9ZPIcR5SiQz4fvh7DQKnSmy+2OySRlbecfMoiffgzsh8cELHMtPM+v2OqA\r\nfrqI61Yy+XwBIhTv6FlpDiDHrdUrPcRZamc=\r\n=0vrp\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.8.1-unstable.29_1665645120616_0.06922491970293065"},"_hasShrinkwrap":false},"0.8.1-unstable.28":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.8.1-unstable.28","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"0.2.13","@sphereon/pex":"1.1.3","@sphereon/ssi-sdk-core":"^0.8.1-unstable.28+3f6cc47","@sphereon/ssi-types":"^0.8.1-unstable.28+3f6cc47","@veramo/core":"3.1.2-next.84","@veramo/utils":"3.1.2-next.84","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.4.0","@veramo/cli":"3.1.2-next.84","@veramo/did-provider-key":"3.1.2-next.84","@veramo/did-resolver":"3.1.2-next.84","did-resolver":"^3.2.2","nock":"^13.2.1","typescript":"^4.5.2"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"3f6cc47892b065522be088d72bcf4d0c5042d17d","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authentication request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst createAuthenticationResponse = await agent.getSiopAuthenticationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authentication request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationRequestDetailsResponse = await agent.getSiopAuthenticationRequestDetails({\n  sessionId,\n  verifiedAuthenticationRequest: createAuthenticationResponse,\n  verifiableCredentials: [credential],\n})\n```\n\n### Verify authentication request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthenticationResponse = await agent.verifySiopAuthenticationRequestURI({\n  sessionId,\n  requestURI: createAuthenticationResponse,\n})\n```\n\n### Send authentication response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationResponse = await agent.sendSiopAuthenticationResponse({\n  sessionId,\n  verifiedAuthenticationRequest: verifiedAuthenticationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.8.1-unstable.28","_nodeVersion":"14.20.1","_npmVersion":"lerna/4.0.0/node@v14.20.1+x64 (linux)","dist":{"integrity":"sha512-0uctPnDqRG4EWgP9Y+eIP89NxRjZBcMzXvB/g4s2nlfr1/iyZsB/76ZMy4hDlvL8BWAd84TEzo9iQzrBpkUr3w==","shasum":"e7ee5295616effab73359d98405bb739f5c4d4fc","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.8.1-unstable.28.tgz","fileCount":24,"unpackedSize":102156,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFGhpThOYpg4RaccpHHtQajAMp4AtMBuGNkX5VPEACHHAiEAsviZ6dSQ5ZAAVW9W+LIoRfUwcNCxqnUErXdYxMOYZ3M="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjR7qPACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo9sQ//di6HT/jROYXcbWAdba504NxZ2XfOhv+xkVnbGZuD9oVgIiWr\r\nwXAAUhxmvnKqEQ4c3IIEuV16s2mhfhn6K2rftPFEizm2L+QOHUEdel/YPr5a\r\njsY7L0XVJABYdP3a6NKWrsehY+JfF7VMt0YP7/MIxWw1/R6YEV3mq4VmxaDS\r\ntVULF/Qn2iBRHTSxoFKj5RkGtuqR3KsbmzyceAUfASB6awe33K23fggyT771\r\ngoRYT9OTXya/dQZ/YRKhowI3yGg65wAVg0XkBRQawplrtnMPvJAt4IJNq8fJ\r\nrWwg9l+4jUY8/MqI2c+U7awQk0LZ10Joh0fMAiDM2nCRWOsemdItSqQIS1Td\r\nAyepo7wcPbFuo6MuHD9PWq70pDuFafhPKNXgHf/rlVTwCEh7tHq9dGlHe3Dw\r\n2QErvoncoErhQpg912jz++X6NZuE2mXSAFTht1yOV463BD5weHXvFv1dkp6j\r\nBuXHcttXLVc+bnhZxZ/vpd7m22mCWwcgx8sndVBy6DwQ74D8Z4p2OagvHOpT\r\n9ko0B+YIaqk7VJqS6gCXpGgjl0onFpv9bCtuZ8Im4W/+aUpIvV/r8klAT0WB\r\nCfQ9RyjK8eu+P5usj10WVFjv/n0IKK7V5ZVBU+oZE0hVrwht7xXaTdYACETA\r\nUcLh8yBuA4EAYWx8H4mtiLPE5sc1ZfepfeY=\r\n=pzYp\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.8.1-unstable.28_1665645198875_0.2586687968827224"},"_hasShrinkwrap":false},"0.8.1-unstable.30":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.8.1-unstable.30","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"0.2.13","@sphereon/pex":"1.1.3","@sphereon/ssi-sdk-core":"^0.8.1-unstable.30+54625bc","@sphereon/ssi-types":"^0.8.1-unstable.30+54625bc","@veramo/core":"3.1.2-next.84","@veramo/utils":"3.1.2-next.84","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.4.0","@veramo/cli":"3.1.2-next.84","@veramo/did-provider-key":"3.1.2-next.84","@veramo/did-resolver":"3.1.2-next.84","did-resolver":"^3.2.2","nock":"^13.2.1","typescript":"^4.5.2"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"54625bc582f8c51b1823f097fadb6a4f6947e974","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authentication request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst createAuthenticationResponse = await agent.getSiopAuthenticationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authentication request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationRequestDetailsResponse = await agent.getSiopAuthenticationRequestDetails({\n  sessionId,\n  verifiedAuthenticationRequest: createAuthenticationResponse,\n  verifiableCredentials: [credential],\n})\n```\n\n### Verify authentication request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthenticationResponse = await agent.verifySiopAuthenticationRequestURI({\n  sessionId,\n  requestURI: createAuthenticationResponse,\n})\n```\n\n### Send authentication response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationResponse = await agent.sendSiopAuthenticationResponse({\n  sessionId,\n  verifiedAuthenticationRequest: verifiedAuthenticationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.8.1-unstable.30","_nodeVersion":"14.20.1","_npmVersion":"lerna/4.0.0/node@v14.20.1+x64 (linux)","dist":{"integrity":"sha512-d2R9g2FwkLPQTdVSXsCtuQGu/NIzUOUs5ugPQ4Ty67xE53UEiFHZHelAphTlpANNivGkwCINpGIUpTgzeIsIbw==","shasum":"401ecde001263ec6d86c1b720585ad0216faf640","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.8.1-unstable.30.tgz","fileCount":24,"unpackedSize":102156,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGmU4FS0ZQ8TXIGjauYzcy0F7nayCM5fs0RMU//qqeE6AiEA8GPUr6be6STWctAMCWeQc9rHhXatO06TykJ0xXDZjYc="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjR7uaACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmofLRAAn1PQi1l6dCeEOvfzfCk2mYLGaOIJi/omkRB7JGD8I4wDXayo\r\ndfN8nycZg4v/lbKFtC58kkyIvFl94Z6a5oKXaBOywMMp6LKhwyIr5suhWX8o\r\nlK/MKq4Tt/swZ8fIS3iUt6N6WmjvJFXyDD5h9pwK6xEgvUCKP7l8jX77utiZ\r\nsuzD3UR+B1bKC4k6nzlSt01+ycS33bqN8BoHsbIe3/cYH93c8Rrr+35iPSV+\r\noW5783vNds6dQ/3o59bryIUWtFocZs9h3TgOLmwnPXI+EMfunEXFjZcggccC\r\nmKWLGTIUVi+7yJYNgQwjUIR9v46ONqxOKvuEHbiQMpBhy6G6VCG+NiDUROWk\r\ndjuxoEdPr8S6zHRCv89G01tN6XlrW80J5yTRDrcQbq7MwQ7X3JbYzPNhugFk\r\nc0wjTD6bpSg4osaZ7YuKoniix+GggQEoU/wBw+m4Rlh++SJsE0iA8z6geafa\r\nX+tHrOCMg2f4Sv1l8QQ5UNkuYykGcXJhVKgARytnkJu5+JhkT3QNrCbcO9X8\r\njWTvKUL69UmEeQ/ON5UR7NI+3RkSQ7i79ClUliZJP153DhGqldob1smW5oSF\r\nvgrDy4sVq7ikeBlZzH+LE7I7L34iRICPdFop9SClkpTUDg5MF7zCHr/C6nXY\r\nGyC6aWelpTWgRhb+7nG5DIDipybcDDLxB0k=\r\n=BZyQ\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.8.1-unstable.30_1665645466510_0.010438854789943441"},"_hasShrinkwrap":false},"0.8.1-next.31":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.8.1-next.31","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"0.2.13","@sphereon/pex":"1.1.3","@sphereon/ssi-sdk-core":"^0.8.1-next.31+fe90ad0","@sphereon/ssi-types":"^0.8.1-next.31+fe90ad0","@veramo/core":"3.1.2-next.84","@veramo/utils":"3.1.2-next.84","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.4.0","@veramo/cli":"3.1.2-next.84","@veramo/did-provider-key":"3.1.2-next.84","@veramo/did-resolver":"3.1.2-next.84","did-resolver":"^3.2.2","nock":"^13.2.1","typescript":"^4.5.2"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"fe90ad0ac1fc1f401075310cae842a1e2136a361","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authentication request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst createAuthenticationResponse = await agent.getSiopAuthenticationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authentication request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationRequestDetailsResponse = await agent.getSiopAuthenticationRequestDetails({\n  sessionId,\n  verifiedAuthenticationRequest: createAuthenticationResponse,\n  verifiableCredentials: [credential],\n})\n```\n\n### Verify authentication request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthenticationResponse = await agent.verifySiopAuthenticationRequestURI({\n  sessionId,\n  requestURI: createAuthenticationResponse,\n})\n```\n\n### Send authentication response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationResponse = await agent.sendSiopAuthenticationResponse({\n  sessionId,\n  verifiedAuthenticationRequest: verifiedAuthenticationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.8.1-next.31","_nodeVersion":"14.20.1","_npmVersion":"lerna/4.0.0/node@v14.20.1+x64 (linux)","dist":{"integrity":"sha512-3QI3fGz8DkqJdjNJgF0NvO+RxW99UvSVVmx24lD7ZzAdudwG+itdAv1RN+qyfH0OIwq8QrnLggOFnvO7rw4tcA==","shasum":"6c8ee69f7ad2aead677631e5e0b19b46a6b21dcd","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.8.1-next.31.tgz","fileCount":24,"unpackedSize":102144,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFoVBOLhR0KgcknQKl5oYazhmQOrk2kYKtoTKOpQhPBnAiAsXSy7Qmzkwx9u/QY5F0KEL7Wf+7AAyA27KFcrSqNuAw=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjR8OGACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrhEA/+LrvCBAfNwlkK0xUQZ9njkHehi7gGaX8rm0hY8jWazry27TmN\r\nFpsE6DNUa2rJhMn2AFOLLo3WdMw3P3w6Nj6+ivM72cckeyn5BNTX+poU3Er8\r\ngAlUad4uvfvQALt4TygxhAnHc4HRHVrEYrt1mbLDFJIhshyqVazt4HxX5HPz\r\nzekmun6Kw6qvVZuW+UEkEXLZcpiEsO6wTyPHVZlkTUXhQzDTysMUqKitmgkM\r\n6CVnoIBOZckh9t7wxr9pZFr4R0KZfq4kjDMPZJRUys4GT+tki+5Oim2c445q\r\naIyKdNRJyeosnV/ncm+1aWCBn2n4twebac5j5HaC57z50sUk97u2KrpzZSWl\r\nK406aJ/GS0fntO5Llx+UEPNYSt1NX3yvHfUwaEbxuesHqBgKnPRdfRRjhBNg\r\nURGJEENF/MS8Oc+ChCxv2Fw3MjjxXiF5URpdTMz5cuu3MEJJcfAw+kokhnvJ\r\nmSoFdjD4HE9eaSfqXrmgbrWP1p1snODdYeLLczq6wiByAskSzKY7Nj7IuXcN\r\n3TpxOD8UVXL0436yeUO9LNBm2K/pjgL+DP5wWBxYN2k2sWH8WJn/B73Y+WuC\r\nqBz5BxDCSROcYWe9XDaY57sqBS6ZEVRjbnUoCHkOt4F+pQtkfnff+HVzr7Yl\r\n9NnXSmsXxa4lRpSZ1jxZ/5lXxI5+uHtuUKA=\r\n=gL8e\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.8.1-next.31_1665647494213_0.8945630508411706"},"_hasShrinkwrap":false},"0.8.1-next.42":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.8.1-next.42","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"0.2.13","@sphereon/pex":"1.1.3","@sphereon/ssi-sdk-core":"^0.8.1-next.42+5ee80bf","@sphereon/ssi-types":"^0.8.1-next.42+5ee80bf","@veramo/core":"3.1.2-next.84","@veramo/utils":"3.1.2-next.84","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.4.0","@veramo/cli":"3.1.2-next.84","@veramo/did-provider-key":"3.1.2-next.84","@veramo/did-resolver":"3.1.2-next.84","did-resolver":"^3.2.2","nock":"^13.2.1","typescript":"^4.5.2"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"5ee80bf59c72b012736e5a1f5bd1cf57e7264150","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authentication request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst createAuthenticationResponse = await agent.getSiopAuthenticationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authentication request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationRequestDetailsResponse = await agent.getSiopAuthenticationRequestDetails({\n  sessionId,\n  verifiedAuthenticationRequest: createAuthenticationResponse,\n  verifiableCredentials: [credential],\n})\n```\n\n### Verify authentication request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthenticationResponse = await agent.verifySiopAuthenticationRequestURI({\n  sessionId,\n  requestURI: createAuthenticationResponse,\n})\n```\n\n### Send authentication response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationResponse = await agent.sendSiopAuthenticationResponse({\n  sessionId,\n  verifiedAuthenticationRequest: verifiedAuthenticationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.8.1-next.42","_nodeVersion":"14.20.1","_npmVersion":"lerna/4.0.0/node@v14.20.1+x64 (linux)","dist":{"integrity":"sha512-vt2PeGa+qoUKh+pBEgFm/VEqd4KNtT+oDjzY9otU67UNz1bVIOSqpKE/oqrjDJV9JXhADwRuNsQTbPQLTKbIOw==","shasum":"ed8fec43dd918be75bb418ddc970fe4d58a67ae3","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.8.1-next.42.tgz","fileCount":24,"unpackedSize":102144,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHBRTzZfg65MtMf2rCc0B1NMV55WhHj3SA6BFrMfxbBdAiByqjMZZYVMgUFuLR5afjneirJilyottf4LMbw2lePvlQ=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjTonxACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqAig/+IA1Vl4uPdmK/Ud7rCtxiFMKN0JYQv29rm8y2qmRgrWrW4Fb9\r\nylqfnZvWoiBnu8GHk9vGzSmwdlM5t6IWIrO8BQ9cA5tMy6yIvVnFy3ckwrsx\r\nS3uhuRdNCxCs/NIce9Zqsy4coTZlrJEoCfdkV6F7YT0thqWI0FgpDTtr9e9+\r\ndx301QYpAQEPQSXHCdSWQ83XD6TjSBHf+m67RiwMQzBgjP5C4/LEnpPTCIcD\r\nKOVJIXgwfFFlg6ab/Dxd8sx9nGNoS+PfMC/2qvvN6K7m7eGOqjH/Sy//UD+f\r\nUVtsoA5cJbrY2PHJYH8ubMyX56PZiTB+rZRrxeRsF271J16KHyJ4WDpT0C0d\r\nTPrvZndFQtRCunMyc6rYCu0cNm56hmBgKLCfpEyXiLJpFM4m+MC2kUzc1Xbh\r\nqN5X+BoYB+GLcH91UGUxWwmDZNCR9er0sAHlNZfq38yViKJoUHsEsk902EYf\r\nY0YwevjE5m38elgwJwNKofmYZ/JiF/+dJe/mdqDt9Qr57+IdSMj2MJUSGBAq\r\nQ3MPXhC6FVeJgLCoCqOeiBmXxFkG39T7ooF1cYIf5s1WNPg5xaj9tLw/CzPM\r\nL973F43OLTOtZ/5sHU90TljFcp/GAOmcI0pPEHDaX4eObcdxdVyemSlk5k00\r\nDdE3TNMDHtqu/dl1mMG0QZKVpnbs/oOU1GI=\r\n=RJbi\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.8.1-next.42_1666091504991_0.3223263747697749"},"_hasShrinkwrap":false},"0.8.1-next.50":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.8.1-next.50","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"0.2.13","@sphereon/pex":"1.1.3","@sphereon/ssi-sdk-core":"^0.8.1-next.50+9c2d649","@sphereon/ssi-types":"^0.8.1-next.50+9c2d649","@veramo/core":"3.1.2-next.84","@veramo/utils":"3.1.2-next.84","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.4.0","@veramo/cli":"3.1.2-next.84","@veramo/did-provider-key":"3.1.2-next.84","@veramo/did-resolver":"3.1.2-next.84","did-resolver":"^3.2.2","nock":"^13.2.1","typescript":"^4.5.2"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"9c2d649295ab8802118f6216b882de6f86ea06dd","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authentication request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst createAuthenticationResponse = await agent.getSiopAuthenticationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authentication request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationRequestDetailsResponse = await agent.getSiopAuthenticationRequestDetails({\n  sessionId,\n  verifiedAuthenticationRequest: createAuthenticationResponse,\n  verifiableCredentials: [credential],\n})\n```\n\n### Verify authentication request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthenticationResponse = await agent.verifySiopAuthenticationRequestURI({\n  sessionId,\n  requestURI: createAuthenticationResponse,\n})\n```\n\n### Send authentication response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationResponse = await agent.sendSiopAuthenticationResponse({\n  sessionId,\n  verifiedAuthenticationRequest: verifiedAuthenticationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.8.1-next.50","_nodeVersion":"14.20.1","_npmVersion":"lerna/4.0.0/node@v14.20.1+x64 (linux)","dist":{"integrity":"sha512-iwpkTCm1VoO3VIDGmxi6XqIco4i4oz8bXapXIaKabYJlT77gVN/eYwLc1Ay4E2Zt27T82m7mkie9rOuoHivFeQ==","shasum":"948fc88a89ba92fa45dfca75dcc9c9543eecc93e","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.8.1-next.50.tgz","fileCount":24,"unpackedSize":102144,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCSjRkV+4wwOqSgIquj1ncyV1AtgPiaG12QS4ekJ5VMJwIhAIteaNONGhw19Y/3aN/NKyiM0ZsfVEVjKGQdsqzy0LDJ"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjTopCACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpQExAAnQHp8uG9aoMuZ8rM9K6ihI5m+4PKJJYRM8r/qfbh8KcvYwEv\r\n0XUOQfGOrLRapvuWyS2wZJ6oCZITAezK+mvRZREoam4qWF011nOJhlEoe5ub\r\nlvOR4WnHVAoCO6h1egf7uof7+CV4t7YNCMnj6IEw8YrPjAub5nt3IuadF9mz\r\nBJAqi46y7z+EZW5t0RZrISHrs4UvuFaMUtngWOzrou4E3xHdLs6pn3pGNOBP\r\nCyzLdTEgsZBbIFSjG0mbMar7GsU0R9ikjmtNdnEJGCBsiikk2NErzQt7X2Tf\r\nbQP7pcavAUGzyZgtRX5j+29dWTutSkPUoIiRKEmDD67kCr79M0fjQgCpdJcD\r\nl0a2bbh3QCTiKKz7edBHY274gv5zk1WH4OyIJBrDNPk9CGK+gMD0IemEwp88\r\nK9bHLzR5FOszfyZfUyAjHdpu23D7CyABnm/7G8nOUaFNin92AmE7lI3ZmkjE\r\nSMKbfEp17kr+2h1kDC7ZVF6+4TZD6VTaxayywywtt7092qhH+xUtsMKj9PCG\r\neH/CBnL23ROQ87jsAHkUP0XnJ7NswtphkrdbS2fbySDk6Z3Bt543Xm42Ktjg\r\n3SYNzMbB4BlnHcL2wSEygc6gvLRKaaKxXJ4NJYIunGBm085uuQX1OUsFM3dq\r\n5g8JCVO8xZQo/3yWfv0fnRYYoup7zWOmco8=\r\n=oS++\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.8.1-next.50_1666091586710_0.8352948954717343"},"_hasShrinkwrap":false},"0.8.1-unstable.50":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.8.1-unstable.50","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"0.2.13","@sphereon/pex":"1.1.3","@sphereon/ssi-sdk-core":"^0.8.1-unstable.50+9c2d649","@sphereon/ssi-types":"^0.8.1-unstable.50+9c2d649","@veramo/core":"3.1.2-next.84","@veramo/utils":"3.1.2-next.84","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.4.0","@veramo/cli":"3.1.2-next.84","@veramo/did-provider-key":"3.1.2-next.84","@veramo/did-resolver":"3.1.2-next.84","did-resolver":"^3.2.2","nock":"^13.2.1","typescript":"^4.5.2"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"9c2d649295ab8802118f6216b882de6f86ea06dd","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authentication request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst createAuthenticationResponse = await agent.getSiopAuthenticationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authentication request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationRequestDetailsResponse = await agent.getSiopAuthenticationRequestDetails({\n  sessionId,\n  verifiedAuthenticationRequest: createAuthenticationResponse,\n  verifiableCredentials: [credential],\n})\n```\n\n### Verify authentication request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthenticationResponse = await agent.verifySiopAuthenticationRequestURI({\n  sessionId,\n  requestURI: createAuthenticationResponse,\n})\n```\n\n### Send authentication response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationResponse = await agent.sendSiopAuthenticationResponse({\n  sessionId,\n  verifiedAuthenticationRequest: verifiedAuthenticationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.8.1-unstable.50","_nodeVersion":"14.20.1","_npmVersion":"lerna/4.0.0/node@v14.20.1+x64 (linux)","dist":{"integrity":"sha512-/x1t+Z6nxJUWjRldJKjUPXHHnjnGUOpEPQCkskVjCeWfi2zjGtIzfmr5d2Q+B+D7V0+Sxm6uuoJpFNSgDafLKg==","shasum":"44fd93a2e115a315e53a2bfb3c04a998300b1cf6","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.8.1-unstable.50.tgz","fileCount":24,"unpackedSize":102156,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIB8b82g6NWbE/AzCB6RXsNqEcGJssOBfx/FLANknQcnnAiBEFkLwld+Ik5mlrP2TXh1MQEnZhOqduJac5nzuf2KIXQ=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjWIL7ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrMdQ//evAot26To9J12ZD6exY0RllBG9DosT4vMRBVyLeHacBT6g6+\r\n9IY9JssYWSgLQ+fV8it/cPGB3HFRexMVCdX4X82morq88fzcwD5xp26IhXGk\r\nRMf2OyT//ozvzSAJaju9jSVls3weqnf6jj23lfAsydCN1fxAyJlQv9LcVbzJ\r\nzQGy9AwG22RpMogEbjTSPB8R7DbXaVexArUgjcn/iDkZUgaCgJXOVhAhqDAW\r\n4CFcF0pdXmyqPTQ7yA/ttfGdey2bLXS04ZZx1mfdzN14qO6SQUJj7YcjWVAf\r\nYc8/QQHZYGS/p74NBIq6RqKotBgPQ9GLV00de5cQvY8Q2IPf9LjXfK625pFz\r\n5Iba/98n2G9f3s5dY6dixNgwJyt6VxGiTvYGW2HkXaemU670NF3VsnHoXtdo\r\nyycROSuPLk+yXWmvImHqTAvO1J89mV1K+ssO82cXSXRQQiX0aDWUS204JiUT\r\nvK6hOhwdadIPoeon/4/Y3TWbJTvkiE9d/zOaATmk2hMddysTuKVpRBAPZlXY\r\nNsqiA1M4advHtQrN0W86bAdWWdhQqrDOEbgQSKNp5D82E2ICtucELdYCcjMa\r\nAIM3J3OUFUh3uYNzYVrX2m60IFjeR7rHtW0Pc+U9yiOrgZbmvQe+AWaH9MP8\r\nBbApYaTgCEoL5Ti1sxZdjxYj9/uhRz4N62Q=\r\n=DwHZ\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.8.1-unstable.50_1666745083100_0.962333523579217"},"_hasShrinkwrap":false},"0.8.1-unstable.53":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.8.1-unstable.53","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"0.2.13","@sphereon/pex":"1.1.3","@sphereon/ssi-sdk-core":"^0.8.1-unstable.53+25b005d","@sphereon/ssi-types":"^0.8.1-unstable.53+25b005d","@veramo/core":"3.1.2-next.84","@veramo/utils":"3.1.2-next.84","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.4.0","@veramo/cli":"3.1.2-next.84","@veramo/did-provider-key":"3.1.2-next.84","@veramo/did-resolver":"3.1.2-next.84","did-resolver":"^3.2.2","nock":"^13.2.1","typescript":"^4.5.2"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"25b005d39c3f06c1fe3db9def63cb6642e774f75","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authentication request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst createAuthenticationResponse = await agent.getSiopAuthenticationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authentication request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationRequestDetailsResponse = await agent.getSiopAuthenticationRequestDetails({\n  sessionId,\n  verifiedAuthenticationRequest: createAuthenticationResponse,\n  verifiableCredentials: [credential],\n})\n```\n\n### Verify authentication request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthenticationResponse = await agent.verifySiopAuthenticationRequestURI({\n  sessionId,\n  requestURI: createAuthenticationResponse,\n})\n```\n\n### Send authentication response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationResponse = await agent.sendSiopAuthenticationResponse({\n  sessionId,\n  verifiedAuthenticationRequest: verifiedAuthenticationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.8.1-unstable.53","_nodeVersion":"14.20.1","_npmVersion":"lerna/4.0.0/node@v14.20.1+x64 (linux)","dist":{"integrity":"sha512-1ElYlrLCf6/aU4hM9txPNbNDYzAXa6GaPTI12SP+r8+bgwpRlAUf0ttKXfUBQrgzAoJSw3qHWOoCEHSqym0+0g==","shasum":"d9969261ccd75294b8a295894403d8aa863e4b55","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.8.1-unstable.53.tgz","fileCount":24,"unpackedSize":102156,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHqEX/rj0Sd6ktCgRVEfJriDm9fjIyA86zKYm7tRDAiCAiBh8lBwFDmZSuQfCuoEZY9c9w8ijGXmOajs+owQQALJBg=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjWb9kACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqBdQ//bMPPvCBrRVRIdGkY9WI1liQj4zI6zWSABeTthRdRRJC1vORh\r\nzRCHTRQo3M8ctir2EDcXQU6PXrJPrBLmrIdCUHkTGh+feh/DGuLS6chz39DG\r\n7o9cQW7S6VvhfbBHx17PvC4rGCfyJiSsb+3dxWyJaKi0NvlniYhPgXZWX8vM\r\nvLUijSX+jJf42MZXI/zwu3pNFHm0iaEUUhybGEUXWlOpNr9fSwl1J0D6w/8s\r\nOZUvTcXehJDKzEg07dqbqE4I/RzQj8iqKv/aZlynjcJoiyD/nEGKBoxgutKj\r\nZ0KELQUo60BqcgPtwvQ+42+QRidgXpDwOGUwqmie5FavOP2PGY7VNGtwuKHJ\r\n90OqnpqPhrROlQdi5mbnE2XfP++KK3UzthFq/REevZWurDnKymEDuwLr9uN5\r\nWyspAqyBrX/mdkxZGRGN9TkQ1zwxsUizVnOt9wfIZLrtVOD8ehhpTLm/3DY3\r\naqbjjWuA/DuMiam7+YrmoR6/8m4DRWjgpyV3rgVU4oFXStpD1rebjxBxxn5l\r\n/hX9zRarvCx3Eb1803vtLI5loUO22QzSy/tbeFriYvz78hm3Hw+D4bkueE25\r\njFXPQWWPayrMdVhNFFA9Ej/XKlcZ1fNfy7YjBngh0F+loq3IUUWabLZM60fe\r\n5HGeOwr9apy/0gUPokkvFFDC83BkTfgjYmU=\r\n=Ngvo\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.8.1-unstable.53_1666826083826_0.177648171063419"},"_hasShrinkwrap":false},"0.8.1-unstable.54":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.8.1-unstable.54","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"0.2.14","@sphereon/pex":"1.1.4","@sphereon/ssi-sdk-core":"^0.8.1-unstable.54+652c6d8","@sphereon/ssi-types":"0.8.1-next.6","@veramo/core":"4.0.2-next.19","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.5.0","@veramo/cli":"4.0.2-next.19","@veramo/did-provider-key":"4.0.2-next.19","@veramo/did-resolver":"4.0.2-next.19","@veramo/utils":"4.0.2-next.19","did-resolver":"^4.0.1","nock":"^13.2.1","typescript":"^4.6.4"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"652c6d88fc4778f6ae276d938d1d7866a9816271","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authentication request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst createAuthenticationResponse = await agent.getSiopAuthenticationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authentication request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationRequestDetailsResponse = await agent.getSiopAuthenticationRequestDetails({\n  sessionId,\n  verifiedAuthenticationRequest: createAuthenticationResponse,\n  verifiableCredentials: [credential],\n})\n```\n\n### Verify authentication request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthenticationResponse = await agent.verifySiopAuthenticationRequestURI({\n  sessionId,\n  requestURI: createAuthenticationResponse,\n})\n```\n\n### Send authentication response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationResponse = await agent.sendSiopAuthenticationResponse({\n  sessionId,\n  verifiedAuthenticationRequest: verifiedAuthenticationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.8.1-unstable.54","_nodeVersion":"14.20.1","_npmVersion":"lerna/4.0.0/node@v14.20.1+x64 (linux)","dist":{"integrity":"sha512-Dn1JwSodnxPu9RK0PQ3vUx5LH9fJKWMytkagQkIBs69TVGAZ6Lu1+B3/GAmtj5M0Uq1xIMhKCeuNI7oUVzlahw==","shasum":"88a829ca3f3ec5974273a91874dbbb71a632e5ae","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.8.1-unstable.54.tgz","fileCount":24,"unpackedSize":102156,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDbBNNgp+zC0mk9PFGuoubXhZCMR05k4JAjO8IiaCvoDAIhAOEmCEmLmT+MA1UTxxNcyXMkE1s3tdSsPJORhpqsR5GF"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjWcBjACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoRKBAAlG/GtusyeyUwyDYaz4974hR9vjKuh7acfBBttcYkqWafh/V6\r\nsBOdktKhROHeVGzBnPT1E5sLQhVPEtC84v6iu+OYZhUWCQFVsezbvY9WMOZS\r\nNGksudnWexdxmDts2FN00+VaLGDIuKboz9oxMKzj873xIf98Q/l49JtL8V69\r\nQeZp98djpx2AmlkBRfQScauoeyoOgwTTWHvhFe5kOYyZGX0z3GD6mwM58eWz\r\n+TwmrW+lNWsAzDmMmpe1AikA3XeDgawZmNZE4tPJyFpBFbP18k5TL02ImVVy\r\n7u9Ba6kWblurL6Ff5YkU9aL3f+UOJ7xfKNzB7xaD4epknStF/3T/yGq010GF\r\nVDvdDKJV4X8ankMTtzAELvRPB160r2/u2UGGYdnz8lff4Lz5Lr9Pcu/ckCdh\r\nhIT/UUR/ZDBtB4Dny7dsTBfVN+KZCRZ0ur9/EgWKS+5p3w62lCIVYqOJHCsd\r\naRVJppK/x5tP/P3GoHlOePw1wH/DeBJv6GRG2JPxt5IMkmk7icaO+V+XXAC3\r\ntLsZAqK0hb10K7cwQ65Oi68fAz6/RwSrJ1UEBmspvlH/cH3n8jHkS4YmNdVj\r\nr/LXScqYPHeFp8MJenLUiwOG6QW2+M86xIKXZD/PPwiXlPiXzeG7n52NC9SR\r\nvcDOoxKbnjq5O/ILye1ptcESnqvCCkcsxLw=\r\n=JbDn\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.8.1-unstable.54_1666826339072_0.29603178820930753"},"_hasShrinkwrap":false},"0.8.1-next.55":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.8.1-next.55","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"0.2.14","@sphereon/pex":"1.1.4","@sphereon/ssi-sdk-core":"^0.8.1-next.55+67d3bbc","@sphereon/ssi-types":"0.8.1-next.6","@veramo/core":"4.0.2-next.19","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.5.0","@veramo/cli":"4.0.2-next.19","@veramo/did-provider-key":"4.0.2-next.19","@veramo/did-resolver":"4.0.2-next.19","@veramo/utils":"4.0.2-next.19","did-resolver":"^4.0.1","nock":"^13.2.1","typescript":"^4.6.4"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"67d3bbcc2680bba9ff7fd474ebe4f234f6a1a4d6","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authentication request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst createAuthenticationResponse = await agent.getSiopAuthenticationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authentication request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationRequestDetailsResponse = await agent.getSiopAuthenticationRequestDetails({\n  sessionId,\n  verifiedAuthenticationRequest: createAuthenticationResponse,\n  verifiableCredentials: [credential],\n})\n```\n\n### Verify authentication request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthenticationResponse = await agent.verifySiopAuthenticationRequestURI({\n  sessionId,\n  requestURI: createAuthenticationResponse,\n})\n```\n\n### Send authentication response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationResponse = await agent.sendSiopAuthenticationResponse({\n  sessionId,\n  verifiedAuthenticationRequest: verifiedAuthenticationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.8.1-next.55","_nodeVersion":"14.20.1","_npmVersion":"lerna/4.0.0/node@v14.20.1+x64 (linux)","dist":{"integrity":"sha512-bUeRQFw/iPALpoZ8cS/QA99ya3loU4ar4f3f+E5w/2i7rpEP2ZXho1ql46oQgbhrWDMbzUN4YdpxrNn9b/8TcQ==","shasum":"e1c101171cf03d35de8ecbee0ce3444f5980f5c3","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.8.1-next.55.tgz","fileCount":24,"unpackedSize":102148,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDmN+hKLGdRneHfxdFFSQaoLEyCl7RoZjHOF9zMhYQU+AiAREc15d75w0PD5KJH3CLfkJIjqksXJv9+EtK/JgZkHTA=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjWcNEACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpRRg/8DRoSvWepOD/mHYU9siaUs5azaFRoFYKF7oxB84EqwkFwpO/q\r\n1cIL17nMAwys/2Uix79vH7nPQIBGnWSayPnn0VrfL1LaSpAy/ktk4sZ2ViqU\r\n276VvzIj7gWO6OzmMeiu70azLru45cqXgd5lxO2L79hOAziqxHkMLRsNVYrO\r\nJsewJzVLpSM9tORDLDgxe8YPhkvvguW5Oi3ovr5IEqVKLE0VMqX5qcZkKXho\r\nVJd7yuZaLOOnBlYAZLrZXAMnZ704MCK1Mb2sDm+Xwus920pk4tE1vJyxVIx+\r\nMCc5Ss8dHqaiiLMUVHXI6WxEkNLttIYwApu8NtnFdYqg666CbySYo6jzz1PK\r\nKkawnxTMeHk4oluIHKitUo7p9unC2e2k6DSaawrUskMTEA4nlPfFEPRetwNM\r\nYwfm3UQLb8d3uYyFpKf47kg1LDU3ap9bkJXI78Yvr5bcJOpN+YPE+EI0stBH\r\nHjqu2TMTtQZJYNC6OtiV0d//tITOVRYdSJ+1+7CqlGQErUInsZ1QBExU0hlU\r\nq+x8sN60CqkOHUal1kJfEaFkFAS8nJUbK6gbs129LRpuuELQKGgM+c43xPcH\r\n7OSkiaT+zmaKORacmygGwO86cEL+4d0dz86B2nW/LeYaAtBAgEzNSZByKVeZ\r\n1rAjQvOT0eXLV2dUjaOtqbR3JfxZtzl3N70=\r\n=Ssqg\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.8.1-next.55_1666827076438_0.3767759516854292"},"_hasShrinkwrap":false},"0.8.1-unstable.55":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.8.1-unstable.55","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"0.2.14","@sphereon/pex":"1.1.4","@sphereon/ssi-sdk-core":"^0.8.1-unstable.55+9a710ed","@sphereon/ssi-types":"0.8.1-next.6","@veramo/core":"4.0.2-next.19","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.5.0","@veramo/cli":"4.0.2-next.19","@veramo/did-provider-key":"4.0.2-next.19","@veramo/did-resolver":"4.0.2-next.19","@veramo/utils":"4.0.2-next.19","did-resolver":"^4.0.1","nock":"^13.2.1","typescript":"^4.6.4"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"9a710eda8c2eeedeb58ab41fd64172b59317f29f","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authentication request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst createAuthenticationResponse = await agent.getSiopAuthenticationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authentication request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationRequestDetailsResponse = await agent.getSiopAuthenticationRequestDetails({\n  sessionId,\n  verifiedAuthenticationRequest: createAuthenticationResponse,\n  verifiableCredentials: [credential],\n})\n```\n\n### Verify authentication request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthenticationResponse = await agent.verifySiopAuthenticationRequestURI({\n  sessionId,\n  requestURI: createAuthenticationResponse,\n})\n```\n\n### Send authentication response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationResponse = await agent.sendSiopAuthenticationResponse({\n  sessionId,\n  verifiedAuthenticationRequest: verifiedAuthenticationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.8.1-unstable.55","_nodeVersion":"14.20.1","_npmVersion":"lerna/4.0.0/node@v14.20.1+x64 (linux)","dist":{"integrity":"sha512-7JQfboFpNymGqGPXX5DxHUJXHFAz4J/4xAuu3wxCWeMJ26v40WKB9Kcw3wkW845vTgAPf9Fj8fzEyJhDxMtghg==","shasum":"383b6886325b96de666517d5466b20f2c83d737d","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.8.1-unstable.55.tgz","fileCount":24,"unpackedSize":102156,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCwJBwZk7VDgMRe37PBB0kaijkkrUDdUWTjq/MiKIL7YAIgcFwaQDfXcfPzge7f4L6+lFv8a/S2b27x+nx8N8OJ/fU="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjWuruACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmqteg/+LP5t91Hdck9B9fhXqsh+lqh5alD92mCe76hLOGDTjIcGSCQC\r\n53qMB8FybSzYunePRGDljL88y/wEeklMukrtn2odPgCZipR5ZEMd5nODKAH5\r\nmTMbwqQdV5/BVJueosiaq0s3E5VZYPjnV7MQtnMbn8sSGQuM4xpJZkPbUAXS\r\nW8eXD94SVLXMK6LNY0F9MgdYQ/Thp679yvUh7sUVz5uSWUFqUdAOQgtN4Rci\r\n1D8vD2JshcQezwXlxvxJ7Hb/hGVp01G6/mdTliZBib1ujsM7/mtATDRiSv2U\r\ntLPMeRwOtG3l56LIM5D82bbeoRWqBt6ZHohmx8qgze9dyDbqJRdUo2O/yxNy\r\n4MTg7E3G193Hmtysru2dYXet5CYtMwZqSO8lAHEth753ukoVIrhv0iBDcfLZ\r\nhNfQXC2h1+21sg2xzNWGuQ6QVjRMiJCBiELqq8yXDisU6AiIWxaMd2Iz2Szz\r\naL8/SZz19UHaP133y512M3HoZUWQCK+AMYqaUBC/+d6XmQrKi1DMp31nCZnF\r\nmK4Cp7nTCPnfRgcuwnOgOqMafGDWHOygMlXENN001nkJrTfPGkWu+snihnBE\r\nxwBFpaNODYXIU+ji37dSyPG8T4ead433c7W2lAMi6eM3PW/TshXqoltOeZFT\r\nRPO+Gd1YLq/tngzPfPW/DB++mHmbQcONw84=\r\n=WERE\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.8.1-unstable.55_1666902765796_0.07792556554439733"},"_hasShrinkwrap":false},"0.8.1-next.57":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.8.1-next.57","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"0.2.14","@sphereon/pex":"1.1.4","@sphereon/ssi-sdk-core":"^0.8.1-next.57+12b0e93","@sphereon/ssi-types":"0.8.1-next.6","@veramo/core":"4.0.2-next.19","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.5.0","@veramo/cli":"4.0.2-next.19","@veramo/did-provider-key":"4.0.2-next.19","@veramo/did-resolver":"4.0.2-next.19","@veramo/utils":"4.0.2-next.19","did-resolver":"^4.0.1","nock":"^13.2.1","typescript":"^4.6.4"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"12b0e939c1ac9e6d5fd7a1509e24da4cf25d4cdd","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authentication request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst createAuthenticationResponse = await agent.getSiopAuthenticationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authentication request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationRequestDetailsResponse = await agent.getSiopAuthenticationRequestDetails({\n  sessionId,\n  verifiedAuthenticationRequest: createAuthenticationResponse,\n  verifiableCredentials: [credential],\n})\n```\n\n### Verify authentication request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthenticationResponse = await agent.verifySiopAuthenticationRequestURI({\n  sessionId,\n  requestURI: createAuthenticationResponse,\n})\n```\n\n### Send authentication response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationResponse = await agent.sendSiopAuthenticationResponse({\n  sessionId,\n  verifiedAuthenticationRequest: verifiedAuthenticationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.8.1-next.57","_nodeVersion":"14.20.1","_npmVersion":"lerna/4.0.0/node@v14.20.1+x64 (linux)","dist":{"integrity":"sha512-t+GM32tB98pf2Tt+eWJ0h1SsLhbKRh8Tg7POFXi3ksnG/isoaXBFgvrOtOzIw38CdEN4e4pRvSnyI4L0Pw/6RQ==","shasum":"98b1382f5660c25d1ef669b7244dd2a5ccc8ce1b","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.8.1-next.57.tgz","fileCount":24,"unpackedSize":102148,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFFQNTuHCdRFqKQprvov6TjP/LBlAiYem4RFN2h5AaIMAiEA0nOFCTeFJtQ0A7usrxHlHE2ve+0Hs/vfntI41WTG+KU="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjWuwZACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrCaQ//UxZdmRZZX6v2SKCbNfXm5/e1/jkpEwvH4IlUAXkPKmudajN+\r\n+PwZbnDmc9MHCLLqKqL6fphzGe3KlVLZgoZfVQRGRYkBUgQtprOCKB9EjBvb\r\n+2bhBRPBSudVJFVZX+k44ZA03lXOtSW9oJHh71/uGFHO5mcjFr5Z+HcQiTYv\r\nt3+1yBX9kapMm4kHxlDwKXDmHL+PUWzI6IflXny+hH0It+Peyu5hbH9s4TEb\r\nNwM1WFW+drzEvG+vrut9RD9Voj+Kvvsmgn+6R2qJeXErCA8oIqpqKR3oxga8\r\negZmo2908J92PVAbGBxIjxfnp0Qgoa6TcbDJeP3Nj3aValWlwf0aWzWdDDNV\r\nSqbugGJHgzBJvdS1KPhdouv9Mq9zaLn5GuU8dkjFMbo5cq9IZp64ijvzsaWF\r\ns9/YRXaN2DOYE0wLZwqrerABv0omkpo4+uy13PBsIm06e/ikMPgRNAXHwZJL\r\nWYqEPOvBlmgjzMhhXZgPHeQwRPFW85SUQF2tkmE7ifoNjsSrgN+np4hvRu/D\r\nFeTjeQU/dqhNQCpVCD2Fz/hUvqzxVRLjNuDE4m5mB4kQFN9kXHDswQUYTH3h\r\nCINc2llEmNzuyBBBKwC2QThzCRAzPXknNbK0coctMoYeK/b/iWy9pWxGbg3q\r\novmXUH3GIn3ZoDjD4kXVlISMIOC4CsVc84E=\r\n=QPZs\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.8.1-next.57_1666903065580_0.6118084937377521"},"_hasShrinkwrap":false},"0.8.1-unstable.61":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.8.1-unstable.61","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"0.2.14","@sphereon/pex":"1.1.4","@sphereon/ssi-sdk-core":"^0.8.1-unstable.61+5254adf","@sphereon/ssi-types":"0.8.1-next.6","@veramo/core":"4.0.2-next.19","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.5.0","@veramo/cli":"4.0.2-next.19","@veramo/did-provider-key":"4.0.2-next.19","@veramo/did-resolver":"4.0.2-next.19","@veramo/utils":"4.0.2-next.19","did-resolver":"^4.0.1","nock":"^13.2.1","typescript":"^4.6.4"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"5254adfc5ab0d368bca2a55bafa4498ee270dbd8","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authentication request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst createAuthenticationResponse = await agent.getSiopAuthenticationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authentication request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationRequestDetailsResponse = await agent.getSiopAuthenticationRequestDetails({\n  sessionId,\n  verifiedAuthenticationRequest: createAuthenticationResponse,\n  verifiableCredentials: [credential],\n})\n```\n\n### Verify authentication request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthenticationResponse = await agent.verifySiopAuthenticationRequestURI({\n  sessionId,\n  requestURI: createAuthenticationResponse,\n})\n```\n\n### Send authentication response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationResponse = await agent.sendSiopAuthenticationResponse({\n  sessionId,\n  verifiedAuthenticationRequest: verifiedAuthenticationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.8.1-unstable.61","_nodeVersion":"14.20.1","_npmVersion":"lerna/4.0.0/node@v14.20.1+x64 (linux)","dist":{"integrity":"sha512-VkQerKV743pR984cYJmYFI6TTx4A+ev4aMepXw0PDhrnuOhC5/edAL8SBNPq+xsbuv2Veut2CiwfBejgemA4fQ==","shasum":"8cacc97fc0289020eb74ac95e7d2278b12c4ffca","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.8.1-unstable.61.tgz","fileCount":24,"unpackedSize":102156,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC0YI6ogOD/WaYVYjnAZDF0IyJPlJlgmdUUfl+BkWMQ+QIgajHGJJtC+Tl4ulbtUySiaGqs9TCqhlE4TKsHoeMDofY="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjWu2BACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpeaQ//enIm+UyENGvQOJur0fDFTBFKvk2rMPAIiagxbQ6wC4GDbSu0\r\n5VpvOtzNJea5HPKkmARM3K+/vVzldEDGhpt0oUyJqX2D5GJKWl/SF5rgqIty\r\nb0S4RdVFInzMxKvhMYRDzw8FGDYEn4DhMNFQDs8TSEBDrbBI7XQcn1oiJrQv\r\nWXqeMLlvt4/flGeH5JG0p14LcLjQfFyrbZZ/z9OMmGXQQb14aLOWIHg2gVVK\r\nrngCWRzNPEvDtfQqwMQK8eHIHqw+/lUTWZiWV7u2pd4TgadpHqn7F5zNihrO\r\n5WaaioE3uV+qdTqHd3C1MBZySGdoIHhOLz4G+cou7yZNbeEerA5VVqgrsi4B\r\n9ztUeDVB3y0aDkVKY0U3uHjsrMntp6lna/nKB2T/zr1QOP2/w4RPlVzz/xNV\r\n1qo6rjEqxcQvYARj8OfzsxpN6eLWS0W2yvwKgxzwuxUgt5eWhc5BddI714nH\r\ne7Khiob67dabxSA8+XoJRvewaAstVgdhZtkXgt79WJO089HSYhrTbvxycr67\r\nKrcCxxrpPOFykcvIqQqaqfOsM5p0khYe3mmiebXc8V3IBukgJ787lN/k3F9o\r\nEaepS0Yf21ikC3eC+eOXyNrh4xP4XezCj2pDEmw2OnXWCdZYMg9/nSR34fAT\r\np/jEVtEu8EUnAYntG9Yy3V0bgGHowoNCx+E=\r\n=vRR9\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.8.1-unstable.61_1666903425434_0.29366594148195535"},"_hasShrinkwrap":false},"0.8.1-unstable.63":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.8.1-unstable.63","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"0.2.14","@sphereon/pex":"1.1.4","@sphereon/ssi-sdk-core":"^0.8.1-unstable.63+469843f","@sphereon/ssi-types":"0.8.1-next.6","@veramo/core":"4.0.2-next.19","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.5.0","@veramo/cli":"4.0.2-next.19","@veramo/did-provider-key":"4.0.2-next.19","@veramo/did-resolver":"4.0.2-next.19","@veramo/utils":"4.0.2-next.19","did-resolver":"^4.0.1","nock":"^13.2.1","typescript":"^4.6.4"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"469843faa86f08a88f7fd253381c904fd1aae282","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authentication request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst createAuthenticationResponse = await agent.getSiopAuthenticationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authentication request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationRequestDetailsResponse = await agent.getSiopAuthenticationRequestDetails({\n  sessionId,\n  verifiedAuthenticationRequest: createAuthenticationResponse,\n  verifiableCredentials: [credential],\n})\n```\n\n### Verify authentication request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthenticationResponse = await agent.verifySiopAuthenticationRequestURI({\n  sessionId,\n  requestURI: createAuthenticationResponse,\n})\n```\n\n### Send authentication response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationResponse = await agent.sendSiopAuthenticationResponse({\n  sessionId,\n  verifiedAuthenticationRequest: verifiedAuthenticationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.8.1-unstable.63","_nodeVersion":"14.20.1","_npmVersion":"lerna/4.0.0/node@v14.20.1+x64 (linux)","dist":{"integrity":"sha512-DMMkvqP+OYbHXpZkHGADPOIQzZvQQXDLweSfDkDO/D2swVZ2aIA/L8zEi9tq3mcDDBcsKtdOIlvZKC3cth9LUA==","shasum":"49e91bbb59549e1876f758e1219b68786127c5d1","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.8.1-unstable.63.tgz","fileCount":24,"unpackedSize":102156,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCoUboPcZWnrrV1ccxSweEgG8mJIXlVK/ZOE3CkxuaY6wIgLRgFTu6fNfM+qKFr2g/Aiz9SAAKYnRa6LSSnHcPuVHQ="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjWxw0ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoIyhAAgkogmiJu/SahNIfNSomjFP+9wJkNCmPHcU6OcTp0xqfVst5z\r\n4/OEo0svU76cVX8jdvzUDmpgiK/S7hRRoPK91l0pLsTlI5A3WdLGoIWHlm5V\r\n0F/OECYxdpiQcQujHf5d1boRgfGJZ+BAHiJQs/oSZMGS/XwvceC4Yp2N9LUf\r\nsT0I1MHFcLnUgs+oSvu5Wqfj+ZBBoNIkR+I3pTgleZ0XWsbX2N0foPXy1hd5\r\nO6xCJhncj0amYWd4908iEhGTblNzV+xZ84zT+JwXmRLNHX3Izy7E04WGDIAE\r\nsZSoWC8xOD1F8Hbr/9tkudS9EiVVt7k/3Rne7a0i76Bl1pZlAbT0K3wi4jqU\r\nqGRl8/6OliEBHO6QQWnutkHQ6IrT73fxNRk/2UVKSznVY8lhFR95mCrKOICw\r\ngPwp7+FrGBAIwExzsNLl/RQl1r/318JbL1SVIwLXNs95n5Zni+EypXjnisKi\r\nVl2aHdSGaJWatAUhxmELq1mNcsG5Hpl2v7BA8VFx8WHhR5om23k0IUNbrD11\r\nXNJgsfeXVZF6qaOMxw3Td1wgBN56W6rNYtsfweLNt9X2nlKpHNiAdupmtopk\r\niM0i2XhR1RzFjtjI5x0LRqeQ7L181s2uHMadg2aAdDYclO855H6QMX7PnOT2\r\nUbl/iRxtJWBVjSEBi0jwsGXrRzXPTDxnwQo=\r\n=ESWn\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.8.1-unstable.63_1666915380309_0.8310979354964609"},"_hasShrinkwrap":false},"0.8.1-unstable.65":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.8.1-unstable.65","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"0.2.14","@sphereon/pex":"1.1.4","@sphereon/ssi-sdk-core":"^0.8.1-unstable.65+d66c11e","@sphereon/ssi-types":"0.8.1-next.6","@veramo/core":"4.0.2-next.19","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.5.0","@veramo/cli":"4.0.2-next.19","@veramo/did-provider-key":"4.0.2-next.19","@veramo/did-resolver":"4.0.2-next.19","@veramo/utils":"4.0.2-next.19","did-resolver":"^4.0.1","nock":"^13.2.1","typescript":"^4.6.4"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"d66c11ea4977275629555d84be0f1e8dd23cfa35","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authentication request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst createAuthenticationResponse = await agent.getSiopAuthenticationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authentication request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationRequestDetailsResponse = await agent.getSiopAuthenticationRequestDetails({\n  sessionId,\n  verifiedAuthenticationRequest: createAuthenticationResponse,\n  verifiableCredentials: [credential],\n})\n```\n\n### Verify authentication request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthenticationResponse = await agent.verifySiopAuthenticationRequestURI({\n  sessionId,\n  requestURI: createAuthenticationResponse,\n})\n```\n\n### Send authentication response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationResponse = await agent.sendSiopAuthenticationResponse({\n  sessionId,\n  verifiedAuthenticationRequest: verifiedAuthenticationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.8.1-unstable.65","_nodeVersion":"14.20.1","_npmVersion":"lerna/4.0.0/node@v14.20.1+x64 (linux)","dist":{"integrity":"sha512-n8bXiuV3F/BRcUnVzC+la7ePbJ2cU8v1cQTh7laZQAhq15egamaHfsPFrGAozfIm7KaLxOuSpoeK3x5YDJguNw==","shasum":"9691373c847cd5cb5930ec3671e0a0f314a4f250","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.8.1-unstable.65.tgz","fileCount":24,"unpackedSize":102156,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEU+lH0G6+JaZuHMIBkY1YNBdvlaF/loIy3uuqlV28yQAiEAka5QHRFDHEzRZQCy7EziJAsem/NSg9NB5VwGqDp6Xes="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjW5e6ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmolYQ/+IH5LrsOP2Ck4Hum/e1VAyjakogPa23jB1pkV65fyNpC33fjM\r\nHN51oCWZogeN+ze+nSzGGj0Z2Iaw2GZ/U2AoGdX30A+PvW6HMknsfqS1PoB2\r\nCb9pLqjIF0t9np80vOpm7ZkNG8/DMtFLTC9tvN0fkrfljFtXBqS28rkdotk6\r\nU9AuhwtoxnUoHB/c5XkogCaOQJAN7VYasJygHV5opuzHrbO8j0aymhjOgWIk\r\njJUvFlv6bL3dDG+ZPce8aGxYGVs7E5iLEwtVObYpA5M0BVAx6elzvqKRnNs7\r\nvfbWbhr+HkTocTVNls1UtE++sgZMHfsoNruGD3HAdiHG5yEHJOFc5Dx5pthH\r\npl8o7pmrYqLiz2ZkWVWwTXC2lrcyhU/TQyNdbxM/ESyhBFhOaiT82cyhPv5J\r\nTsDCMkSG0Cor8dqKUyk7tO5KLY5uIq2Huz3Zw30fc5yEjcHeB3XPRuAZsgHq\r\nhzgtfsQEAeeFf3oElaYlB2NMBz4/yZe7ZWTx+SANyuGiOl7Qj87SQtEWqD8C\r\ngiqbBxXiLwN3RKS4ITNhy4ura7fPm/jdhoEE5EsZ/irsaD2y78KcfWaljZCZ\r\nChoe1OL4weWYcfJuU/2TFepBNtODTnFuMBS28oJW4SmAEwyIcJbtPCc2wUWT\r\nvDNMIL2UsSF8TW/e8nEImYGDiab4kQYcJUg=\r\n=wMt1\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.8.1-unstable.65_1666947002688_0.7277732602515146"},"_hasShrinkwrap":false},"0.8.1-next.66":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.8.1-next.66","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"0.2.14","@sphereon/pex":"1.1.4","@sphereon/ssi-sdk-core":"^0.8.1-next.66+9a65e8f","@sphereon/ssi-types":"0.8.1-next.6","@veramo/core":"4.0.2-next.19","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.5.0","@veramo/cli":"4.0.2-next.19","@veramo/did-provider-key":"4.0.2-next.19","@veramo/did-resolver":"4.0.2-next.19","@veramo/utils":"4.0.2-next.19","did-resolver":"^4.0.1","nock":"^13.2.1","typescript":"^4.6.4"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"9a65e8f0cbedd244a79460add8b3e7c6bb45ea66","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authentication request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst createAuthenticationResponse = await agent.getSiopAuthenticationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authentication request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationRequestDetailsResponse = await agent.getSiopAuthenticationRequestDetails({\n  sessionId,\n  verifiedAuthenticationRequest: createAuthenticationResponse,\n  verifiableCredentials: [credential],\n})\n```\n\n### Verify authentication request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthenticationResponse = await agent.verifySiopAuthenticationRequestURI({\n  sessionId,\n  requestURI: createAuthenticationResponse,\n})\n```\n\n### Send authentication response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationResponse = await agent.sendSiopAuthenticationResponse({\n  sessionId,\n  verifiedAuthenticationRequest: verifiedAuthenticationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.8.1-next.66","_nodeVersion":"14.20.1","_npmVersion":"lerna/4.0.0/node@v14.20.1+x64 (linux)","dist":{"integrity":"sha512-87lwUWcbLM7judoeu369LFRHQMVGfxjlxWNqsTY7EoAODZI1nW93oDSckT6Ps4Ef6kICopAMqpqR8DReTa5wcg==","shasum":"4fae860d8cca0a7c71244c5f745786cafd7f53db","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.8.1-next.66.tgz","fileCount":24,"unpackedSize":102148,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIF0uDslLAFo84nnCBn8/NTi9RzkTf27iLEyDm4CiZlVTAiEAp7u+Rl8Bi9MGrWKYog2x01EQlFUR8bYyWuo2m8z5Vtw="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjW7urACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr6KxAAlmOWE7uJrXNtFZ/3TG+lnkBGB+4+ALRCgrHWe6lh+abNdUdg\r\n+9eYC4ev+z1yF3EbNuqeCyOjN0dgrPd7OlJF5417K8YXvYa5Ft2uBPw4PPCR\r\nZCFu+1sQReCHT7Z65Z2u49yB17mypHK4NXfr/Cfq0j+8bTEIYpGzweDADXsp\r\nETDxgtNgGQuZudVkSPKhKsb4WuWTt+UA8SI2vqa7TRZcVI+hWErxgTIcVPrZ\r\nPL0FkCBoB1vjDUOJyQx3YgdVZtU+f/MmoEda0k91U3lb2cj2/IwLul+78PkF\r\nZIoR5bQBbuEEqpmAHnyJfJSVoJLd6vz3urmC3e0UKGeh8sY7UzuuV0QY8Vgm\r\nAWawJ3FZKPrEfaCLpUtlY+yJQwDCvSyJm4f0cPDtjnaMlLIa1BR/u5EdH94T\r\nrkBe5wsq93or8yo7GBObrweubG8mnS3l0+srYgNSacPFE9H/N+mNAIpOShuQ\r\nEiUYMrzFDKW5OXwH1HAbkgxBNIhEUTE5NqwreMwbTtsflE7EPkxkECKWOxcL\r\nERxp7DVOMFc+djyT6VLTEwpei0SC5Jv/cMd2+0T10MAHuf3PeNV8yTaOERpx\r\nU1fAATAi+uFfr4VkgwxfKv3GekK8gP66tCiPhVFf+uJ4sk7tjpDDFxL5sqqJ\r\nvFY6OptcmMK0WRhQwwjxnekh1R+O1X/hKKI=\r\n=Iwn5\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.8.1-next.66_1666956202878_0.04154612695974835"},"_hasShrinkwrap":false},"0.8.1-unstable.73":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.8.1-unstable.73","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"0.2.14","@sphereon/pex":"1.1.4","@sphereon/ssi-sdk-core":"^0.8.1-unstable.73+0cd067d","@sphereon/ssi-types":"0.8.1-next.6","@veramo/core":"4.1.1","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.5.0","@veramo/cli":"4.1.1","@veramo/did-provider-key":"4.1.1","@veramo/did-resolver":"4.1.1","@veramo/utils":"4.1.1","did-resolver":"^4.0.1","nock":"^13.2.1","typescript":"^4.6.4"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"0cd067d71cca9832da452ed00e03bde91159c691","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authentication request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst createAuthenticationResponse = await agent.getSiopAuthenticationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authentication request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationRequestDetailsResponse = await agent.getSiopAuthenticationRequestDetails({\n  sessionId,\n  verifiedAuthenticationRequest: createAuthenticationResponse,\n  verifiableCredentials: [credential],\n})\n```\n\n### Verify authentication request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthenticationResponse = await agent.verifySiopAuthenticationRequestURI({\n  sessionId,\n  requestURI: createAuthenticationResponse,\n})\n```\n\n### Send authentication response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationResponse = await agent.sendSiopAuthenticationResponse({\n  sessionId,\n  verifiedAuthenticationRequest: verifiedAuthenticationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.8.1-unstable.73","_nodeVersion":"14.20.1","_npmVersion":"lerna/4.0.0/node@v14.20.1+x64 (linux)","dist":{"integrity":"sha512-n8cUrE6T0BC82eWrMecxMW4ClDyRzfQDky4O53LMjrgvbmfGbd3Zn7PPZ52NwjDl09UaGmRZDqyhk6BZj5i2ow==","shasum":"1c27fb123caad9e21b5648ba695a818084056334","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.8.1-unstable.73.tgz","fileCount":24,"unpackedSize":102116,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDXPZ3qPJOWiilQdElJ74CPRCL8E9p5OjLzRb8puShquAIhAP3KHePF5fdoV4YGf3zhBr3hnkhAf/tbUlff3gNFz0Ew"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjZEXfACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq4FQ//a50aXiLBPKSS8Cvx6/T30SqNLA9y0Cwxniw/tAlOsWunaW4h\r\nJYI2IT/I8b0OxmHss/acANollx9zAe5uz6HGPp9En0n7Uxkuwc62b8mrDCiA\r\nfztiONrDkI3hZATxJTbLMgxzUqadnGIZydxCXrzLlzOUKJeL0ZizTb33tt4Z\r\nVlusePWYbK0hcybrsfnZjQkuSxXlVhQbcPz8D400JeGeO44HpXT4MN+79MkC\r\nUjex3lAPZ968l+0zMMspVruCd5SvumrwGBM4rmGN1yXJ4pnnFDNjWb0KWXmk\r\n2iHhI0oIg2YD1k1kUl33CuJALD0REZDCtuIxpLQ8c9cWSIWoz3xRFfhZLkVj\r\nwdmUfAh4XUAa8fxJkAx/t1jROat/nCf8an6uBYnczXtE204H33s5N8dTo1/L\r\nhcoUUu/xvFxCo2IQyF/limMlauiUQP19RjiXuqUUIckavawGxtHXoDukemXW\r\nRdJ1kpQXg2q5LFB4JULXMYUxtyKPpo5E1qo4lceztM+3e41MH7OGT7yJBTwX\r\nlzWNEMvimgrXVjGdAu1mJajcLloctMwyX2FK9b9hr9q7s+x/s8Wbg8s/xiqL\r\nCGLZQF5KAdmEaIrlcA8EdIg50bnuAIXxl0hqtG2Ejpg0ML4Y+1Sq4n+ewoHv\r\nWhLvopyfnRbENiuYGSCqMDYjdPQDNSSBTMQ=\r\n=t82z\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.8.1-unstable.73_1667515870836_0.8937426039682919"},"_hasShrinkwrap":false},"0.8.1-unstable.74":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.8.1-unstable.74","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"0.2.14","@sphereon/pex":"1.1.4","@sphereon/ssi-sdk-core":"^0.8.1-unstable.74+12dae72","@sphereon/ssi-types":"0.8.1-next.6","@veramo/core":"4.1.1","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.5.0","@veramo/cli":"4.1.1","@veramo/did-provider-key":"4.1.1","@veramo/did-resolver":"4.1.1","@veramo/utils":"4.1.1","did-resolver":"^4.0.1","nock":"^13.2.1","typescript":"^4.6.4"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"12dae72860fd0dc00e96a8121b136c2195843388","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authentication request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst createAuthenticationResponse = await agent.getSiopAuthenticationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authentication request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationRequestDetailsResponse = await agent.getSiopAuthenticationRequestDetails({\n  sessionId,\n  verifiedAuthenticationRequest: createAuthenticationResponse,\n  verifiableCredentials: [credential],\n})\n```\n\n### Verify authentication request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthenticationResponse = await agent.verifySiopAuthenticationRequestURI({\n  sessionId,\n  requestURI: createAuthenticationResponse,\n})\n```\n\n### Send authentication response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationResponse = await agent.sendSiopAuthenticationResponse({\n  sessionId,\n  verifiedAuthenticationRequest: verifiedAuthenticationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.8.1-unstable.74","_nodeVersion":"14.20.1","_npmVersion":"lerna/4.0.0/node@v14.20.1+x64 (linux)","dist":{"integrity":"sha512-jE7jvBXGpPbXDIkB9m+4X+EfH4cCUwrQH1FCtJBzAXKK3mKJi5UFQXNAHUCNCKztVCj6lzrbWvcUgsuud3ypMA==","shasum":"28c1346bf7f4ef4743a56f4042bf74e41cb55473","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.8.1-unstable.74.tgz","fileCount":24,"unpackedSize":102116,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCnO5DCqKRJjGxKZjYuTlhuDnm7MytFoAS8SimVP2Z2VwIhALkH0JY/C7UjDAGhGKf9S1zjI6E+DpmXIVco69n7VmZC"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjZFuuACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpRQw/+LRB6xaR6FkYSNdPMhRDKA1+5MRttZh37fIItB4/fL1sDRaVl\r\nEz3Lm/x/kDWzDlfFfJSEepXBMpxO6xDS7L5M6FVlsaOsI41SFF4/vLEi8Xv+\r\nzLlFhdCRgdbdCMgD21xs84X9JPoPLtZPGQyUhTMLcVMMQGbgJAfhelgGTDYU\r\nkR//p5YkPoIUk79ZsXNBTfpdeCHh+JrwoeRNfWVKPeUq25Fsw6BOv1m7It72\r\nCxW2Zp9D4U1c1+PcSEyqtWVj82p6TKz6sbtkIs3FAPeNgQyYSEtMvVdYBmxc\r\nvoy9NUro9CSVI73IHH9hLf47aAX0Zn/4iW2vp78k198eO1BU07csSNtv788p\r\nEtyP3RfyPXdYwWk+AUlptXKv3qqT2cnmbDaDnmMxXEvRViegzoD3eshz8hb+\r\npjYxviGV5IMaeFFaAP+VducbT3jizN5zt1QypHOYX0nGey2a0VU9BOECFKoO\r\nDCWEsrRwaXqknnmZJ1zo4IM+Ls1HAYD2KiJOE/OTSFC8UNUcPDVUyHtWkyZR\r\n21KqqMWGKGYwHRyKdR4SLt30Gf7Y4UgeSFEPrQgJ55MZP3ZcIrBPke0dTZRn\r\nupdyjYfYM3bYbkB4YMZryl4H8Isax/Td2GHeORzdCpceoHPSH2M8U0xfOrHy\r\nUESEP5qHSP//cqJ+aOyYXJC+P/SGGj9jnLc=\r\n=wxRa\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.8.1-unstable.74_1667521453992_0.12153537137968362"},"_hasShrinkwrap":false},"0.8.1-next.77":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.8.1-next.77","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"0.2.14","@sphereon/pex":"1.1.4","@sphereon/ssi-sdk-core":"^0.8.1-next.77+473b111","@sphereon/ssi-types":"0.8.1-next.6","@veramo/core":"4.1.1","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.5.0","@veramo/cli":"4.1.1","@veramo/did-provider-key":"4.1.1","@veramo/did-resolver":"4.1.1","@veramo/utils":"4.1.1","did-resolver":"^4.0.1","nock":"^13.2.1","typescript":"^4.6.4"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"473b111b98030a1f795ff1e521ce17caf202b4b8","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authentication request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst createAuthenticationResponse = await agent.getSiopAuthenticationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authentication request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationRequestDetailsResponse = await agent.getSiopAuthenticationRequestDetails({\n  sessionId,\n  verifiedAuthenticationRequest: createAuthenticationResponse,\n  verifiableCredentials: [credential],\n})\n```\n\n### Verify authentication request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthenticationResponse = await agent.verifySiopAuthenticationRequestURI({\n  sessionId,\n  requestURI: createAuthenticationResponse,\n})\n```\n\n### Send authentication response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationResponse = await agent.sendSiopAuthenticationResponse({\n  sessionId,\n  verifiedAuthenticationRequest: verifiedAuthenticationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.8.1-next.77","_nodeVersion":"14.20.1","_npmVersion":"lerna/4.0.0/node@v14.20.1+x64 (linux)","dist":{"integrity":"sha512-5T8fbd+Z5oZ73jOafP7ocy4IqZJnlZ8pcNWpaR022RpedlG8uFVQVljJRoT2QtyivnR5ydKJ0koH6vdNTT/9BA==","shasum":"13de2b0a826c662fa0248daa5a2a6bbfad0666b6","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.8.1-next.77.tgz","fileCount":24,"unpackedSize":102108,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCVj+y2NtyDyKTDLMK0kOp01KH2ywvsUGpZxZvokTVt1QIhAN6pCUjQ93EkHoq69VWE+N74+PIOq9WX3PLy6vdBNARH"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjanPgACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoJ9BAAnxcEfQ0XFaCi6aLBXiQSF8w0WN3VvUOJnchHYhniaNn2z6T8\r\n1kIcCfS1alIu1rRrx0Uk+4y+pPOF+5cWHzCTZoDB1utkfZEGn64TnxwAdvON\r\nVojlxBbUtfK3AIATWiRJyjKLfAHsqiRKsfh7j4TMPKaLr5MrBjM2sKCMZMTM\r\nYt7Q0NyfBuj9XhLcBSgz1iAa+uYpUbplwRHNq+JnJWAS51SnjnPcdtkn0Vdx\r\nzbFYAVHN6PCSqKwF8817BvV6bxc+vYStXIAu5CPWqkvlF8HV/rO+BbOXdSob\r\nfOpX260ErpQFUJxFe02FeOVsfDRSY1IcFPjOHDwGTNaC7lpCz5n58AwcjbxD\r\nCMjXLbwJGQ4YZmB8Y0EZ3RQJAGJJgZPPAmZTbcBV2xuocLwL6aPKPOYOY0Pd\r\nJcQBMb5qpM1gayDoUuBNKeEY2kcNvgQ518kMsZ3VDJ0wi8StIbN8/yIoHj60\r\nsVzX2WcFjntI8JUKHiqOzWxELk2SXFZ/C9iezRxp0AefEDhHz/9wuOLI+DMs\r\nurerRcpDB3+UnTZLSkxYRR6CHGARboCqG/iGrix6Zwyi9DRhGJSZM8aNOvcd\r\norW92DwsGtxTtGs74sgrLK2z3VGB2pI3yO4VR8LxdWfy/vn99vMskXb6DmOI\r\nvVHBdrMhAzF+/ZvfI8MBo78KiQBT7wpwidY=\r\n=poSI\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.8.1-next.77_1667920863826_0.18057008426794696"},"_hasShrinkwrap":false},"0.8.1-next.84":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.8.1-next.84","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"0.2.14","@sphereon/pex":"1.1.4","@sphereon/ssi-sdk-core":"^0.8.1-next.84+d94e147","@sphereon/ssi-types":"0.8.1-next.6","@veramo/core":"4.1.1","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.5.0","@veramo/cli":"4.1.1","@veramo/did-provider-key":"4.1.1","@veramo/did-resolver":"4.1.1","@veramo/utils":"4.1.1","did-resolver":"^4.0.1","nock":"^13.2.1","typescript":"^4.6.4"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"d94e147dcc96a10c1107c8f66a991dad9c5cfac5","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authentication request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst createAuthenticationResponse = await agent.getSiopAuthenticationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authentication request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationRequestDetailsResponse = await agent.getSiopAuthenticationRequestDetails({\n  sessionId,\n  verifiedAuthenticationRequest: createAuthenticationResponse,\n  verifiableCredentials: [credential],\n})\n```\n\n### Verify authentication request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthenticationResponse = await agent.verifySiopAuthenticationRequestURI({\n  sessionId,\n  requestURI: createAuthenticationResponse,\n})\n```\n\n### Send authentication response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationResponse = await agent.sendSiopAuthenticationResponse({\n  sessionId,\n  verifiedAuthenticationRequest: verifiedAuthenticationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.8.1-next.84","_nodeVersion":"14.20.1","_npmVersion":"lerna/4.0.0/node@v14.20.1+x64 (linux)","dist":{"integrity":"sha512-tuWAM1vlMvz/YjK3iuKFgj1kLLZUuDhmLAx6dDpPevDCUIlSibwV24VGVOrldv8mHK3KdGfRS/HZ6WhVCOVlow==","shasum":"1ae2b69757cad424ab6aa64893cf7cd1d2df0fe9","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.8.1-next.84.tgz","fileCount":24,"unpackedSize":102236,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCG+B0vju6etgcnfJzsUeHOyKpFHSLRHtvEIo1oKpKTNAIgJt45tKQBYVt00wRW5FQHfasjiM3nhfRW3OO79M8i2KY="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjanXyACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoDFQ//cPIYimisOi1qtZ0xMuZ+XCNmDrZgrJ3vNfn4/d/25iIsSjaW\r\ngxKU576AJQ+/QBJRY+hnQOlpTIx8uAU8c6feq97OyPB3FNNjOWyEGKZvoB7e\r\nccbr8YiJVkqGEiudahs8Zyp+z4zpGcscz0C5I9X0JB5aUm2kdjSFUuZXDHar\r\nXI3BtEO8UbxU27u3Khr20wuIDZxtOjsT1nhSICTdegmIECJ4/jSwFShV7TdO\r\nt+6BPJgBbSdBUNtFxn8/JB62somG5wHJ2Se9JzIpah2CBHxirTqFyLUkzV8o\r\nrtCaJAOExcMaVjFNg1tIe/Cdk5xhXWTcEPEGGNmEpgmt8mzIZ6xHChzaJGz+\r\nw04rOxbyLhGIze5MlV6MckjXNnBzdQSmirPKymBuNcKfRE9LdG2YKZO4OvHW\r\nPbrGLMa3hUxxxjHY4sq/la24C3m2Yx8cKz5Wc6IY02Fp1e3zdLJ+yH3lnIwb\r\nYrxv8LTrevPfusw8DClqkeV7H1CG3g5n67XQ6dtyzwDudqd3Z8ulZT8Cuq+Z\r\nHiZD+8RUAvftZkgY6wqxcZKZUUWczLDrJ1U1JS1YJObLAh8zR/eCdlqpYNvU\r\ntXb+pntqxCW9g3FzhzNbwbgqvnJbtURMm5uTEFnbRKg6q1j+tjvRHKK6epaU\r\nd2WYAy1T2psPyuuJLZM3jvDlJq4w2pJfokQ=\r\n=0apn\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.8.1-next.84_1667921394461_0.8457454455930904"},"_hasShrinkwrap":false},"0.8.1-unstable.85":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.8.1-unstable.85","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"0.2.14","@sphereon/pex":"1.1.4","@sphereon/ssi-sdk-core":"^0.8.1-unstable.85+9c5cedd","@sphereon/ssi-types":"0.8.1-next.6","@veramo/core":"4.1.1","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.5.0","@veramo/cli":"4.1.1","@veramo/did-provider-key":"4.1.1","@veramo/did-resolver":"4.1.1","@veramo/utils":"4.1.1","did-resolver":"^4.0.1","nock":"^13.2.1","typescript":"^4.6.4"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"9c5ceddd61087efa8def8f748ae1a9450bbeae46","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authentication request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst createAuthenticationResponse = await agent.getSiopAuthenticationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authentication request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationRequestDetailsResponse = await agent.getSiopAuthenticationRequestDetails({\n  sessionId,\n  verifiedAuthenticationRequest: createAuthenticationResponse,\n  verifiableCredentials: [credential],\n})\n```\n\n### Verify authentication request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthenticationResponse = await agent.verifySiopAuthenticationRequestURI({\n  sessionId,\n  requestURI: createAuthenticationResponse,\n})\n```\n\n### Send authentication response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationResponse = await agent.sendSiopAuthenticationResponse({\n  sessionId,\n  verifiedAuthenticationRequest: verifiedAuthenticationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.8.1-unstable.85","_nodeVersion":"14.20.1","_npmVersion":"lerna/4.0.0/node@v14.20.1+x64 (linux)","dist":{"integrity":"sha512-gP2h+zlm1DHOfqzchEdVA+cjTCh+ZGU57I3JaeHWtVchgM5hWuwiupBWyQds66+EA1TUhfo2agXlVRYXTxEqaA==","shasum":"04f878b13c2d3d0b14776100e80c0974e2a3742c","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.8.1-unstable.85.tgz","fileCount":24,"unpackedSize":102244,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEH13NnnzDSCvCuT5bi5AnJGz7UDiIt7Uw2LQhowplqQAiEA46c5gkiAYYg7AqYyI9Yr2Gbnm08aYk8yJf0IIDPfYcg="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjckUlACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmoh8w//XNk/nKSe0po79kkxwuX7/a127Fbu+uYCpyx05oPQdY9n8SgD\r\nCe1/ClU2/FS6ZX7DXy6eG86wmzE/sk89GWgokp99pryYXonZV2PKtpt62YB8\r\n2MdpkwcyePq8p5SU1xFf+F1LblU+H2YCD/M4DEpXDbxFqWQ0pS2AqR/mabHs\r\nQKrH1wvFQzXJV7CNJqqPBE/KyDZaWncjdFQ+PYItXRY1ErNGjaXwPOUr1s6z\r\n0jz3sK3Blb1uSVZ0PvYz8tEn36RHHZBVgX10J3VGypt/kz/F8uYW0EuT0w/Q\r\nG6h9AoxwcmbjNP4fkd64YklcWtBYM7aOxOpY/RQcTtWkG+kHYAHg/h7WDk8q\r\n8M27IXojihGw7Q5l+5AWDTRaZ5/ykt5DvobL3FfigzXCM/Lb8GbeUl+zmYLG\r\n9RwRoC8bpCHe04zWMU79GbWnNKskA1IN2+HT++pqBzRHIzPxCjftxGtdWX9A\r\nBH7I46ppkSl41m2zG+KJLs8aIDPX7dZg7YCOeVNr8M4iH2hnD4kUMO99SDSa\r\nMsVApZZP8xpWIv+IegiNiX0AqV4wufvRHNX93PLCZqvoWd0DZy2G74CFtumx\r\naxmyg0hpygb182hm+gBbsh/DJqX4UHjZNH05F60zZWWQGLRSzm0KbjMLrWmW\r\n/FtvegFTnvpPCpkQLrVVOPIEmbq6ldFFQ+A=\r\n=k4Hl\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.8.1-unstable.85_1668433188917_0.3231821917875861"},"_hasShrinkwrap":false},"0.8.1-unstable.86":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.8.1-unstable.86","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"0.2.14","@sphereon/pex":"1.1.4","@sphereon/ssi-sdk-core":"^0.8.1-unstable.86+55d3de7","@sphereon/ssi-types":"0.8.1-next.6","@veramo/core":"4.1.1","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.5.0","@veramo/cli":"4.1.1","@veramo/did-provider-key":"4.1.1","@veramo/did-resolver":"4.1.1","@veramo/utils":"4.1.1","did-resolver":"^4.0.1","nock":"^13.2.1","typescript":"^4.6.4"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"55d3de7ef96fee215cc1eb1c497ffa3b125c218a","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authentication request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst createAuthenticationResponse = await agent.getSiopAuthenticationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authentication request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationRequestDetailsResponse = await agent.getSiopAuthenticationRequestDetails({\n  sessionId,\n  verifiedAuthenticationRequest: createAuthenticationResponse,\n  verifiableCredentials: [credential],\n})\n```\n\n### Verify authentication request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthenticationResponse = await agent.verifySiopAuthenticationRequestURI({\n  sessionId,\n  requestURI: createAuthenticationResponse,\n})\n```\n\n### Send authentication response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationResponse = await agent.sendSiopAuthenticationResponse({\n  sessionId,\n  verifiedAuthenticationRequest: verifiedAuthenticationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.8.1-unstable.86","_nodeVersion":"14.20.1","_npmVersion":"lerna/4.0.0/node@v14.20.1+x64 (linux)","dist":{"integrity":"sha512-in8f/tcwNsYtz4J9S3LmeZPr6MksN1OjAVFW8e7a5vqoEUr4aoBhU0U3931AYw3jCg95aJQYWEgE81Q2XTZhfw==","shasum":"eceabe48376c6a4d0d9355ac386207768cbbc025","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.8.1-unstable.86.tgz","fileCount":24,"unpackedSize":102244,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAdlwptPzFJ4DBIy4ZRcIXS0knQMIvZCJpmVBtWdl7HvAiEA7G2diMaeBCA6KTs0iED9PDM03IuklRzQMOWFQLR+JIg="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjckhqACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqG/BAAkPjkKLHgegdrDSiu4k6ICq0HPfm1nmkabF9BQhDipBjiQbOK\r\na3QNOmzwBNVY192Ut5aH68GGnbKnBmqYZQ3yJGpx11Z3D/Izn5BQY9Y36GUa\r\nWoH9mPG+MB1h+yl6Plf0UaapIToH/8WdR8gNoOtQ7rl9mE7KQMPr1vtkPUlW\r\n+05N2sWUtw3FFL6FKyTIsjc4MGdaqJmCIIZnPGmYDFSWaHYEItTrPWUfoR0J\r\nHnst4+7HRkiR/oQqEowfN+IWWyvACGO2WmOwMDH2dP49U4FXsJuAbBswh/zS\r\nNIOJ+R1d8tGacPwpeLCjy/WyZjcw8pWoYl2wz6GZ/yhitCudxPU5WlR3rE07\r\nMu+XV2Pm1H1IdJRm5DMRZLrjnM5MmuNY+HFIXJai3MUGg/NWdI0xdunxzjXo\r\nifHdyOQ4sIJ6cJYIR4boS+hM5Je5fs2wcOlpeXwTLY6fcz8Kmq0PJJThhSMa\r\nr1+RwrPICpf1bQhze3HjGY6QhjDlh50LoBjFrRAjwTXX4cyT5BWrySP7XzsX\r\n+7W7iU2jiGYSwubotoH8o2Vy+OUyLzcjazczUwk3q2oiPYro+Q9dI0F6JV1C\r\nq5zjW6lvQYx0d/GZehE+ocRSTD7yjQuzX4XTwVizhs4GpEqJ+ML9xVcCA+Nl\r\nQ9m5Gqs+d8TbrsRk2CmoV4lRi+In9gHjckQ=\r\n=SXzX\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.8.1-unstable.86_1668434026787_0.7022975108533442"},"_hasShrinkwrap":false},"0.8.1-next.114":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.8.1-next.114","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"0.2.14","@sphereon/pex":"1.1.4","@sphereon/ssi-sdk-core":"^0.8.1-next.114+62debd9","@sphereon/ssi-types":"0.8.1-next.6","@veramo/core":"4.2.0","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.5.0","@veramo/cli":"4.2.0","@veramo/did-provider-key":"4.2.0","@veramo/did-resolver":"4.2.0","@veramo/utils":"4.2.0","did-resolver":"^4.0.1","nock":"^13.2.1","typescript":"^4.6.4"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"62debd972f51a3f1ad90e922115eed4c2f56cefb","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authentication request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst createAuthenticationResponse = await agent.getSiopAuthenticationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authentication request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationRequestDetailsResponse = await agent.getSiopAuthenticationRequestDetails({\n  sessionId,\n  verifiedAuthenticationRequest: createAuthenticationResponse,\n  verifiableCredentials: [credential],\n})\n```\n\n### Verify authentication request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthenticationResponse = await agent.verifySiopAuthenticationRequestURI({\n  sessionId,\n  requestURI: createAuthenticationResponse,\n})\n```\n\n### Send authentication response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationResponse = await agent.sendSiopAuthenticationResponse({\n  sessionId,\n  verifiedAuthenticationRequest: verifiedAuthenticationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.8.1-next.114","_nodeVersion":"16.17.1","_npmVersion":"lerna/4.0.0/node@v16.17.1+x64 (linux)","dist":{"integrity":"sha512-eoPijhanj0+hJ3uGEP1Zjr4ek6MdASm7S/twp+kP+FZK239kQtIFYgOl+EKourxF03Kp8JFcvwdmVXYAPproFQ==","shasum":"479096f0487fcf209f790bf79a92daf6b7091b50","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.8.1-next.114.tgz","fileCount":24,"unpackedSize":102234,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICfBX6eZ1Xcexz40UVc1I6HBV99EB3OgJ8IRYW81DcntAiEA2F+brfoJhGaERSGPrfb8NhM7tXAnKhinRYTVzUGcJ1Y="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjnSLtACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpLqg/9GdWyr9Ts/wyZqkrXs2d75yOnKZjlWJzWY9+bvnVDsAFI5xwe\r\njP8IYO9aG2DexiO+zo+A8rcomCnv6pFQlH8lmbDwT/6mnVHpm+GVP0Zlgo8q\r\nhCkn9mvkzRB3dYaNVlzALGsSRBVvcFAWSItj59bqoqDl/+NJHN87L/b3dq+/\r\nmcqbnOCyTGbE2J5E9uS4M2fUsJA48HEu/z9RmHy8kPIQb6wA7MMOlVpwBRjC\r\n1NrXJN2mVJxRVzjjo1o372hylVjZ3viRWZSAyyKpJNRKGkBAGne7e9xUi9dC\r\nD9IsROScd2m6IDZhJv+QrN87DRKscLpOh050AXuzcsN2fVKw6VIqyXdghFK9\r\n9QVLLjLfyxfzpgNSLxKmCAlPNAtNp8Y+AIn0mez/xAh2ULDK2YuaTgcoRuZi\r\noCYJ76nRFIfa0zxjGirj/7lP5XsQNZTgGsqAVavEUer48ux96EOoxsgy6pi0\r\nv4vO4MBBQiSs0S3pTCvT1OUILsLN6pGycW7FRceq3fymPqpytN2ctVEm1bqA\r\nVxJn+6NL0pMqBUkgUfKhrnZ9/n+GgPrtUM2YwEtejhYx7D04lZx19zgBZWoe\r\nCdGbsbH1N+DSdd3c/Wzjn/tiEix6Pi8tlmBYLuKdUPLBwliXTRHhEnoL72m0\r\nR/cHLdYQI2wMpE0gHlfgxfBeUaO/ZdC9/Qw=\r\n=78fY\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.8.1-next.114_1671242477704_0.8257486164585814"},"_hasShrinkwrap":false},"0.8.1-next.117":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.8.1-next.117","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"0.2.14","@sphereon/pex":"1.1.4","@sphereon/ssi-sdk-core":"^0.8.1-next.117+fc10bcc","@sphereon/ssi-types":"0.8.1-next.6","@veramo/core":"4.2.0","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.5.0","@veramo/cli":"4.2.0","@veramo/did-provider-key":"4.2.0","@veramo/did-resolver":"4.2.0","@veramo/utils":"4.2.0","did-resolver":"^4.0.1","nock":"^13.2.1","typescript":"^4.6.4"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"fc10bcc41f4802957e122567ce5aa025ced56d3f","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authentication request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst createAuthenticationResponse = await agent.getSiopAuthenticationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authentication request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationRequestDetailsResponse = await agent.getSiopAuthenticationRequestDetails({\n  sessionId,\n  verifiedAuthenticationRequest: createAuthenticationResponse,\n  verifiableCredentials: [credential],\n})\n```\n\n### Verify authentication request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthenticationResponse = await agent.verifySiopAuthenticationRequestURI({\n  sessionId,\n  requestURI: createAuthenticationResponse,\n})\n```\n\n### Send authentication response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationResponse = await agent.sendSiopAuthenticationResponse({\n  sessionId,\n  verifiedAuthenticationRequest: verifiedAuthenticationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.8.1-next.117","_nodeVersion":"16.17.1","_npmVersion":"lerna/4.0.0/node@v16.17.1+x64 (linux)","dist":{"integrity":"sha512-hYUMOo++J7LzbnFdCQ0fFz6vLSB7SNp4yxbcVGqVpXDwwE3X3laHjKfwVzNX92wAGrE2mmXOhWXn9Kl/lfe3Fw==","shasum":"ba348443951744856508c5bd6f14c84fd524e8e1","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.8.1-next.117.tgz","fileCount":24,"unpackedSize":102234,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCsYZY+Rn5f7HQ2lQgrGKzWSZPzhuQfgAPxiypJJRnqyQIgPw1AjU9P8HdO3mgivhJar09x5i+nzeJxL3SYslpuYGY="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjnScfACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmpu5RAAlvPU3JLuQPykrOjoSVMO9v5+yCOz31+PFK6x4cmFcv8dtqxm\r\nKjVONz4c0f9PZ5E+agXQ2IlyFYXpKVeMm4h0lJZyA4suzUZASAzAg8LJr9Gb\r\nfpCSuVfzMLpP/XIEkgLXkfuh3AlEYDxEpAVxJ2jotIqVMQI3Ld2eemvqkilX\r\nXHeFFfI8KHGNGZMZoGNcgzV412QipsMH/LBkhW+0lAzjdc2rccNePHxFjigK\r\nQ9MP3eql9uhvEYC08gvQLYeKKwLKRQ3VYA4Ft46zVlPv5zF6N/p/Y9KLuVih\r\nUEHTxUdOJYo6ZykQUuzvOHtVfODWLIuyT1ZvmX0UynUUZGZbtWXsiCl3A/ef\r\nV3Usx/reWpuZq37Hzb7bS7yc1die73yll1p932UaY5TUPr50yDB7TB1UPjar\r\nmJat1j87d03NzXSVu8TsUVANhxPJQpU0zs/8w76jjuCkFL1JEPiN9G+/M5Ss\r\nnICbyjUQ88w8YDx2KlEvbsUimhdTl1qqOG/7QFgOg1gU4Oue4tp9j1gj2DWa\r\nweS97kn3x3nrAy1lzOmE7Td7cn8xFxCXFfMHf8tSej0FoWsDo8CgXcQtb+Az\r\np3CQJEgw1gczaSK+5z5LMMGomqNPuJbVgVFKF2dFt3gqLd9m/ZHz3jbs9Bmk\r\nCJ1ce1RmdOhsS2kLsXFYuzv3Ev1hdpGbEwY=\r\n=TyFB\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.8.1-next.117_1671243551321_0.3376042598174849"},"_hasShrinkwrap":false},"0.8.1-next.119":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.8.1-next.119","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"0.2.14","@sphereon/pex":"1.1.4","@sphereon/ssi-sdk-core":"^0.8.1-next.119+4fd058a","@sphereon/ssi-types":"0.8.1-next.6","@veramo/core":"4.2.0","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.5.0","@veramo/cli":"4.2.0","@veramo/did-provider-key":"4.2.0","@veramo/did-resolver":"4.2.0","@veramo/utils":"4.2.0","did-resolver":"^4.0.1","nock":"^13.2.1","typescript":"^4.6.4"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"4fd058a3a06f2c56598e72749b87b6690fe1101e","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authentication request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst createAuthenticationResponse = await agent.getSiopAuthenticationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authentication request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationRequestDetailsResponse = await agent.getSiopAuthenticationRequestDetails({\n  sessionId,\n  verifiedAuthenticationRequest: createAuthenticationResponse,\n  verifiableCredentials: [credential],\n})\n```\n\n### Verify authentication request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthenticationResponse = await agent.verifySiopAuthenticationRequestURI({\n  sessionId,\n  requestURI: createAuthenticationResponse,\n})\n```\n\n### Send authentication response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationResponse = await agent.sendSiopAuthenticationResponse({\n  sessionId,\n  verifiedAuthenticationRequest: verifiedAuthenticationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.8.1-next.119","_nodeVersion":"16.19.0","_npmVersion":"lerna/4.0.0/node@v16.19.0+x64 (linux)","dist":{"integrity":"sha512-nkcv3BBGZwQe69CpTtyINnxx/y5LgfI3aGlrrePirxzPrCYXOmZFp7BVADOQgteGacKkpxiaO6CAucbNllKItg==","shasum":"ecfdc521bf828a589578eeeb71da6fc57641fed0","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.8.1-next.119.tgz","fileCount":24,"unpackedSize":102234,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDbMEQqMAZmzSaZEFZSEAs7RCjP4lpyQXLnzNUwHxvCcgIgIXNH4KoG83xo7HSpCnXdI+vtPPc71yKP/w0H3C/dTfc="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjq4ZeACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpLQw/8DtU9TSU+OajkqNxb6kky4n4n/JkvSntPVP4p/THWIGsvpRUO\r\n8E15mQHfddTIxkJ//i+lST7FQtyJ3dOadGloH5O00/gDrY1fyA4Aqg43IW9n\r\npwtFdX11gxtxemSXmgAmEQfg48tEBhs4efJQTXBaChpIAmT9z+ihu+wRqs31\r\nx6X+SMtybpXrJdOLKBzX37UGjIVK/CZdvWEZJf4WgXMc9qkyU+y+e1kTgQsK\r\n5Biz0+i90Z0t6euW4kMitKooipz/L1wGFHRH4T4v2baoyPltFJ+1g/KGHmsi\r\nYiw0YPvmcAVU0D4JIG0QO4EXL/a2XR5mGz5ZhZhAIuszrMRwX5ScNDt1/JkS\r\njg20soiiX0njKT75NxJiONrsx1FbghF33u6XdfAMUE3k1yROCgt5xoljrSx3\r\ncq1bFq5hbl8xw+NXkJ5tj0uBezf/FM7wTgAUKTy2lJkpcMy8Q4xt2x1zLMFv\r\nU6zsa2ztn+T6/nzANAHRKM8IPLlTbNn+AfRX+QFzLb8hhrBWQt5JH8BAeiLY\r\nW/rxM8/hqDFtmUJ3fMSKdTqDybBcSE++TgGYF8UaJ+UrtzTKIbd47vIEiQmn\r\neXUJewZPjsFfnD/v3BOmytXVkQvWcMfcq7RlCEz0wnlKgYrdaPsJwjdroJl1\r\nKmw0MY8GwNMP0kwsv2fUc2bUKiAxGP4DGy0=\r\n=/dmq\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.8.1-next.119_1672185438493_0.9968872743800661"},"_hasShrinkwrap":false},"0.8.1-unstable.135":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.8.1-unstable.135","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthorizer":"./src/types/IDidAuthSiopOpAuthorizer.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"0.3.0-unstable.1","@sphereon/pex":"1.1.4","@sphereon/ssi-sdk-core":"^0.8.1-unstable.135+680e974","@sphereon/ssi-types":"^0.8.1-unstable.135+680e974","@veramo/core":"4.2.0","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.5.0","@veramo/cli":"4.2.0","@veramo/did-provider-key":"4.2.0","@veramo/did-resolver":"4.2.0","@veramo/utils":"4.2.0","did-resolver":"^4.0.1","nock":"^13.2.1","typescript":"^4.6.4"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"680e97483a66a78848f98f4c54b707a24a20a155","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authorizeWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authorizeWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthorizer & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthorizer(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authorize with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authorizationResponse = await agent.authorizeWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authorizationResponse = await agent.authorizeWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authorization request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst authorizationRequest = await agent.getSiopAuthorizationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authorization request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationRequestDetailsResponse = await agent.getSiopAuthorizationRequestDetails({\n  sessionId,\n  verifiedAuthorizationRequest: createAuthorizationResponse,\n  verifiableCredentials: [credential],\n})\n```\n\n### Verify authorization request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthorizationResponse = await agent.verifySiopAuthorizationRequestURI({\n  sessionId,\n  requestURI: createAuthorizationResponse,\n})\n```\n\n### Send authorization response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationResponse = await agent.sendSiopAuthorizationResponse({\n  sessionId,\n  verifiedAuthorizationRequest: verifiedAuthorizationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.8.1-unstable.135","_nodeVersion":"16.19.0","_npmVersion":"lerna/4.0.0/node@v16.19.0+x64 (linux)","dist":{"integrity":"sha512-e42VSCKtdThYCv/j9o6J2JSvsV4ugN5MzV4Fgm/ANuuoYaeNQEJYK5GggN1EVSANQYGJtK1irNfHxc0zID46AA==","shasum":"b987b4d3333192e49ee1355624010ab54ee8f6af","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.8.1-unstable.135.tgz","fileCount":24,"unpackedSize":101458,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGdE34LvytO271kUqVHxGcwNw7uxcVO+qY5X0QicCMf/AiEA5d57tmVMGNpcCqFu/cHoEfr5vHb+CGrrPtqAQPSiAPk="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjtEpnACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp9zhAAm+h7O7+R9oQ9Wrb8r0KGJYItGtlNk/O0eyHEQnWBDE2fonD0\r\nfSOtWfxI+vPZXFxo+WIZHx2eJqLR2ZbSn0C7IVptTmvB86QA3FPBCjhTA9bO\r\nVvag9wCBF4nCG6B71Gaiqb8FYb4U3FdHfsIx8R1EMhh2fuoGEI3spw+wcKJ6\r\nHuRTk1LFBuwNrMJa1gLqD4fjeRkbI0Cy9RWZsqsq+2OD0gBMhnmdRwuaaO/P\r\nAR1Xv1IyHgdzpo1xs30jqazeFh13dPCTqPi174GhTS7nxWtdigY6q9bl+ioN\r\nKp5lX1mEpbudNmvKqtrx8D87QSUGatbU1/WoBs83AA1I4mxMs5SXap8aqaKw\r\ngGZ4wK0r6A9jEUlUEUaRPfk1KoN281mpyKKSolh0fNOXNZUFDO5iEu7Xc23l\r\n0bZmRV6iQQPjMp/6g2DcksBCHnRZ+GDs4DBXl9mVtgr/jhbAxqtxAX/lJ2VG\r\nqBqXgpIQ9bYsyDpTZciUQZfpqXJ19qfLaqHkaLuTgLDlhhJMXozEcJ9WETPD\r\n5OlxVfaYXhNhxfcafse85Eg1nqtXg2sJ81DeMjyifeaNHx8MRMJGgQ7rJiad\r\n7pexhINwGw9VIJvUOweRBTesQng8TWwEzGdkbOdeUKEMiXcQkBP6nt92vZK0\r\nsB3i2+np/Jv+0853ad3wIin7nVVMF4JOI1w=\r\n=auUy\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.8.1-unstable.135_1672759910992_0.5212156687565199"},"_hasShrinkwrap":false},"0.8.1-next.120":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.8.1-next.120","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"0.2.14","@sphereon/pex":"1.1.4","@sphereon/ssi-sdk-core":"^0.8.1-next.120+43a3adf","@sphereon/ssi-types":"0.8.1-next.6","@veramo/core":"4.2.0","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.5.0","@veramo/cli":"4.2.0","@veramo/did-provider-key":"4.2.0","@veramo/did-resolver":"4.2.0","@veramo/utils":"4.2.0","did-resolver":"^4.0.1","nock":"^13.2.1","typescript":"^4.6.4"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"43a3adfbe683ee4040a293cc5b75d17a029d7c49","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authentication request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst createAuthenticationResponse = await agent.getSiopAuthenticationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authentication request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationRequestDetailsResponse = await agent.getSiopAuthenticationRequestDetails({\n  sessionId,\n  verifiedAuthenticationRequest: createAuthenticationResponse,\n  verifiableCredentials: [credential],\n})\n```\n\n### Verify authentication request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthenticationResponse = await agent.verifySiopAuthenticationRequestURI({\n  sessionId,\n  requestURI: createAuthenticationResponse,\n})\n```\n\n### Send authentication response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationResponse = await agent.sendSiopAuthenticationResponse({\n  sessionId,\n  verifiedAuthenticationRequest: verifiedAuthenticationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.8.1-next.120","_nodeVersion":"16.19.0","_npmVersion":"lerna/4.0.0/node@v16.19.0+x64 (linux)","dist":{"integrity":"sha512-dAwX9yN+fRedlrKhZZsMIh8blHKh0RszksLBuSptn9n8dCTBbYeY2HDZtfUab0RF5BdtdiF/QnppGSQu4fLoaw==","shasum":"8a71b03231d28b89070038885a9338f5f6f0f447","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.8.1-next.120.tgz","fileCount":24,"unpackedSize":102234,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCN4YjJfa7hS/k7ndSjD7jwVqRM8hTX6BkUi7w/JrjybgIhAIkQtJxlVLlDZ0sCQ5y7aWrIl3/JsceR13oFdrrsmGli"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjvL1WACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqyAA//eyTteF6ta8kDrG+ze8QGZguLVZmLNMQITKZqJu7iWozgUOBE\r\n1waMPptGGDD50LYYca4US/xWZMaMjPxWF7VOeY71RcCfIMVE3+2Cuo0BlJuQ\r\ngD28JdfZcA6LgpFE0aWvOAsWduN4Ii9IbeQ0FFpC2N0a7NXWXRu0o02Xuh9O\r\nWUWb13ItkUtEW230saM5dhFhMAhU5Iwd8mcffoNDbRaV50B7/u/IX+wfirBg\r\nAaEEA2IBCI+fHYDVYGeNYBcr8PbCLx0FTxfFfha10pJn145As6ywe8aw3iMT\r\nZfRY+GHNP+HkflJTSfA6P4yMmlyOAMCRzT/dpvij/AvWU7oh1XlhjrjQd1Xa\r\naGE5oGX3wncNDmj1YZLPe5DLJMGU9aOSw59X5XqT2vUkLAkABmWAJkMocgV/\r\n2H2Xgqyten7OOp1DFJyYQQ3Rnr/R9bofmweCNUNbRb72Bf+ey0xfhL2gH0x9\r\nlkZnaSVjDsWyPDQvSlx1gMRYwmg6gJOUcAhiFy3VI+mWFqgEyK3p6vOnozYx\r\nmNToaZtZJpuBfxl4bOF7jOGPqap26hEO7vg7GxW0TJEyAQraZcw/IGpk1pn2\r\nxwnPdBRUa3kpxhedku5pgmp11xqmV8xU3OiA1gg35OjvoOuyoYd6+nG3d0WU\r\nvqytCqNXH9W4Aj4BhONVdblGRtTa7oDwbiw=\r\n=aRrS\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.8.1-next.120_1673313622263_0.3469483263795605"},"_hasShrinkwrap":false},"0.8.1-next.121":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.8.1-next.121","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"0.2.14","@sphereon/pex":"1.1.4","@sphereon/ssi-sdk-core":"^0.8.1-next.121+d98b358","@sphereon/ssi-types":"0.8.1-next.6","@veramo/core":"4.2.0","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.5.0","@veramo/cli":"4.2.0","@veramo/did-provider-key":"4.2.0","@veramo/did-resolver":"4.2.0","@veramo/utils":"4.2.0","did-resolver":"^4.0.1","nock":"^13.2.1","typescript":"^4.6.4"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"d98b358ff7f9c787667b4bf48fd748ae9f58197a","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authentication request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst createAuthenticationResponse = await agent.getSiopAuthenticationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authentication request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationRequestDetailsResponse = await agent.getSiopAuthenticationRequestDetails({\n  sessionId,\n  verifiedAuthenticationRequest: createAuthenticationResponse,\n  verifiableCredentials: [credential],\n})\n```\n\n### Verify authentication request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthenticationResponse = await agent.verifySiopAuthenticationRequestURI({\n  sessionId,\n  requestURI: createAuthenticationResponse,\n})\n```\n\n### Send authentication response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationResponse = await agent.sendSiopAuthenticationResponse({\n  sessionId,\n  verifiedAuthenticationRequest: verifiedAuthenticationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.8.1-next.121","_nodeVersion":"16.19.0","_npmVersion":"lerna/4.0.0/node@v16.19.0+x64 (linux)","dist":{"integrity":"sha512-odBAFyqVlcB0p/OIppwqfp0qC7o0lzqJzTF4/eogrBMybe6sp0G1mV5gqXNY4ZEImJ0/47jwyr1318cEuOYRAA==","shasum":"f1dc326d9ee4392b19bd38e43e94e1533c7e67aa","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.8.1-next.121.tgz","fileCount":24,"unpackedSize":102234,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDlaR1hqY+SnWzp059xkQYpYfS9JNz1CJ6zq1vCAnJy1QIgChizvL5IFtcejBv4hquXQQ/KNg4DBUf3VT4E0HNprn4="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjvwnMACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmpwlg//bACIfwrG3tzmmdUt8nFpjLmEEFgGA4BLhUVM/z4ms+2lYu+s\r\nu0C0q6Ce97yZDaA3eHF+ewnFq8y5Ia73DqU2GNa3vQwOyu75RdruyP6wqZdm\r\nvXJ+SE+YLvrmUs9k6iAnuQ0XaVA8c1/1tTsmzQ+X2sV28IZkfNwBkcJmFAS5\r\nZNFGUHAUINOK2eKDPE7qZL4OtwGrVGQJhTYmzvsJaPDbL7hik9TIa+d+sIh3\r\nR5ZI+O0jHKeSOgxcY0bOI5sgguH4smCPWvN4TQoTQLzLzDwIExRQ2Qcd+ANq\r\nqDedsaVO34ao4AR42iKjmE6hH8FlXNTtsDrKFub5hGv3F7GbxzmIO+tHKLei\r\nICuK5Gn55eYmV+eDIdsMnSyehFKmCuRDYmyOGZzlTkkaE7Mb1V65uz5cKXLw\r\n1RrNys8wNjm6zqQnneavi530p520W/CSOf4yJYB5GVEw1fTdXQL0y877R9Gc\r\nxCTqVxJs8mKxcBThNXZSoseUlViEZEA6VBWQ7UNdDGz5n2lxZFHOx15dtUog\r\nvNuasKz5gWEt8dEJUCVdhmwRwVH3YLI9O57kLszo5hWnj+3YKKUcYD3cYEjI\r\nBqsng6OZC3O1wvxBx3sS5QNso9MT+lR9SZ37ww2NesKfuW1NOg8ZTQp92uxs\r\nIZ3M9+TsboJtW16AS8mm8S5xPqSOYVvkPEc=\r\n=34o9\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.8.1-next.121_1673464268153_0.9414489545965095"},"_hasShrinkwrap":false},"0.8.1-next.122":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.8.1-next.122","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"0.2.14","@sphereon/pex":"1.1.4","@sphereon/ssi-sdk-core":"^0.8.1-next.122+26cff51","@sphereon/ssi-types":"0.8.1-next.6","@veramo/core":"4.2.0","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.5.0","@veramo/cli":"4.2.0","@veramo/did-provider-key":"4.2.0","@veramo/did-resolver":"4.2.0","@veramo/utils":"4.2.0","did-resolver":"^4.0.1","nock":"^13.2.1","typescript":"^4.6.4"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"26cff511b345e412dc37586ef3c3c8fe678cd574","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authentication request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst createAuthenticationResponse = await agent.getSiopAuthenticationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authentication request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationRequestDetailsResponse = await agent.getSiopAuthenticationRequestDetails({\n  sessionId,\n  verifiedAuthenticationRequest: createAuthenticationResponse,\n  verifiableCredentials: [credential],\n})\n```\n\n### Verify authentication request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthenticationResponse = await agent.verifySiopAuthenticationRequestURI({\n  sessionId,\n  requestURI: createAuthenticationResponse,\n})\n```\n\n### Send authentication response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationResponse = await agent.sendSiopAuthenticationResponse({\n  sessionId,\n  verifiedAuthenticationRequest: verifiedAuthenticationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.8.1-next.122","_nodeVersion":"16.19.0","_npmVersion":"lerna/4.0.0/node@v16.19.0+x64 (linux)","dist":{"integrity":"sha512-ju60FtlJGvYonijwX+HssaqTdsS6+BxDiA8qKjjfY3zJmqbScawwRNJQB0gYZ0SCupOs6vqGe3o0dXYmQ1UnbA==","shasum":"c3a40463f903bf9c0acb735494ad24c0bcca3143","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.8.1-next.122.tgz","fileCount":24,"unpackedSize":102234,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCHPZ52ISH6ox1x9euzVVCCtdoIdVeTTqTIjXtdAJLL9AIhAJ1CxDtHQN0Z+gUVnG04Nc9xyXpRDlGQWEgRS5WjYM3W"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjvx1UACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpIpA/+LVuECRondLOUhq46mDvjb8fWRKHyS2bGm3jB1WPBTVsgHYHR\r\nvuSViQv4K5/E/C48PWTtID0ZN4OIFOFaJepsFOO7+IhItlggNfD6klFHJAPN\r\nAJnuNVQnVunYvIK0/JcuJ2ykWUWqcHNeGtyG03eMd1H5YB0c3e8fyLfzUB7D\r\nDC8Os4g3l0bZrGGnHs8w95FqExJgo4EL+HzaMOkvTidjUPuzfWwbC7Ouewfz\r\nM+R5VEj0BrpPj+eie4JxDjY8YSWkFz+DFHosiSwxNffArYNQaa2kwukhg/PE\r\nFTuFdyjDouo/ZxDOo/19lJt35HGNt6sMw0j4PBAuXLkCJLmLFV1OufOg9piD\r\nHCQJleMMEqLYM2HLthlOxy2ccBmUvqSFbNJ1PdWjmX/9+11c1hFp7x4mQC1z\r\nUH2kife7ISOg62kFy/cbyRQHsVDaauR2IL2+TIMZl/W5yeNiYrt+s13wvv4o\r\nCSextJfa6s1SZDQM36ec54eNHxwB9NkyTL2pkTA5/8PdWXFbVm+3GeCsJ1ei\r\n0GWyGclVpGAzsUlxlTrjjXcNyATgt+YKVPGNWGu2XDupofeTjXrFUJwHNjiF\r\nSdJqlzv+o0aT5dfIsSEkDPiuLw+mykVhqHD8oqkEdRncLtYj4GunIj3osm/V\r\npdLeylQjzk7qRDx0+kXJaBCDe3IbWvEMCaU=\r\n=IsRy\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.8.1-next.122_1673469268157_0.45231878918709323"},"_hasShrinkwrap":false},"0.8.1-next.123":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.8.1-next.123","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"0.2.14","@sphereon/pex":"1.1.4","@sphereon/ssi-sdk-core":"^0.8.1-next.123+0204094","@sphereon/ssi-types":"0.8.1-next.6","@veramo/core":"4.2.0","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.5.0","@veramo/cli":"4.2.0","@veramo/did-provider-key":"4.2.0","@veramo/did-resolver":"4.2.0","@veramo/utils":"4.2.0","did-resolver":"^4.0.1","nock":"^13.2.1","typescript":"^4.6.4"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"0204094e7b7fd33314a31df5d06344f54e6f6442","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthenticationRequestFromRP\n- getSiopAuthenticationRequestDetails\n- verifySiopAuthenticationRequestURI\n- sendSiopAuthenticationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthenticationRequest: VerifiedAuthenticationRequestWithJWT) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authentication request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst createAuthenticationResponse = await agent.getSiopAuthenticationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authentication request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationRequestDetailsResponse = await agent.getSiopAuthenticationRequestDetails({\n  sessionId,\n  verifiedAuthenticationRequest: createAuthenticationResponse,\n  verifiableCredentials: [credential],\n})\n```\n\n### Verify authentication request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthenticationResponse = await agent.verifySiopAuthenticationRequestURI({\n  sessionId,\n  requestURI: createAuthenticationResponse,\n})\n```\n\n### Send authentication response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authenticationResponse = await agent.sendSiopAuthenticationResponse({\n  sessionId,\n  verifiedAuthenticationRequest: verifiedAuthenticationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.8.1-next.123","_nodeVersion":"16.19.0","_npmVersion":"lerna/4.0.0/node@v16.19.0+x64 (linux)","dist":{"integrity":"sha512-JErsqZu5zrNdS/X3VKu3vyp5V79v7nAEWhfPH2SUIeVkXqoWOkVz+9KjYb3f0GdZAiyP8ukjsPciTd28mxb+dQ==","shasum":"924997a18c1ed1af078b18c9eab30115b98b9d25","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.8.1-next.123.tgz","fileCount":24,"unpackedSize":102234,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCrdhStZoDMxl065t7owXyucgKERl/pu9aYEChbBmNfBQIgPqQRKesFXQGyc4+xV5NJJDjFmHMGSRNFyA/FcdQaJ90="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjvyzLACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmruig//c1jH+4viJm1G8GsIGP4W/09D/MBTjZ1IaygAeGs3n3VeE6t8\r\nDDmc9mtOwL+TK6tWE8ufoe1rA2vlJzdG8fgOz4M8HT55KGHS0n9vnFlYTgCG\r\nhh09Rj9LxkbXSnzIUdhr5ul/gODPNQ9XpDB6Wuf2eZ6bREQbB+nmdzCuDvzt\r\njzRUDmljMoM7Tj5sOIY/HC8HZiic2sH1uoi29MnkDeXh6+oaNCl5X3sLcJqo\r\nVGBYRfXphT2Xm7j/J7PBpqN/9coTiBInalZjA7YOzkg/Kc70kyrT8fwEpeFj\r\nZtkpB2Vm40fh042U15mx5h2EqNiuioBZUYUeNppUk763IZREySm5fah/zGOv\r\nXqTN5cYO/lLSXPFM0vp2wjwnKPgpEvvatbUBEScEt9tsc0YB14Ns3vJamcfo\r\ncaFig6pWs6iP0JF2Hp4bRkrLjh1+ICkg4l1PfHfw0RKsMZtgnbOhJJcdpg2T\r\naKk08F32QN9P41ro51jIJ6t3ZkOMpLen+DViY2YOnOWAloP6hgIfPnLYU7IK\r\nqzOGGS2oGzwBELKdJzSzjyRjVHqFEn+nv5SmaynHNkNyzpQSM8hl3Jp7usR2\r\no8Va+vYa9K0qysSyRArgb7/hy60dU/QQ4HqeNe9Gv39WZTvtr36vo1bf7e3y\r\nTLEas8Z+UMknM8QfFP3L/NY3UEjzMaFa0x0=\r\n=dEeO\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.8.1-next.123_1673473227449_0.6223621079721511"},"_hasShrinkwrap":false},"0.8.1-unstable.145":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.8.1-unstable.145","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"^0.3.0-unstable.2","@sphereon/pex":"1.1.5","@sphereon/ssi-sdk-core":"^0.8.1-unstable.145+17a1229","@sphereon/ssi-types":"^0.8.1-unstable.145+17a1229","@veramo/core":"4.2.0","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.5.0","@veramo/cli":"4.2.0","@veramo/did-provider-key":"4.2.0","@veramo/did-resolver":"4.2.0","@veramo/utils":"4.2.0","did-resolver":"^4.0.1","nock":"^13.2.1","typescript":"^4.6.4"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"17a12299ebced331f45a5c7cf53a5bebcbef1280","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authorization request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst authorizationRequest = await agent.getSiopAuthorizationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authorization request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationRequestDetailsResponse = await agent.getSiopAuthorizationRequestDetails({\n  sessionId,\n  verifiedAuthorizationRequest: createAuthorizationResponse,\n  verifiableCredentials: [credential],\n})\n```\n\n### Verify authorization request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthorizationResponse = await agent.verifySiopAuthorizationRequestURI({\n  sessionId,\n  requestURI: createAuthorizationResponse,\n})\n```\n\n### Send authorization response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationResponse = await agent.sendSiopAuthorizationResponse({\n  sessionId,\n  verifiedAuthorizationRequest: verifiedAuthorizationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.8.1-unstable.145","_nodeVersion":"16.19.0","_npmVersion":"lerna/4.0.0/node@v16.19.0+x64 (linux)","dist":{"integrity":"sha512-Tgbjzgzi1ZMeQxSYbz6++JIiMlnahflJFOFHqQ5Q991BgyG53IsAXcadE7ll7PF2A7Z46rbPx8UbdXMDmCfD8g==","shasum":"cc8a0f5c9157958d2ee343b9cf00798d42807531","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.8.1-unstable.145.tgz","fileCount":24,"unpackedSize":101868,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCrKiTkSLINX4fabkRzF7IIJJdtDY3PIQHw5h/quNMzzQIgbZncpbbTikh8jcNxakAyrI4uA/9bDGEX1JBxBkuufsQ="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjv162ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpPURAAktbvgsj5syrci65+L+h8+2x0tJXK1OHSYDdS8Ah/6PCGehnQ\r\nbpxnFy0lLlYip/pXw0fFD0yY0DzNp9f0f71OyzlzIo51LecMPsDsTR8pRW8E\r\nb7rSyicm8EDtiD5X8sqeFtcQiOwimjIbG790kqHqc6tNUHNfLJHPn5z1SgUR\r\n3Hd9Qmh0vmIbt/vEVlekDL9i9f1ZzBVfQ2mJ46DA1RBsn9iDwKaSezCjAetH\r\nNsHP0qQEuEEcIWiqaP0GNLaSG6dZ4S8V0HfCTs1ATzh0D7WwVEilyhAdhkPx\r\nnOcu7pQdeoMlq+88ks2M4ax7V8W0H5wiO2GMLBEaWKULosBKLAjXeIYk4WYE\r\nX+kxf3ezsE0Yf8V53KZOGdNrDbCn2wxz8XjWYBdWzOfukbMagG+831C+x341\r\nuG2CoNY79ZRYUPDS86V9HsKBgPaQ6aeRR6isBOetwHxttqc+elukRMBad35E\r\n1TY2336Db+oEDhcijg7YyYqBlGzuJTESYA0dfwtRJxe+kAOh53HTAxeevHTa\r\nzXOBD7rBQznYstWVxdRo1L1UdRChnMiPklIknrMkhnYkCAkeJK2aWZ+t1nUS\r\nAt4tEOyh9vz9bALv/Zz6+9RpZTjCq6rTy++JyUpYmwLUZTc+MggPixf1A4cD\r\nT04cD8uXNrHXInhm59zPCQa/YenCvB4S/MY=\r\n=2ijs\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.8.1-unstable.145_1673486006601_0.8580282929489178"},"_hasShrinkwrap":false},"0.8.1-next.146":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.8.1-next.146","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"^0.3.0-unstable.2","@sphereon/pex":"1.1.5","@sphereon/ssi-sdk-core":"^0.8.1-next.146+3081280","@sphereon/ssi-types":"^0.8.1-next.146+3081280","@veramo/core":"4.2.0","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.5.0","@veramo/cli":"4.2.0","@veramo/did-provider-key":"4.2.0","@veramo/did-resolver":"4.2.0","@veramo/utils":"4.2.0","did-resolver":"^4.0.1","nock":"^13.2.1","typescript":"^4.6.4"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"308128069e9233df39a3492f74c27277e67bd557","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authorization request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst authorizationRequest = await agent.getSiopAuthorizationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authorization request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationRequestDetailsResponse = await agent.getSiopAuthorizationRequestDetails({\n  sessionId,\n  verifiedAuthorizationRequest: createAuthorizationResponse,\n  verifiableCredentials: [credential],\n})\n```\n\n### Verify authorization request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthorizationResponse = await agent.verifySiopAuthorizationRequestURI({\n  sessionId,\n  requestURI: createAuthorizationResponse,\n})\n```\n\n### Send authorization response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationResponse = await agent.sendSiopAuthorizationResponse({\n  sessionId,\n  verifiedAuthorizationRequest: verifiedAuthorizationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.8.1-next.146","_nodeVersion":"16.19.0","_npmVersion":"lerna/4.0.0/node@v16.19.0+x64 (linux)","dist":{"integrity":"sha512-12yf3cmgwMigRtEncm+bQsQhJAGGKU9C/OvzBHu9CQs71PYpVE+LrgWLzZssrOIn+u4KTt+GCzw4bCsRq/F4ug==","shasum":"b0b5fe41a49d05c5b532ee5dbe8e8225e5013445","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.8.1-next.146.tgz","fileCount":24,"unpackedSize":101856,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHwjIXRtXTIwmzqdt2N7si4982WIxXAp/Fujw1NeLd8yAiEAn+5trC7b2YtxbG9awP4Nx3N+i/VXn1SGvI5T9n17KSU="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjv2ElACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo4Ig/+Lj+7Gi3kxkJaVR7Fuhbzf/kwVd6LbW0dbVB9uVEITtufbEBo\r\nk8IODifRqsFzePtoF4LNMtrHTmE0zGgCPl8YSXQo6+G+irjazTB/Ti3CU5cS\r\nex7Zdfg2OYduy3jy/0S1oTAHWF4BMBHDDYMqophmMCdZFuhYAsoygkOZs8kQ\r\nsnf0eFDVNKvcNfedeTvN1WXYGQAPxx9nYAQcnL4za7sSe6rb8nXaoGXN3QMl\r\nmBtpXydx/qyXNC7QFLwohEspKWocBt14xM8FLNR66gCKiX9FdxuZ1OhzIsAC\r\nXIixHO1yWjtwYNYtye8msvUyLuROaWAuU0qCtZZg/aZpR+eNBCpM7QsIRiwZ\r\ncVRybvqCKKDCuYw/ccy0BL50pE9j6KwaeqjdpzAg2SGSlbWQV5gHxZfN44m+\r\nXMnzuUJH0cK0lYn6j8H/x87c1SGy3q+OvS7QGyi4Ruc6dZhUwNGEdz/SaUYO\r\ntp+zO47JwVr+1d69VDK4kIbM//oaUFQnmpo7j4VAieu52oBVvdGbBNbXqhDT\r\nrx36MxvCdGq75HStEJADCp/kVmjYRFe3e4B/DNtSnZla9Kk+UHGFH/PgCbVd\r\n1e8cn6Hj4Q6i33ivtdOwECSPFLu1TEXGjFSyukJz/IdgNDxGVzKPBUvfAb35\r\nmBFrt6kwHZ6cnY8UzjHoDe1muQsprnRjGbA=\r\n=oPAC\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.8.1-next.146_1673486628917_0.6601369020411871"},"_hasShrinkwrap":false},"0.8.1-next.154":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.8.1-next.154","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"^0.3.0-unstable.2","@sphereon/pex":"1.1.5","@sphereon/ssi-sdk-core":"^0.8.1-next.154+a0bd467","@sphereon/ssi-types":"^0.8.1-next.154+a0bd467","@veramo/core":"4.2.0","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.5.0","@veramo/cli":"4.2.0","@veramo/did-provider-key":"4.2.0","@veramo/did-resolver":"4.2.0","@veramo/utils":"4.2.0","did-resolver":"^4.0.1","nock":"^13.2.1","typescript":"^4.6.4"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"a0bd4676a62920e8f92ee980213b187677ad5aaa","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authorization request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst authorizationRequest = await agent.getSiopAuthorizationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authorization request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationRequestDetailsResponse = await agent.getSiopAuthorizationRequestDetails({\n  sessionId,\n  verifiedAuthorizationRequest: createAuthorizationResponse\n})\n```\n\n### Verify authorization request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthorizationResponse = await agent.verifySiopAuthorizationRequestURI({\n  sessionId,\n  requestURI: createAuthorizationResponse,\n})\n```\n\n### Send authorization response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationResponse = await agent.sendSiopAuthorizationResponse({\n  sessionId,\n  verifiedAuthorizationRequest: verifiedAuthorizationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.8.1-next.154","_nodeVersion":"16.19.0","_npmVersion":"lerna/4.0.0/node@v16.19.0+x64 (linux)","dist":{"integrity":"sha512-kUoBJr/029qpvfhqTyr8RbEefWIzIqDJ61pl6w2qkO7WWmOKG/+ewHCMWdvRR2qIXpUnQGorlD+O93T2kRGOLg==","shasum":"d6a60ed5d9e3adfb85eaa9249e3469b228d684b1","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.8.1-next.154.tgz","fileCount":24,"unpackedSize":102666,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDBvbp5lP3Z2gyLhKlzzgbOPDDS8FcG3qGpfeuawAahFwIhAOlGPP/WHWEw5AA48hwyRfjrO953l5+ftZXPnmri+O2K"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjwAb3ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq/tQ//T6ExjD19YZYdB4Ypd5c98tElO8T7mv5juvi1nL4d1ogMlJtC\r\nIvp07c5Qoq+t0YrprQr47amTbYlMyDWkN6bm+fO4+GO02KbQ2ChDFupoMf80\r\nEKRvtqJqaY3FW7KpVhmjhehr4nygS24dtrg0fGni8Nal8UnFB3OIrRFcXBj3\r\nHvwi6f5rgsKCvsxVD0/szlWx5SHEquNwdPRJwtyvob/OygfxWNVBXUSttH7W\r\nF0mG+1Pyq1GgkeyOg4LjM7RIgMhNk94c5gRz8gCfAzLXYQe6BPRvDXvOpDIQ\r\nkzkACs6ZoV/m9JuzfstEC2oLnTTO9a76x97NO3CyPRoaN52RKHQgvft5PgWt\r\nRl9bxHkZpSDVjy5OXZAUNWsAjMdvw2bJPSj3qMb+2+hi0vKD0Dco9y49xMXH\r\nEAZrbl5y3MhRsT6Kz5EvjxF3OMWYCyXmtnjHV2PwfJO5I7Dgppg21m+Gb/Ff\r\ndJ+7kKFc9TD24pqdYG76RWrQLQ3X3oGnIdnKLHTlYrb8knWx4YXGIErqDp1Q\r\nP86UtzFc2lDnXZzi0wanOqavi0G+XmkHwiOdpDZ1AZeYHZvjVcy9gvn1Mt8e\r\nYLeqx0WH0nlorMt8FMdv/zDG+e8aJUTvitC4l8++lU41PBnTVJlDZdP+Zou4\r\nFbX7xpNbTUknZlKXOS8NPFR2ICU6CyQIe5Y=\r\n=reBp\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.8.1-next.154_1673529079186_0.5348156667248802"},"_hasShrinkwrap":false},"0.8.1-next.156":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.8.1-next.156","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"^0.3.0-unstable.2","@sphereon/pex":"1.1.5","@sphereon/ssi-sdk-core":"^0.8.1-next.156+5e5328b","@sphereon/ssi-types":"^0.8.1-next.156+5e5328b","@veramo/core":"4.2.0","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.5.0","@veramo/cli":"4.2.0","@veramo/did-provider-key":"4.2.0","@veramo/did-resolver":"4.2.0","@veramo/utils":"4.2.0","did-resolver":"^4.0.1","nock":"^13.2.1","typescript":"^4.6.4"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"5e5328b9f2429c4dbbfb4402cbecfe5f114e0550","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authorization request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst authorizationRequest = await agent.getSiopAuthorizationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authorization request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationRequestDetailsResponse = await agent.getSiopAuthorizationRequestDetails({\n  sessionId,\n  verifiedAuthorizationRequest: createAuthorizationResponse\n})\n```\n\n### Verify authorization request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthorizationResponse = await agent.verifySiopAuthorizationRequestURI({\n  sessionId,\n  requestURI: createAuthorizationResponse,\n})\n```\n\n### Send authorization response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationResponse = await agent.sendSiopAuthorizationResponse({\n  sessionId,\n  verifiedAuthorizationRequest: verifiedAuthorizationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.8.1-next.156","_nodeVersion":"16.19.0","_npmVersion":"lerna/4.0.0/node@v16.19.0+x64 (linux)","dist":{"integrity":"sha512-K3ZNg87WxUxUIypjTuZ11hZDbUiKFXlvTpWeK4GpCVViVgnlvI8CxBmLBz6MtHiY9RpiIJnRrQFjhduLnNpYeQ==","shasum":"149118df26ff253c699713ec261f76034ba4e677","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.8.1-next.156.tgz","fileCount":24,"unpackedSize":102666,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDWjTGgFbl5JTkF4gDa9aGq19HtikNCOhzW99y31dFNfwIhAJvnS4ex8drNewZnfjxWt5LhKEYpGU2FhCz8HUYXUhys"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjwKlIACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrBrA/+Ok3Vjrgf921JuvIxJFyeLMFfwNQovXD5i3fePiR4+c7Zgwtu\r\n0IypuoabKyI4ZoPSr2qMJU/Y9PvSY39wMNp4BkY2Ju+85mebth3MQ+cIcDXo\r\n9vy3jB6HDyD7HL17zuNAwQHGNiEK8S/7tE7PDdc/vVecq+QPIsiAwFqjWICP\r\nD9sU6eLO9drng6MTUgJbpqvXpjiH092tzTijtzuk4YhkqEAFd2emTbvh4iwY\r\nbX9U3tj0nEPlgear5xjZZeXO9/zxNic3lpkPbnR77Bceijqd9m2dGZUL9knz\r\nu+lxM2Eo10b4anX4OE+IQFBvGFY6kxlrvsHHF975t6qy1MO739SSKnnkFjDy\r\n49TYSE83f5ccs8mt2GJf94LcSqrjv2wype7Qvm05gJOauQOL92iPmqJgwvCg\r\nwrejU+9hhYmb7fiK9gpeoi8xyMIta9YvvSHUbCZVP+zwk02hqQ9LFGP6dcHJ\r\nTwgWrlwiqoSLo/pG0XkcBfAD09rmklOWZ3p8bR2rcRHYQVIDGL1nquvbJDfx\r\nJH2Ty18keryJYt+xCC0Hzf6wakWVRZn3o38Se2alIAOT44UDFej0hBCTbPol\r\nOZyQz97c/vWPJgy+Yd5kbHp2JUxBZRo0H3Sk/oTyrXtF1ZX7Kow6VM/xbSw4\r\nzbE6bBcsDUSDeXuFh4iol/Jhx9iH7BnggpA=\r\n=kKzg\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.8.1-next.156_1673570632140_0.9571559919910764"},"_hasShrinkwrap":false},"0.8.1-next.157":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.8.1-next.157","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"^0.3.0-unstable.2","@sphereon/pex":"1.1.5","@sphereon/ssi-sdk-core":"^0.8.1-next.157+b010d7a","@sphereon/ssi-types":"^0.8.1-next.157+b010d7a","@veramo/core":"4.2.0","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.5.0","@veramo/cli":"4.2.0","@veramo/did-provider-key":"4.2.0","@veramo/did-resolver":"4.2.0","@veramo/utils":"4.2.0","did-resolver":"^4.0.1","nock":"^13.2.1","typescript":"^4.6.4"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"b010d7ac65ba49d4e85641558ce801e1c3fea730","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authorization request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst authorizationRequest = await agent.getSiopAuthorizationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authorization request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationRequestDetailsResponse = await agent.getSiopAuthorizationRequestDetails({\n  sessionId,\n  verifiedAuthorizationRequest: createAuthorizationResponse\n})\n```\n\n### Verify authorization request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthorizationResponse = await agent.verifySiopAuthorizationRequestURI({\n  sessionId,\n  requestURI: createAuthorizationResponse,\n})\n```\n\n### Send authorization response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationResponse = await agent.sendSiopAuthorizationResponse({\n  sessionId,\n  verifiedAuthorizationRequest: verifiedAuthorizationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.8.1-next.157","_nodeVersion":"16.19.0","_npmVersion":"lerna/4.0.0/node@v16.19.0+x64 (linux)","dist":{"integrity":"sha512-tMoVJ+wOd4qjfEt92X0ue31mpz2HDh8LRv3xVo/BEbBTbLOxM+U3kKJFa8MmH2sZxgahaiYCvS//6tsYu3dVmw==","shasum":"bc812bf684eb31103f00721300b2d40f33bbfd22","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.8.1-next.157.tgz","fileCount":24,"unpackedSize":102666,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC0XddPxvF9R2srHg0Zxs6ki2UZJizCj99kpmaHtDtI2QIhAIiviEtamcP6pdjYNCNoldcPEY2jCDBkLiLcoQ0Mn4WO"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjwLbzACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoYpw//YWsp1JOh1fJ28uiCWFlJt1/ag+Z84ZmGYZv484Y7FfN77iwo\r\nbD8oWEy9UJJoT4yj9aOWAlLdM5El0UfdA5P+vVpwCaT0RHwrWof0RMcPN+ip\r\nOMhLj81gZA2af441E3jVTVp+pHmktKqsBAbjxF8K+kCAlChF3/h8npWMyhgG\r\nB6G2BISWzb6T5OFFV7zlb1SNx1QhTF86ezPoF111+Uhz8lN8wcRaCT63/xyY\r\nEEZvkc+izs6vFjtP9AX4HkMKZh/BcGQZGmoFA/BJ4dDft+C9HNIoNpWW3vyC\r\nQbbFdcfGj7GestufO6YbJfack9py28hLv3Z/Ek3zXQ0xRzvycQHC6apj4Y2r\r\navlUp6FwyaW0kW6p0GSGckrjujHQRD+KYfgTbtqQOBxGCW4XSB7iT8Cm6G/Q\r\nNvsxz7uvhWEG+sSprOZ471ADxUAI0FpobLWrjHKj5kbEIRHAJKz4dT7O2CwK\r\nX66wo8AOvrNgXE0N9qgVzbT86hBO7j7GS4SZ0BadAlEDhkieidqKDAUQHS6q\r\n4w1505GsfRlN4d9S+JIQHITWb+uTMCXsDCtstzWePQOHA2DQiuQ55dFQQiop\r\n+BcUssqxZjfYaJQAop2iLl2nVgtuuHpbk5iXGSUeBJ3YjM+/zum83UG/4N0t\r\n6L9lUilGBRCKgWFjd4d0qdlbFs7xBJmih48=\r\n=gjXa\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.8.1-next.157_1673574131049_0.8133577480004706"},"_hasShrinkwrap":false},"0.8.1-next.158":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.8.1-next.158","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"^0.3.0-unstable.2","@sphereon/pex":"1.1.5","@sphereon/ssi-sdk-core":"^0.8.1-next.158+625ea6f","@sphereon/ssi-types":"^0.8.1-next.158+625ea6f","@veramo/core":"4.2.0","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.5.0","@veramo/cli":"4.2.0","@veramo/did-provider-key":"4.2.0","@veramo/did-resolver":"4.2.0","@veramo/utils":"4.2.0","did-resolver":"^4.0.1","nock":"^13.2.1","typescript":"^4.6.4"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"625ea6feb62a08d3ce013850c6de7da8d833bc35","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authorization request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst authorizationRequest = await agent.getSiopAuthorizationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authorization request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationRequestDetailsResponse = await agent.getSiopAuthorizationRequestDetails({\n  sessionId,\n  verifiedAuthorizationRequest: createAuthorizationResponse\n})\n```\n\n### Verify authorization request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthorizationResponse = await agent.verifySiopAuthorizationRequestURI({\n  sessionId,\n  requestURI: createAuthorizationResponse,\n})\n```\n\n### Send authorization response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationResponse = await agent.sendSiopAuthorizationResponse({\n  sessionId,\n  verifiedAuthorizationRequest: verifiedAuthorizationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.8.1-next.158","_nodeVersion":"16.19.0","_npmVersion":"lerna/4.0.0/node@v16.19.0+x64 (linux)","dist":{"integrity":"sha512-CTC9oj4Dm2yn6lVlcUHFI8k0Bfruy4bqBF4zaXtqdX79kL9/DlTAzQl2+tQFgFn+Yl4OzzJf/42xAYVp/6rMkA==","shasum":"4bc29b8bcbfe687fa360d71589904df6bda1cc29","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.8.1-next.158.tgz","fileCount":24,"unpackedSize":102666,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDbGBofDy+3iYn0NJZ2ni389W1kPSef0T8UCOZRflMlRAiEAn3ataw41si3LrnCoeYdXQuwkjm+c5Rc+NASA+zvPGf4="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjwLvnACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqDaxAAnD9izkB2XiMyI0JDupYzO60VcsSc5WNeKd0T1aVT54pf+gcM\r\ngwHTzFKDGIYCgZ1BaTsNuebiTH3aSQl57r71oeHWwRcsAt6xFNGYa9VyUWJW\r\njQMOH4bwhowNX8bgbINud35BIxrA2slBpdjzGyjB5/V6iKx7CPVb5vwJxiSA\r\njZAXBoXPenBK5v5331UIZYcKA6j6J2Fo+CmuH+izSNDhTnM5Foe3FKBMs8eN\r\ngQgM5c+K/vFvvmKKgB0IAX4YirPYt6+hpOgfRxWBd7YElXOIymzDzFc5Q9Vh\r\nV32brJ9664EPLMMv42ynJy3m/Sb4BAxBSJg1fdc9haa2iCOCZUYLRGBIxGFX\r\nsLfMw3xal3qa7b7nkY2TrwOoD0XmhBR7QegHj61f5LVUgzX6BbPgS/JfIEIG\r\nTcNZ5DUrr7XyeiOo4oPAwPQEri2r1Qk61h7d4duSpwoPkem3+m/W4PHuYR8G\r\n53mssluykYkSsKqAcLukCt1NuAuKk+ENZ4LNvT7wHijojYNGveSHGErbgwjS\r\nxEcAuF/M3bEh0Opk0aDExCpqSEedE4bLiIwI0IVlHAvx0/bZxfEiLZp7Cbl5\r\n9t8AlI4qmsXaMPdW+S1REX/pcxgIRUevuYhA9w+m2QHvDWcbXqueVRkik/A7\r\n701q8GopDppxNCCpw9RvLKm8awW2xpjynJI=\r\n=R3xB\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.8.1-next.158_1673575399537_0.3971686137485606"},"_hasShrinkwrap":false},"0.8.1-next.159":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.8.1-next.159","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"^0.3.0-unstable.2","@sphereon/pex":"1.1.5","@sphereon/ssi-sdk-core":"^0.8.1-next.159+00892e2","@sphereon/ssi-types":"^0.8.1-next.159+00892e2","@veramo/core":"4.2.0","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.5.0","@veramo/cli":"4.2.0","@veramo/did-provider-key":"4.2.0","@veramo/did-resolver":"4.2.0","@veramo/utils":"4.2.0","did-resolver":"^4.0.1","nock":"^13.2.1","typescript":"^4.6.4"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"00892e2bb7fd279e2fdc3583cd132292708f71c6","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authorization request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst authorizationRequest = await agent.getSiopAuthorizationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authorization request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationRequestDetailsResponse = await agent.getSiopAuthorizationRequestDetails({\n  sessionId,\n  verifiedAuthorizationRequest: createAuthorizationResponse\n})\n```\n\n### Verify authorization request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthorizationResponse = await agent.verifySiopAuthorizationRequestURI({\n  sessionId,\n  requestURI: createAuthorizationResponse,\n})\n```\n\n### Send authorization response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationResponse = await agent.sendSiopAuthorizationResponse({\n  sessionId,\n  verifiedAuthorizationRequest: verifiedAuthorizationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.8.1-next.159","_nodeVersion":"16.19.0","_npmVersion":"lerna/4.0.0/node@v16.19.0+x64 (linux)","dist":{"integrity":"sha512-zSPbitmyRX8IkIJ/TGmpklFFm6x1OaTH8R+9fH4YAUkPEmzJGnnT/IExwBTTe49SbfIMOQ6/p1M3gW9aFnWKdg==","shasum":"3613e78ea52340d960defe3a395958845a8dd81f","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.8.1-next.159.tgz","fileCount":24,"unpackedSize":102666,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICX4VeA/5QYVmnTVdHtQAqIouk6dhEt49f/5hg8ku0xZAiEAqCWK7Cu/FBszylfDOb0aTuWUaKWKTtECLASmL4enwLY="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjwMAZACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrEiQ/9G3feZ+1j6vkHUGeK9WlfOfV7zR1pwsFV2VdWwF+cEZvQnZpW\r\nZa2IwSrdEfgL3BPhW+zkANrp2uYw+8FlBnvG6gbEq5buULU/Js0VKt473kva\r\ne01QzsNNuOahh8b45YxpeTewrEPi4Korb+wl5xdGX4K6CUF8dwc9nRxLKBpN\r\nY560iyVdKmHT5yV0cbfj6ZCjiGHyNhIgNg9nRWvANrhpJZ13rAOGqT+QpHxq\r\n0PnmencwzL46oZ0mVphUM6RHCPCfm1zX8UHCe01Oawbt26+UIXXZpYRN2/2K\r\npIwOBOSQPG5uvAX3HMeyUWKZCYERKtrOVUh2+Qco+4oc/4d+Rg38K9rLYoA+\r\n4pJG70KDDD5jVy0km0nLamyX0nthTVPyDgIiqDDgVX792unqzmu8KxmmuN66\r\nhSEZMSqJyLo2bzEcpVaxvcIjUc4IXgFhljgmfWfv14tLJ0Q3I7QrdyghTuHT\r\n4R4nUjb1SRs+14ZkJXnpofByydm6Yl7M0GR96k6KpLZhpjsbTxaIaK3J+wBB\r\nQtK4COdPYyrhayfus9V+WvSfKiOH0dOMWbvx+dBIH6PWArke67o4fO9vDtKU\r\no8urOjEw2rCxPVbBTOfPHz2zw5lAtblL9H9lSbsqUt1U1LTJfvWmxRyqMhZ2\r\nQ15Ml7+BPEy3cNbcwjWG0dUaDPvwcAxZBDE=\r\n=+67v\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.8.1-next.159_1673576473011_0.08550289251031695"},"_hasShrinkwrap":false},"0.8.1-next.161":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.8.1-next.161","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"^0.3.0-unstable.2","@sphereon/pex":"1.1.5","@sphereon/ssi-sdk-core":"^0.8.1-next.161+bdbf4ef","@sphereon/ssi-types":"^0.8.1-next.161+bdbf4ef","@veramo/core":"4.2.0","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.5.0","@veramo/cli":"4.2.0","@veramo/did-provider-key":"4.2.0","@veramo/did-resolver":"4.2.0","@veramo/utils":"4.2.0","did-resolver":"^4.0.1","nock":"^13.2.1","typescript":"^4.6.4"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"bdbf4ef55e50a9d19d7998a5ceac7136034524ef","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authorization request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst authorizationRequest = await agent.getSiopAuthorizationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authorization request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationRequestDetailsResponse = await agent.getSiopAuthorizationRequestDetails({\n  sessionId,\n  verifiedAuthorizationRequest: createAuthorizationResponse,\n})\n```\n\n### Verify authorization request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthorizationResponse = await agent.verifySiopAuthorizationRequestURI({\n  sessionId,\n  requestURI: createAuthorizationResponse,\n})\n```\n\n### Send authorization response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationResponse = await agent.sendSiopAuthorizationResponse({\n  sessionId,\n  verifiedAuthorizationRequest: verifiedAuthorizationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.8.1-next.161","_nodeVersion":"16.19.0","_npmVersion":"lerna/4.0.0/node@v16.19.0+x64 (linux)","dist":{"integrity":"sha512-UZHQIeVh7v35D5ya1JvZjxv6Q//C6pQkrI15+2bWMyknnyLPSlyHRKze2D7gG/omGG9RBgwoa/CmoUf4TunymA==","shasum":"6d2402ba3314cf279d7f77f13f70ccfd24f56ece","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.8.1-next.161.tgz","fileCount":24,"unpackedSize":102667,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICOJX/Qd7Jpyv/zlDOUJCYpuUVxLMmYqUoLPe/+SxnSfAiAFqUrCoQXCA69ZghwauIPcrx4iUYXDR//JsPRt2LmNVQ=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjwMuiACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoIJxAAi6qCwzRntcG+2KWMVNvdOWmILjLY9SKx6cf3LdNAlPI1Xj2n\r\nr/bNV68lUy8GSpPIBvA22zI5dc7Gw2V1cwEgn9kQWGMjFxAxl/u8XFPA97R9\r\nCowAdtyQ/rCZgYn6UwJr3SFt4L8N1p0+eSeyEZ9Yj3iPlvtbdzaW8/CAuJ7e\r\ndNEp6OEaXX86SSrr53RuzjzKbL6aBHOsUdFLZw5Fak0xdGqLKLEmcxjy/NtH\r\nb/WiHwGdNiNkV6ipgVa+SLMC3mXQ4eqTgCSQeHYL9WXCRrlnNpcMw2e0dp4g\r\nIrITqAgb4mYF4/kfxSeV19o4+T5/gV5nHTVkf/1GtqN3MmscaHMCIZcsGr38\r\nEHCQsbRqLlgax+91qvoeaRpNpCTMwRfJxmUA4jmYDTCfA7DTcnn3wUvL83IK\r\ndmmojswHl3148TVnYl+j2Te/a08eM1Ve8Lzz1eTnp+/JGXExWFmkSWHD4yml\r\nyhaTcjAem+v8K3sZpSZfY0tcMzucTCoFRKwVMiFpHhG/WmA4jqWRCqrNXgi/\r\npZOuQ4cxG1HSr0X6ZeMAD8rhnEjv4ojOWd54QYVVPo9wB7obciPtb2zCymrw\r\nHcZH6zTj3El76HOcjOBjRIELACKwjkfsXV9Z938fa3TrkvCLL31guw6OnwVU\r\nHoEmLkBjezwbwqVcr6aSjHvGgBgno9YJIRA=\r\n=NsqR\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.8.1-next.161_1673579426248_0.796369884664619"},"_hasShrinkwrap":false},"0.8.1-next.162":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.8.1-next.162","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"^0.3.0-unstable.2","@sphereon/pex":"1.1.5","@sphereon/ssi-sdk-core":"^0.8.1-next.162+518b8fc","@sphereon/ssi-types":"^0.8.1-next.162+518b8fc","@veramo/core":"4.2.0","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.5.0","@veramo/cli":"4.2.0","@veramo/did-provider-key":"4.2.0","@veramo/did-resolver":"4.2.0","@veramo/utils":"4.2.0","did-resolver":"^4.0.1","nock":"^13.2.1","typescript":"^4.6.4"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"518b8fc82e26711bc6204d5e0d66bbf04b0844c1","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authorization request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst authorizationRequest = await agent.getSiopAuthorizationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authorization request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationRequestDetailsResponse = await agent.getSiopAuthorizationRequestDetails({\n  sessionId,\n  verifiedAuthorizationRequest: createAuthorizationResponse,\n})\n```\n\n### Verify authorization request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthorizationResponse = await agent.verifySiopAuthorizationRequestURI({\n  sessionId,\n  requestURI: createAuthorizationResponse,\n})\n```\n\n### Send authorization response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationResponse = await agent.sendSiopAuthorizationResponse({\n  sessionId,\n  verifiedAuthorizationRequest: verifiedAuthorizationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.8.1-next.162","_nodeVersion":"16.19.0","_npmVersion":"lerna/4.0.0/node@v16.19.0+x64 (linux)","dist":{"integrity":"sha512-j0iz2h+8z8h4NYW0NDiGv14hvNA9LF+EuqStNPGht8JSzim/HJw+upc1xSqVSNwraQghBC9nXc5HBTmHM2yUkg==","shasum":"90fa34b72ef5f04dcebc48669d4de038800b849d","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.8.1-next.162.tgz","fileCount":24,"unpackedSize":102667,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICnK5zx2Exgo8xfNX5yc0pp/E2vMUT/bHPFhg/soXML3AiEAzdvT7xSFba1ZwccCMR4F/kMVvH6AfAvluJFiss4r/Ts="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjwNVnACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmql6w/+LQAiQ2EP83ImiitkDZAeAkB/rP8jyhxbEm/czO6A49QQwZvd\r\ntR1Jf8Y9A0fOWrb4OSpmDGWOpN39s5mAeQAF/fLivS89o3gAh5g+1nzP5vfv\r\nVOn9neVy+NMA5ruftBus1QG1baxeMWQRWeXu/a9glLHVdTRLhWdXsVK/F065\r\nHJoNwIevluo6yUV/q2iogQ32sg8de/zi5DoqetpaZaKlrb0VhEjIox/WB7j3\r\ncWMuG5PuMx12e7vEWDLF0nVqLcVos31JmpbmfPSNwwzUEMYUfn+CvKrn40Mv\r\ntLVxAVT87zAI3zku20QcgIC6B/wvPpbxJ4gnm8Mfz6DQT6pSPXgf1JxXbHjv\r\nx18oU9rTz/3A2R/PxDAz3qa4D6XP0UUnA5zhJra1hI/54Qf1kAudLmh95X+u\r\njLV9PxWtRcn3d9hx9N6CCJr5KDRJ19UXPe4Q9I4fmmppmit+aatM2xqks24C\r\nEh6XVFydm4682VLf1gIzcMBypnyeDGdfABZHIFl9N49j3yIbp0o6IKuEkCgI\r\n50z3DU3PjeSBHtlrSBaJQIJFehxobqWe//tHD4Oc0AYg+9UgITnLsoj10bUD\r\nxNxlnw5hJ8S7dRObZ/ESYJz59k6djtscDDxj1m80OqQAuQRTp2OtIdmHSn0+\r\n9UVwbDE8R6jNTM86rQ05iDEylDxDGr3mO1g=\r\n=yzs7\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.8.1-next.162_1673581927378_0.5959568035760237"},"_hasShrinkwrap":false},"0.8.1-next.163":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.8.1-next.163","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"^0.3.0-unstable.2","@sphereon/pex":"1.1.5","@sphereon/ssi-sdk-core":"^0.8.1-next.163+1f3f6b5","@sphereon/ssi-types":"^0.8.1-next.163+1f3f6b5","@veramo/core":"4.2.0","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.5.0","@veramo/cli":"4.2.0","@veramo/did-provider-key":"4.2.0","@veramo/did-resolver":"4.2.0","@veramo/utils":"4.2.0","did-resolver":"^4.0.1","nock":"^13.2.1","typescript":"^4.6.4"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"1f3f6b5078868ad4447a6c2e60c81160d428025e","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authorization request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst authorizationRequest = await agent.getSiopAuthorizationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authorization request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationRequestDetailsResponse = await agent.getSiopAuthorizationRequestDetails({\n  sessionId,\n  verifiedAuthorizationRequest: createAuthorizationResponse,\n})\n```\n\n### Verify authorization request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthorizationResponse = await agent.verifySiopAuthorizationRequestURI({\n  sessionId,\n  requestURI: createAuthorizationResponse,\n})\n```\n\n### Send authorization response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationResponse = await agent.sendSiopAuthorizationResponse({\n  sessionId,\n  verifiedAuthorizationRequest: verifiedAuthorizationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.8.1-next.163","_nodeVersion":"16.19.0","_npmVersion":"lerna/4.0.0/node@v16.19.0+x64 (linux)","dist":{"integrity":"sha512-Qtbo8EbW2XMBjUUYPUNKmko/9Dy0mESc0H9PO/L0Ok7WthUar4OZuHmTRZ3qUDNTojZeuSbhGtVh8bg29vfu2g==","shasum":"a9a38eb6a8940d1fbc1cb8bb1122a3dce09a333f","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.8.1-next.163.tgz","fileCount":24,"unpackedSize":102667,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCu7orTBsdTN7M5zoiHQTs++iqUAV7JlwrIYUw5KB/btgIhANLjDy+QGM7IMmXdZaAdKz6I9cII40DGfOcZhr2gw8Ji"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjwNkYACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmqixw/8CsWDLH584rQJcGx581ww5YG88I1Ztm+qVLM3HyOdXq8XwMbY\r\neRj5p/Oe7+AliHXt6vDpZ8Djb845efwRuD+30K55S4rKutSJmw9Pl+P+4Nm+\r\nVWIcU37RnLy9AnKXlIZavKQrcO1J8lV7Jl0SIlgIhnzYDqBDPgy9WYE06uCm\r\nLW2rHlpdawfnGEJC8/HiQg9SCunrJrmhkSnq8e7ae5oo4q0tFqmCy0/nj/y9\r\nXmB7yRT++AXqbqHqAFCQwdPQR09s4pk8flR8UZlkPxQOF5ccoCVwZQh6H8An\r\nmUckf5mf0tT9FnEEH2ZOT+YLwMjHCIThO1gV9bRKetikNbaApidyQ0rscxf8\r\njX9huti6OhmNfmiwNVNyKc3RO7SOVMNoJYLsJ+//SHnt/uOc479yxzrPxPDL\r\npRNsMR+xBRcfPqtv7wtQZ/rEgO96HPjXT/nYAN1dL68BhIFcSKKxTXQECojE\r\nKl3LELbDB3cdMknlJd1Ou4HRgi17FzXtPP/0mBMKCVLC6Ocaud5s84ho85kf\r\nmATcPLKG/izZlQI/f1Y4Ml1ebsk3IZm0yd1W1vDPyPq5G6GArGPkb/tZ24a9\r\n+7vg+BBGauaSYkwszeWybZ+xJ3x2pgA8Nn5WKW3m8OEjv9n8eDvUN+MMC3K6\r\ngKRNFIO+iBR9B8zTXBFDk+5760GUu13Pqmo=\r\n=S1XP\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.8.1-next.163_1673582872766_0.9294387448006558"},"_hasShrinkwrap":false},"0.8.1-next.164":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.8.1-next.164","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"^0.3.0-unstable.2","@sphereon/pex":"1.1.5","@sphereon/ssi-sdk-core":"^0.8.1-next.164+3df79ab","@sphereon/ssi-types":"^0.8.1-next.164+3df79ab","@veramo/core":"4.2.0","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.5.0","@veramo/cli":"4.2.0","@veramo/did-provider-key":"4.2.0","@veramo/did-resolver":"4.2.0","@veramo/utils":"4.2.0","did-resolver":"^4.0.1","nock":"^13.2.1","typescript":"^4.6.4"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"3df79ab1012764ac61e6f3ac910b9a91cb19f996","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authorization request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst authorizationRequest = await agent.getSiopAuthorizationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authorization request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationRequestDetailsResponse = await agent.getSiopAuthorizationRequestDetails({\n  sessionId,\n  verifiedAuthorizationRequest: createAuthorizationResponse,\n})\n```\n\n### Verify authorization request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthorizationResponse = await agent.verifySiopAuthorizationRequestURI({\n  sessionId,\n  requestURI: createAuthorizationResponse,\n})\n```\n\n### Send authorization response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationResponse = await agent.sendSiopAuthorizationResponse({\n  sessionId,\n  verifiedAuthorizationRequest: verifiedAuthorizationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.8.1-next.164","_nodeVersion":"16.19.0","_npmVersion":"lerna/4.0.0/node@v16.19.0+x64 (linux)","dist":{"integrity":"sha512-JBciWsdluLDIqqVJ3c/xf3JV3kRgD7It9+5dfIVkSh2TO+b679nyFF0SXnnql+gHYQFSmT+kQ30cBX3ooGDfTA==","shasum":"b34a32c020779ae21167b2f5c9aaa5fd59957969","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.8.1-next.164.tgz","fileCount":24,"unpackedSize":102667,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC4fV38aOYhlR0XWFYXyeZZQW4qlNp9QGlFSJgYKxnXqAIhAJXGw20+X01wLUh1HPt6w300IMqmUj1AlUGrkn0iJI7g"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjwkEfACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrrMg/+KzMrGY9KbCWYJN2vbB1IrKk69hZw1dB0WY4xC9EMRZ5whYMn\r\n/wf9OjsDzQMNGzCUM/w4rHeLgeDW43ICuEt8QJ4xJK5UeAEP6cnsxxjoNjih\r\njRHoobF3To0y/3Ah3MvDhFlT2HCYbUP8PijUb6DiO4Owg0cWRo6ox05tkQ69\r\nA94Ta+1LaA8YdNK1bQXx1fjrb6dCmWbRIHpbuRaSfh2HW+hT2JkzA1ppQgaQ\r\nU/oCrAa7WoMYmLdxbjXYIqA1ZbxmUOMweh2oAzM16ijWIuPRxJudN9Dy716A\r\nEJu23E2q1nq/eSELPZgTQbim4ere6Zr9OUDf0c0MjawpZ2aae0vM6u6LtfPQ\r\nFhvytlT8Z/8doRxoy0tsbVHbSfHPgdvr5ZZKceBROYpCgUtV6hSqBnPXQCoE\r\noo0gCC1BK2+eh7eU4gRRsMQo1UsuyqkkpYNSrRBDTCAryvsUVJ2twqGbX90+\r\nCV8dco3mgBewbDtbfh9QJhfD3SDIlRjc2nSquKEna1xcNVEpjhNPXKLNTRcX\r\niUlc1WU2cd3te4kdt5disIUNv37FpLF+xJoXaK59nkSMWuPg3EEKPJk/95gN\r\nSlMKCWIzbEenZ6lei8PA4IjMatR445cqEvcVf3CGixEsmA0IFBdKFrOoAKYk\r\npN6lF0aiY0EhIYe9yqyVBwENyCNCsIsNjm0=\r\n=sqR/\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.8.1-next.164_1673675038820_0.5906209508009104"},"_hasShrinkwrap":false},"0.8.1-next.165":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.8.1-next.165","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"^0.3.0-unstable.2","@sphereon/pex":"1.1.5","@sphereon/ssi-sdk-core":"^0.8.1-next.165+834642a","@sphereon/ssi-types":"^0.8.1-next.165+834642a","@veramo/core":"4.2.0","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.5.0","@veramo/cli":"4.2.0","@veramo/did-provider-key":"4.2.0","@veramo/did-resolver":"4.2.0","@veramo/utils":"4.2.0","did-resolver":"^4.0.1","nock":"^13.2.1","typescript":"^4.6.4"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"834642a3881b14195ac47f5bdd639bdaae35c7a5","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authorization request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst authorizationRequest = await agent.getSiopAuthorizationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authorization request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationRequestDetailsResponse = await agent.getSiopAuthorizationRequestDetails({\n  sessionId,\n  verifiedAuthorizationRequest: createAuthorizationResponse,\n})\n```\n\n### Verify authorization request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthorizationResponse = await agent.verifySiopAuthorizationRequestURI({\n  sessionId,\n  requestURI: createAuthorizationResponse,\n})\n```\n\n### Send authorization response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationResponse = await agent.sendSiopAuthorizationResponse({\n  sessionId,\n  verifiedAuthorizationRequest: verifiedAuthorizationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.8.1-next.165","_nodeVersion":"16.19.0","_npmVersion":"lerna/4.0.0/node@v16.19.0+x64 (linux)","dist":{"integrity":"sha512-BtH7TsigWq0vDdkPFACaeE1np1mK2V0K9kMNYkNwe5LYod75ZWyO2U4oDmObtjF76d3G1gNwxTIMvyv9xqyuTg==","shasum":"e4951cae5fb95a1d596a712fd571a2e92a156edf","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.8.1-next.165.tgz","fileCount":24,"unpackedSize":102667,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGHChSGOVOyTs3UlBpkZy5W3oMcLB19yQsG/6tmWLSFTAiEA55bDCNBq+igQWv0Er1eecBkD6rqwXYOtZvrbFIixL9I="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjwkksACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqW3w//TRyENjlGBpHZQCcY0BEbq9Gbj5dHumozRVvBWZ4UbKJMWM6M\r\nOiQXn0GFAo4VNaQKvncPCVl7zciKEgw+S7ahNLlBd4ZvZ2rvfraCcoW9MHex\r\n9VizQdFP9a6WJxGs3X+IKCCRhh/h6lO8CXlted9sYQ8NmgJjHR/43hOYJWP4\r\nzmDWjDOjpR1ZmSHGXVClHuQmFhLDZEsR2sYskanh3AJhBmO8Y9lGqlhOFKqS\r\nzV/kcrIfQZeTewMpIW7+KvUPs+gKD1h9Gz1U7FdBIzlYiP/q1rFYmGLxhck/\r\nElIjV2OSpJw66kU8s0NQBWF34vitV9PJayLgAFqrapDcpuEb09qAn4xjg1V9\r\n7/pRwinHC2ADXhYBu9ynhhJ+fjzlrWtXpHI8SK1N5SSI6SJnTGI2k6S8sMhV\r\nzrNKIYpLdjKgXm/1/WMMESU20+mZvn/JdncQ7q6/D97tPKLtzBdycDq7aaxh\r\ntb+ZagthXZum4g4P+wGvZMSdbvwV/KH73nc30T2CjNeYszfb/0EBsrRdB4n6\r\nPAP1RCafcynouhV8ZdYSYGQnBg8jPV/ydcc9/dHxa3wD7ItmJ7n4nfaskc3E\r\nBo38eI9G3W9/QCu+FP1VYT4SrEHtAP+RH6UdA/D/xXSnSEM9caY8uapAMIMD\r\nuviy4kghWXFl4g+CduVpyJqmkN4M1giKTpI=\r\n=EXc2\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.8.1-next.165_1673677100326_0.18785025986448467"},"_hasShrinkwrap":false},"0.8.1-next.166":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.8.1-next.166","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"^0.3.0-unstable.2","@sphereon/pex":"1.1.5","@sphereon/ssi-sdk-core":"^0.8.1-next.166+9eb47d1","@sphereon/ssi-types":"^0.8.1-next.166+9eb47d1","@veramo/core":"4.2.0","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.5.0","@veramo/cli":"4.2.0","@veramo/did-provider-key":"4.2.0","@veramo/did-resolver":"4.2.0","@veramo/utils":"4.2.0","did-resolver":"^4.0.1","nock":"^13.2.1","typescript":"^4.6.4"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"9eb47d1147d15f87bf9e6ac8861bede21a2511dc","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authorization request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst authorizationRequest = await agent.getSiopAuthorizationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authorization request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationRequestDetailsResponse = await agent.getSiopAuthorizationRequestDetails({\n  sessionId,\n  verifiedAuthorizationRequest: createAuthorizationResponse,\n})\n```\n\n### Verify authorization request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthorizationResponse = await agent.verifySiopAuthorizationRequestURI({\n  sessionId,\n  requestURI: createAuthorizationResponse,\n})\n```\n\n### Send authorization response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationResponse = await agent.sendSiopAuthorizationResponse({\n  sessionId,\n  verifiedAuthorizationRequest: verifiedAuthorizationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.8.1-next.166","_nodeVersion":"16.19.0","_npmVersion":"lerna/4.0.0/node@v16.19.0+x64 (linux)","dist":{"integrity":"sha512-1rogG2WJEICuk7G32pQH8E3uDVsSZjcbbw2ybb5kD1ZZRa9+JbVRnJd/IJvQk1jXCGOZU5FkY4L0aiAoqanVAQ==","shasum":"cc1ab421b981df1663163ee863d38d4570b9a585","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.8.1-next.166.tgz","fileCount":24,"unpackedSize":102667,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCzLpk25snZty1AuWw025RwN0cjXC+1jRt6GNxIWVHu3QIgXmrYfJIKVizRO23zayTXZtGlDWL77oUwszqj5aUh4WE="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjwk3IACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmqpgg//X7DRpnyjybnqwB4p3Nik3e9n8us4ZuMExJBN/pnwh0VI4QLf\r\n9eQfm7neOaWRhNt2pwiOEpbowuEofCRk3KZSssjsYidMvnR6HG7pa2hrCIS6\r\noRY4ifdrmsKJ1W5tWRgHCfXGoN7iUP7jwN6NBPsnuTO86jFfPviS9qxFaN7N\r\nKf/8ngtGdvKuRVaAzDOcSSrqsi6OIoIKon46jgCB+EdGq0hb9DnsN0a5gtzg\r\nnnOJPXxkiHkJU/TgPQWqJbBlnwvYfQ9WhASFvl8q4loGcO5y8d5TYEKv1RNa\r\n7tqgFJzehr8C7M5wwauYw3wIui8k5ThlM323xIge612Dv+ci2wKvucIOqV2O\r\nZU8x/hq7sh79siN7X1HG5jrF+23o/la9rWWW2tnF7VwRoLNdI7fRSO09gZ79\r\nHisabkkxj6FrO31oyiN504hQibp7s3DCwfdugo7XUzsTaCtFpHnSlhcgJaoM\r\n3dI0arYceKEVYkyX8aMcjWXWtr2sxPS7SJB0mxmFEZ/ZaBZcut8oC+7ogngB\r\nBZsAUiWHcpNG2zWLggn8lMr/IwoPHkXmB9Bj9+6roUjfYuE6fz93LpysKJAp\r\np/KO16dVs4g296CXVpBiFWnoyq76bmNA/dKe95/hyUIOKTqVLgx70Q7INs8Y\r\n1whRp6zPnfwxO3WWM9Kx29i2fwJO8yDXRuc=\r\n=+apZ\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.8.1-next.166_1673678280573_0.7191975230610819"},"_hasShrinkwrap":false},"0.8.1-next.167":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.8.1-next.167","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"^0.3.0-unstable.2","@sphereon/pex":"1.1.5","@sphereon/ssi-sdk-core":"^0.8.1-next.167+d6f57b8","@sphereon/ssi-types":"^0.8.1-next.167+d6f57b8","@veramo/core":"4.2.0","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.5.0","@veramo/cli":"4.2.0","@veramo/did-provider-key":"4.2.0","@veramo/did-resolver":"4.2.0","@veramo/utils":"4.2.0","did-resolver":"^4.0.1","nock":"^13.2.1","typescript":"^4.6.4"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"d6f57b86b07a74e81c3949fa2663e5ab4732760f","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authorization request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst authorizationRequest = await agent.getSiopAuthorizationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authorization request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationRequestDetailsResponse = await agent.getSiopAuthorizationRequestDetails({\n  sessionId,\n  verifiedAuthorizationRequest: createAuthorizationResponse,\n})\n```\n\n### Verify authorization request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthorizationResponse = await agent.verifySiopAuthorizationRequestURI({\n  sessionId,\n  requestURI: createAuthorizationResponse,\n})\n```\n\n### Send authorization response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationResponse = await agent.sendSiopAuthorizationResponse({\n  sessionId,\n  verifiedAuthorizationRequest: verifiedAuthorizationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.8.1-next.167","_nodeVersion":"16.19.0","_npmVersion":"lerna/4.0.0/node@v16.19.0+x64 (linux)","dist":{"integrity":"sha512-LDC6U7/G3+64DpWtmwp2QGK9cH5mu+2PLOsY3/JMn3nzEYvLOlNVDHAq59VIf8x5Y53+DwAFmkixVGFV2v+weg==","shasum":"b322376fbda9bb7d0caaf9647089ea103581ebc4","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.8.1-next.167.tgz","fileCount":24,"unpackedSize":102667,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEnN0MiTgmoFd1BIxipEMzdumymtZ5PzCz06AInHz7SMAiAdW5OSoWxF6RfyI/6r/kj+SHxy9WexAzgl+LkmoyWgVQ=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjwlIrACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmqhdw//XH01dJo7aFQxvpN8bI8NM4Bv2gCiTGnAHMyVKBWHmZrD0JdE\r\n/vmSR+LXQu9ll4ouVg8NsTMnHohkYWhAlu+1CAkhozHo+rKL+Yd9y+qWrgvl\r\nCx2zUX/6v2EqMu1jIsq4RMprBXWV9qMt/IRRKHyCjLgc9n2WP0TIUQnYxVmX\r\nj5c6n6JfsxeBPPF72QFM5BsSSB+bsRIytG9DOzE/gZ7cRBusD70qCK8DYrXb\r\nqCv2DE/PqlhxbD+EryoFWBkmmOCkhhMUtWLKM4+1rxiQ90U13wY0zwDj4wLa\r\nm2MWvMadEmRmV79XJ7YVKhb+PYhoG2iOAOK+lYkMEOIB9aqwxuA8GgJ6HVzh\r\n1wbVvx32+o/5l1hGpdPev9/1SUuid7BHm5JwYKnqIGFr3WWv8VCCUSC3O2Jg\r\n/VmuOdmDCL0FDmIKeKU5iC+sgnA17YCPE29hrNJydPtEHSkQiUcSECFTsoAj\r\n20lhSMd/m7NqwvTHUuSz+hYDkHRhx7owWaniPfKri2nkqn17oKuUHbOgGye8\r\nEBvqJB1AyG0rBHCJkUFsM65Gh54J0OXrfMLejfequcTV+/uS8EQcQq+9NzG6\r\nu/OBFZCGzwLrAlGZLPbNv/Ly0JaoCq167Wf+6Cp536l+OzmvvT5gK984AuyN\r\nU+PRtbFSuOyABu6nwEMmmh93qZ+t5Fpi5bA=\r\n=pov/\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.8.1-next.167_1673679403664_0.8307892341625769"},"_hasShrinkwrap":false},"0.8.1-next.168":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.8.1-next.168","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"^0.3.0-unstable.2","@sphereon/pex":"1.1.5","@sphereon/ssi-sdk-core":"^0.8.1-next.168+b163872","@sphereon/ssi-types":"^0.8.1-next.168+b163872","@veramo/core":"4.2.0","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.5.0","@veramo/cli":"4.2.0","@veramo/did-provider-key":"4.2.0","@veramo/did-resolver":"4.2.0","@veramo/utils":"4.2.0","did-resolver":"^4.0.1","nock":"^13.2.1","typescript":"^4.6.4"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"b163872e14a43b3566db1413497885cb918b982b","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authorization request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst authorizationRequest = await agent.getSiopAuthorizationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authorization request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationRequestDetailsResponse = await agent.getSiopAuthorizationRequestDetails({\n  sessionId,\n  verifiedAuthorizationRequest: createAuthorizationResponse,\n})\n```\n\n### Verify authorization request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthorizationResponse = await agent.verifySiopAuthorizationRequestURI({\n  sessionId,\n  requestURI: createAuthorizationResponse,\n})\n```\n\n### Send authorization response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationResponse = await agent.sendSiopAuthorizationResponse({\n  sessionId,\n  verifiedAuthorizationRequest: verifiedAuthorizationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.8.1-next.168","_nodeVersion":"16.19.0","_npmVersion":"lerna/4.0.0/node@v16.19.0+x64 (linux)","dist":{"integrity":"sha512-FlbIUIIncO1dw/POUVXLo9kwJrAh6+lK7f5Ns7u55PYPXN6VIGz8dc0OtrdHLE/8VPZiso/bep1eEsKSsnIpVg==","shasum":"4f0a36889f1086ab2afdd85c5611accad359c718","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.8.1-next.168.tgz","fileCount":24,"unpackedSize":102667,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCrz7URn2KDASk5hWRyh3E51tRYziFmRn79RIhD1SsXQgIgZtwDxRbttJ1yvaQn6s7vEGcFRk7MAA+DfH3HeV6zxZ4="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjwlo9ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmqy5Q//fuggprHKsR2UikJNzQOYOr5EedZOow0ji/wXoxtHmICYZ2V7\r\n7mcYIP2NlJfciB2m2yzBu8/i45pYNPsXBw851vmjHP4feAmy4QCYCxG7NEg/\r\n2rq+9sXAPitpWD4wBh6niuhue2pvXryyElEuUKNDWBbSNuWJGIgyteCczq1y\r\nvBewiN0r6gw6Y/aij9oJxWMCaUTPIL8HS4/qIXfd32HK0Y9TB7GkfPuGMmnh\r\nGQ3Op2PIYCgcp1YEbaScIRU6g+21IkN8Y6Y8xqyTF88cFhYcO3QnlAL/FcyE\r\nKKI8a5Jp/DOgC1L0O556qPTiSn85BGNVrkRK4PS0KT9aKPp+NbhtqxECdzFA\r\nE5gucFlCR7yt4RhDIQxGkvafKYx87McUwblBMHzZmQvkhNDqHTcHmDdGaVdq\r\nAEUGjedGlkPwBl7Qq1c/hSkFzPrVzlHlCsCT96WMFp+x4xKCtEZ2pKh40GYh\r\ngRBLvYJcBAShdcv4KD/C6XP0fQHfkbzP8QtdUb/LXjTX50R0Ift0D4BokIe3\r\nxIcATA+ZRoUYzTpfiup4OGMX+/Lc2zvV+sP6UX0YbbCZSg+6b0kfRZc1kV4T\r\nKnW9ExAcfn0NSxEKy4E85m6rPtBPWQsnV4dLat835yx1JRpiRfi1e9vIlR79\r\nng/70gXn595mIbuYHAyQVicQwFK9MZU1w4s=\r\n=wzOh\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.8.1-next.168_1673681469198_0.3498796249378793"},"_hasShrinkwrap":false},"0.8.1-next.169":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.8.1-next.169","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"^0.3.0-unstable.2","@sphereon/pex":"1.1.5","@sphereon/ssi-sdk-core":"^0.8.1-next.169+3da5bad","@sphereon/ssi-types":"^0.8.1-next.169+3da5bad","@veramo/core":"4.2.0","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.5.0","@veramo/cli":"4.2.0","@veramo/did-provider-key":"4.2.0","@veramo/did-resolver":"4.2.0","@veramo/utils":"4.2.0","did-resolver":"^4.0.1","nock":"^13.2.1","typescript":"^4.6.4"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"3da5bad3a79efc42755e354e86ecedc76a2828eb","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authorization request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst authorizationRequest = await agent.getSiopAuthorizationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authorization request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationRequestDetailsResponse = await agent.getSiopAuthorizationRequestDetails({\n  sessionId,\n  verifiedAuthorizationRequest: createAuthorizationResponse,\n})\n```\n\n### Verify authorization request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthorizationResponse = await agent.verifySiopAuthorizationRequestURI({\n  sessionId,\n  requestURI: createAuthorizationResponse,\n})\n```\n\n### Send authorization response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationResponse = await agent.sendSiopAuthorizationResponse({\n  sessionId,\n  verifiedAuthorizationRequest: verifiedAuthorizationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.8.1-next.169","_nodeVersion":"16.19.0","_npmVersion":"lerna/4.0.0/node@v16.19.0+x64 (linux)","dist":{"integrity":"sha512-zST2kRDg5pqwdUTjNhP1/Ijpi5jELtaG17IM1jdJzzXrBK8vRDL37125pLQBpzrEla8Vj26TJgEIwnddZNv7mQ==","shasum":"b44ba51da13e873d85e9352a76a325e45a7cb010","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.8.1-next.169.tgz","fileCount":24,"unpackedSize":102667,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIG+7xN813uwfaL2qk4BNpwTw6n/pu5dcR68OD9PsV/H7AiBbD5xvMXChNmTeR4XWfZEjJPd3fovFioZgzV2d0TQXiA=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjw2BMACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp7lxAAnpooOv6+qI0Ie201Vfpftm5cS/NdaOzAAas0s3jjDB1WmAYB\r\nwY3pnfQ4cc5HPhC5NowFc7cGs9Rc76Qb/5DvjMeysvfkwbvs35y7wKhFrCjX\r\nIbAOtsHQ9mj6VGxTw7RU3hgav0ZyiKET7O5LPR4cY920q2DzAIqCw/45QeM5\r\ncjKbfiX1HB3CFJVDE14xT3BHElaCeGn+AQvWp8uFqLaV8isOKW4OC7TqHpz6\r\nfQPbfpAZDdplxUjGFQFZIm8UCd5W5/KAd0AkMlqsZ8JmhVIyknHSYMyxhCBf\r\npU2fmczMKsaYcY1MCCkZD9bKLj1wHS8JKO9IsIKrrwc131zP7H0/L3VlWD5m\r\nyILfON35inhXY9VCSnWiGFulgBi2EW3mXtapEE4fQd8LrJ9GgKh3qX6xfvO4\r\nEJ87KpdY3AkPKwICx3HWhj3oYg5yXdMu1dct9PLg5nMtOyCqJC68oiJ8X9Gk\r\nfjCYyqCmJXRgYdZTCV9tzY4Zndps7iTWGDp3lATCUeDgYi/qzJg+3XoqbfDn\r\n41mCTMsrTJF6NjhxNXZaD9wjiuI8NqBq7dXJ4GCReG4efwq6ubEuTDsEKOWj\r\n+bw9XcFsjnbI87e1W8fBSOg1BEjuErRIYRmRZPvuASmsRgCDIPxKx342tJvq\r\nR4vazGSObzvFz3GLSe+z1zqLWpraZi+q9pI=\r\n=DbK5\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.8.1-next.169_1673748555839_0.5715516886922807"},"_hasShrinkwrap":false},"0.8.1-unstable.170":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.8.1-unstable.170","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"^0.3.0-unstable.2","@sphereon/pex":"1.1.5","@sphereon/ssi-sdk-core":"^0.8.1-unstable.170+5d7cd19","@sphereon/ssi-types":"^0.8.1-unstable.170+5d7cd19","@veramo/core":"4.2.0","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.5.0","@veramo/cli":"4.2.0","@veramo/did-provider-key":"4.2.0","@veramo/did-resolver":"4.2.0","@veramo/utils":"4.2.0","did-resolver":"^4.0.1","nock":"^13.2.1","typescript":"^4.6.4"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"5d7cd190771aad89620bff9e1e271436e9d78bd3","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authorization request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst authorizationRequest = await agent.getSiopAuthorizationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authorization request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationRequestDetailsResponse = await agent.getSiopAuthorizationRequestDetails({\n  sessionId,\n  verifiedAuthorizationRequest: createAuthorizationResponse,\n})\n```\n\n### Verify authorization request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthorizationResponse = await agent.verifySiopAuthorizationRequestURI({\n  sessionId,\n  requestURI: createAuthorizationResponse,\n})\n```\n\n### Send authorization response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationResponse = await agent.sendSiopAuthorizationResponse({\n  sessionId,\n  verifiedAuthorizationRequest: verifiedAuthorizationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.8.1-unstable.170","_nodeVersion":"16.19.0","_npmVersion":"lerna/4.0.0/node@v16.19.0+x64 (linux)","dist":{"integrity":"sha512-LUlDxHjC852DgeZAyfMS5i6YGX5wlaAq1zg6uRbrWRc4mzlCd1HFDK1NfrTLx0aWVy6ATEDiBMoIkEuQ2KqJhQ==","shasum":"b96d20be64d8106b80828d268c2e0169fc68b93e","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.8.1-unstable.170.tgz","fileCount":24,"unpackedSize":102679,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDuTHjr+6jEHcw3v6GYiBIDDHGq7a8a6cuHobSQIKXUuwIhAPbWWVLmw14tKAyhdaNo/WXs1qGby5GWH2UQYT+f1i+4"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjw3JHACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmqkvw/9GdXasaWM37l+USdfPFZoA2OjF3Sq752ugJ4kn+hbVuVUyKsB\r\nKvj8YwU/Z4DuhfXaowyd5E7VsgOlG34flSZQ0/OcA058RiH4Dwm5XDG6J1c7\r\nGAWTXEOTA8DuqAT7kD6WcH0hUaweL7dwSB3/NdVsiiIPlC1JeLZ0PK1X9rQ7\r\nPIpFWfNoYdL1afHoQvidu6PghWdA51MfyOhcmBJx1Qo814+HB7AlWl73AcQv\r\njnO1L8SFI0EiZttF5BIF4RJv+vIQzkcXmgbo2wc6aLSQxaJs9C8BnSeBda+c\r\nQVDaBAoz8Q7HpHtQ+U3WjWN73bPVIulUgb/oZx8vv78ZppgGJUONfZO2C8MP\r\nWGD9u+GnYIX5JgzS5nbOIIPf7gccxKpljrIzvUJckD6SuyqFIaigw7neGegV\r\nU6H1xUlUAHIbCGuGgt+nIDNMO39zzhimTXw3g6HNL973ZMvsu0CPmbkPK+8i\r\n5QuavLicigNwLZyK+KITXgP+P20nKRTcCDuXns5lLcT2yEdVdmtQ1RVF5Ze8\r\nsUWBh3b35PggmAy+6TLCGO0TQEviCKIjzQlxCknIB1CiY68482qs5hC7lGo0\r\nrF+sL5zdGP/o7JsJNsSyr4Y0JZ5wWde+I0bPWEf5joiHHySKk+b81f2a2/Th\r\nxsCEiODRMzF/udk0BZvsqhWLqI8+oqAAKjM=\r\n=kKTn\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.8.1-unstable.170_1673753158892_0.2596804891474196"},"_hasShrinkwrap":false},"0.8.1-unstable.171":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.8.1-unstable.171","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"^0.3.0-unstable.2","@sphereon/pex":"1.1.5","@sphereon/ssi-sdk-core":"^0.8.1-unstable.171+67a8185","@sphereon/ssi-types":"^0.8.1-unstable.171+67a8185","@veramo/core":"4.2.0","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.5.0","@veramo/cli":"4.2.0","@veramo/did-provider-key":"4.2.0","@veramo/did-resolver":"4.2.0","@veramo/utils":"4.2.0","did-resolver":"^4.0.1","nock":"^13.2.1","typescript":"^4.6.4"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"67a8185c5d60a4036e74b412f8e3a1e6720c05ed","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authorization request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst authorizationRequest = await agent.getSiopAuthorizationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authorization request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationRequestDetailsResponse = await agent.getSiopAuthorizationRequestDetails({\n  sessionId,\n  verifiedAuthorizationRequest: createAuthorizationResponse,\n})\n```\n\n### Verify authorization request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthorizationResponse = await agent.verifySiopAuthorizationRequestURI({\n  sessionId,\n  requestURI: createAuthorizationResponse,\n})\n```\n\n### Send authorization response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationResponse = await agent.sendSiopAuthorizationResponse({\n  sessionId,\n  verifiedAuthorizationRequest: verifiedAuthorizationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.8.1-unstable.171","_nodeVersion":"16.19.0","_npmVersion":"lerna/4.0.0/node@v16.19.0+x64 (linux)","dist":{"integrity":"sha512-iGJWtC/XOzIE2iDeUUgMknzCe6O7vUuV8uJ5NChuQ8mYx6ttqik7h2hDqKTB5TOGUyHycf2aovHZJ8WWCWLAyw==","shasum":"372d224842214cecd82c279402b5c0c645dce67c","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.8.1-unstable.171.tgz","fileCount":24,"unpackedSize":102679,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIC/w+aAi2ybnnoB6HNQThG2r61VTXKDUxPNKztJBxFSpAiEAwTVmS1E8rxCTQ9DZ2IL3t2g6iNU77jVtpQM+Kw8+3TA="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjw3SnACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpIfw/8DR9t5r3g0y2dbZy8mIctkLY+jlfOh/fIqTFiTLLjgtROnXIR\r\niXLytXvVqdSFGnh6dKPP1L6NbdHHEKnHSUPJfUUIQbYvHgC3DsXP/Ni0gjZZ\r\nMsozIhMSfrM87bBEWK4q9kDh85NbvhxmPv1inMqYr/KGp9xPtgMlDvj3eW0j\r\nDBHMLic6/57imRRx7DsvBsQRKduOQPdlpizufvoSu4LgAVY3XFHjoT2KmcIC\r\n5oIDNchfbQh1l85v+odqcUGMEGclFFSJOLQJ8h0YlpsZXoxQsL2vPsCuQtck\r\nU33S9GWvfj3g+iV52dpase1Eo+hTs6YwjwT0p3o1IrDv91DALZh8Blmoit3u\r\ne+bJ3hqB30tisCjROhPh6ZRSgn4iPPWGzLgxs8ZefQHD8MQdiYJv5F//DKjU\r\nahW+vIwMuNdfpmzh7VUW9wGT8diugD8DRBeL5GFuxD9STTLGymCj7itHxcp/\r\nCDVy+H9n64otIhO/1ZMfykXx1vQ17WnggTXivBCEx3sPLnPMfbc/IcNN8X5J\r\nl6CA8C5l7eNaC9pj/50WUSSHuVSgU/b1VtmELugzfEfa/iofSTrDsCtNSDBT\r\nBrkWPvhNuu+2jLxYRMe7v/peGRB4rua9sbe42XgWyA1OtSPeE6wBZ+141XN2\r\ngjkaxTnfQU4EX2NnaNT79gU//+nzFIdm51A=\r\n=zX1z\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.8.1-unstable.171_1673753766804_0.2488748212054559"},"_hasShrinkwrap":false},"0.8.1-unstable.172":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.8.1-unstable.172","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"^0.3.0-unstable.2","@sphereon/pex":"1.1.5","@sphereon/ssi-sdk-core":"^0.8.1-unstable.172+b388091","@sphereon/ssi-types":"^0.8.1-unstable.172+b388091","@veramo/core":"4.2.0","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.5.0","@veramo/cli":"4.2.0","@veramo/did-provider-key":"4.2.0","@veramo/did-resolver":"4.2.0","@veramo/utils":"4.2.0","did-resolver":"^4.0.1","nock":"^13.2.1","typescript":"^4.6.4"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"b388091cfea0993d0e20f9d61402a7cbbae9b9e4","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authorization request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst authorizationRequest = await agent.getSiopAuthorizationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authorization request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationRequestDetailsResponse = await agent.getSiopAuthorizationRequestDetails({\n  sessionId,\n  verifiedAuthorizationRequest: createAuthorizationResponse,\n})\n```\n\n### Verify authorization request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthorizationResponse = await agent.verifySiopAuthorizationRequestURI({\n  sessionId,\n  requestURI: createAuthorizationResponse,\n})\n```\n\n### Send authorization response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationResponse = await agent.sendSiopAuthorizationResponse({\n  sessionId,\n  verifiedAuthorizationRequest: verifiedAuthorizationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.8.1-unstable.172","_nodeVersion":"16.19.0","_npmVersion":"lerna/4.0.0/node@v16.19.0+x64 (linux)","dist":{"integrity":"sha512-6UCBhnpLylOwjSJ722Twj0OVsO0pvn0poJ/TAE3DBG+9et5wKElnJvYA26zMXxB0tlIwxHOm4JMTC7V95lOHFQ==","shasum":"b1c20ce0b54e2b7e14c2344ecf7934990155e93f","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.8.1-unstable.172.tgz","fileCount":24,"unpackedSize":102679,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAj720c0rY46Le40hXNpGs79MXBbKfOf2DKvTESZA/5JAiBqub2+p646J4neoOxX2RZjVphcdDdVIGL4Ir9TDiUajA=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjw3okACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp3mQ//VMqpfzBeyr+m54SQEGKW4cKN0p7SChpHtSu47IqzzQQ1VieN\r\n4m4vt2Ty8NZFH6ggtPb8FHRVP0bnveTWHec6ljTtcTasCrx72Ptg5wF5JWR1\r\n8QfTCizYM9LRpxBKNFCM+/UvoenzLVueoGsNeOKgUl49FDDmtyKg1oDuiqFV\r\nxhzeujcX2D/z3TJzjzX0Og629Yd2ovFBtozsajGOxUGDVRalTjAV7TlcObn2\r\nWWWFCu2BW06EMOt2OvcHRfUnW3DEdFkWd2F317BV19P/lai1fSP6NsCmxqWs\r\nAzo9sKMBun3nG5WbHnWx7YupYaTC9ynS48moqFgXwmaQkzGCL+jM/iTp3JCe\r\n0ZxpL2hPHW2Xpd/9/d0kbD4yO+xIfYKbzmiwWAATI1r1WY4JNhhxtEIt0UGS\r\nckPtOk+4RAYeyCmQRNfHua30u7E7wS+VluQqc2iqj8mqc/djuHXnJH3J4VvY\r\nSpAOs2zKD5t6PPXZdkx5sbcDqbF6X4inhCDHghG3MEZoY9NG+iicdC9AG0BW\r\nhZ3ewln+I3Z9lSqVLNwfAxZF5RcGykhpRFC76aoROX1pmVpi0XmwX29BKncH\r\nGp4oK0ba4SBJ8yvuZshhVcXibmqWecjodaQwIyFtpHlRwuY68DyrYbw/Enc4\r\nyk2OOMXeyanyfdqiWO5z0xoYYvVqzt1GsUo=\r\n=/Yt9\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.8.1-unstable.172_1673755171989_0.1605122024182215"},"_hasShrinkwrap":false},"0.8.1-unstable.173":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.8.1-unstable.173","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"^0.3.0-unstable.2","@sphereon/pex":"1.1.5","@sphereon/ssi-sdk-core":"^0.8.1-unstable.173+e98ac2b","@sphereon/ssi-types":"^0.8.1-unstable.173+e98ac2b","@veramo/core":"4.2.0","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.5.0","@veramo/cli":"4.2.0","@veramo/did-provider-key":"4.2.0","@veramo/did-resolver":"4.2.0","@veramo/utils":"4.2.0","did-resolver":"^4.0.1","nock":"^13.2.1","typescript":"^4.6.4"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"e98ac2b97b3248538b7cd5d05f0c7f639a63feed","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authorization request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst authorizationRequest = await agent.getSiopAuthorizationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authorization request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationRequestDetailsResponse = await agent.getSiopAuthorizationRequestDetails({\n  sessionId,\n  verifiedAuthorizationRequest: createAuthorizationResponse,\n})\n```\n\n### Verify authorization request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthorizationResponse = await agent.verifySiopAuthorizationRequestURI({\n  sessionId,\n  requestURI: createAuthorizationResponse,\n})\n```\n\n### Send authorization response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationResponse = await agent.sendSiopAuthorizationResponse({\n  sessionId,\n  verifiedAuthorizationRequest: verifiedAuthorizationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.8.1-unstable.173","_nodeVersion":"16.19.0","_npmVersion":"lerna/4.0.0/node@v16.19.0+x64 (linux)","dist":{"integrity":"sha512-2D8BqR8h0+DAEkdtBkDdVjNUyQg5MdiDfABT9e1Q3TsJtsxGX9jNDxHdx20dCvWlA1om7ykuQ+bEQlUTORY0BA==","shasum":"18e1d221d0be0ab867ab5b861ec797c8246b681b","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.8.1-unstable.173.tgz","fileCount":24,"unpackedSize":102679,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDrZ2aA+Z7mlNiaFLw4301G/Hm2bbKnzp7jk+IVf4dztQIgeCosBsJZ5xWTVQLc3doFvZMZhsDtXNH+l2xlBJNzgqI="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjw4mjACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrOpg//XJIBhvrJwuPb7rpPp7nlx9Mc1BKwMryKB4SSMUndAgQDi0+t\r\n4F+g4kNweZD4NxtSZAq3eJmRDLX5D6rZlCPyj+U8QGuAmHdDgg0Whu3kBYPW\r\nlLHcXI2aJkDk2fehjMIJp6X0vEK34m6DeGP6+ULdj1+f54RSZRcZp/Ng6pAo\r\n4mN5umaiKxYjzqwF78RXXhUqFR7ReROdsQeHiqkZnAUN4wAkdH3vXN6pRr+n\r\nibAEg5vD2wSGGpEFl9oK/B4WEYcvzsv6nfpv+KY7VyAqnLqNbcw5un/f/pN5\r\n8kVL17iyhy3SbE3oU6+/6ZXXpG85+sOBPTTW8ejR+5WENPN8sQ+zNxqwW3SZ\r\nR4Ac3pHMu+4m7+2yYB/Psd3pBdQ83mgD7QghH0TEvnNVZG64Qvc+BhPixlUB\r\nPwLTq5Io2SuElQIpBzd8rqtK9TpclxNyFPEurO4XhUdkkI8o6jArFxN7fQRD\r\nuQptzelVEe6rEVub+rp/Q/MSqbxKOgvc6zf4UXczOb8u5sqxq7+9hdhrnY66\r\nLONO1WDFGYudXYphu32H8pW0VsPmmf/6hWNzQpmi6+flMtWsLcZ9/nkHyfuK\r\nbKgsHsIqgJ6jfcm77zE1m5YoEoEKTZYv5NCLn1e82Ouh/2os/ndHKKOb8e5Z\r\n690ca3JRBz6CcwSQb2018V/ubIX0/kDNVBo=\r\n=S/9W\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.8.1-unstable.173_1673759138969_0.4703835289152798"},"_hasShrinkwrap":false},"0.8.1-unstable.174":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.8.1-unstable.174","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"^0.3.0-unstable.2","@sphereon/pex":"1.1.5","@sphereon/ssi-sdk-core":"^0.8.1-unstable.174+3070df2","@sphereon/ssi-types":"^0.8.1-unstable.174+3070df2","@veramo/core":"4.2.0","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.5.0","@veramo/cli":"4.2.0","@veramo/did-provider-key":"4.2.0","@veramo/did-resolver":"4.2.0","@veramo/utils":"4.2.0","did-resolver":"^4.0.1","nock":"^13.2.1","typescript":"^4.6.4"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"3070df22e8e979371fbc97bbb088a5e95e50e4dc","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authorization request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst authorizationRequest = await agent.getSiopAuthorizationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authorization request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationRequestDetailsResponse = await agent.getSiopAuthorizationRequestDetails({\n  sessionId,\n  verifiedAuthorizationRequest: createAuthorizationResponse,\n})\n```\n\n### Verify authorization request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthorizationResponse = await agent.verifySiopAuthorizationRequestURI({\n  sessionId,\n  requestURI: createAuthorizationResponse,\n})\n```\n\n### Send authorization response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationResponse = await agent.sendSiopAuthorizationResponse({\n  sessionId,\n  verifiedAuthorizationRequest: verifiedAuthorizationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.8.1-unstable.174","_nodeVersion":"16.19.0","_npmVersion":"lerna/4.0.0/node@v16.19.0+x64 (linux)","dist":{"integrity":"sha512-b5rEfyTcLNq2ujz0tJRNsg2Q//KSYuKkDcMH3E1SHvjeXg2wB9xFD4NNyxwy82vtw20WoZ6iaoYypKjHCwALtg==","shasum":"b0653de442c3ffc2bf9c5011ed5299380cf65004","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.8.1-unstable.174.tgz","fileCount":24,"unpackedSize":102679,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDbL+bLr1Z8ZyweQ4qMagKedrbBABd9a+6VqgQZ5IpXMAiEA5Th9pHmJpUGbdEf+6dJhVA0LCaH8Lnpy86q7QMY3V5s="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjw5OPACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpkOg//SS9IdwJ9G51lhhlUzLNvwe+BXCjYXitgWT3FXZ+eeBhDTDV2\r\nVH7fkq49pUuYHaE/jhO90IiN3VN35aZYFDMaKssRRHx1iZcJTs1WT0auBr32\r\nGwpcxy6VCD8yAhF4LkGZUIzozi/3bCtwRTnuOSZM5fFi7z+/j2ZnFZakFeNo\r\n2+50PpI2/SS+WEhyyXDt11lY9ZOlMdudzzVtvS+5kD6zy1+SCDmG7aepGzAu\r\nPeIke5sqBUprA8FiZxchyiYLH94xyh8CdiTkuUob4vC5Ad0F/L5bog6HwYs7\r\nUmvMxjk+kq8fui1UQLetmC16DQXb5XSpLrqZG1+D5whFmkOF3YOtUALQ5L7r\r\n2aw+IPJO8Yb/Lqn4nwVWdMPgulVdCjBlUhaLWsx+iOFO5M/BUdoK1JfTC+eR\r\nj8pfjGSHEJ7q0dx77qbnfO9pCy+afFaG2GAv+I3mTb/40GFyRvRlxVhrtgOZ\r\nbwyWyy3UkksimJ2S0LlyVQjsE8qb3lsaCufRG8+uHtGSpJeIs+9nsMucq++4\r\niQ6dQ/UJwH+F2+WhA/GE0mfeEX5COR7o2sGM9iR1+eaWXgNaaEUf9XlL6Bo6\r\nl91ntgcNYJlpXb6sy4uSmMwBIU81kBEy/dN9KbSSy9gas0jAP6y2DLnWnoQQ\r\nvwvu/U2Zfr4W538uF1PP6U6zbsQ5BfLOPcg=\r\n=Jikj\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.8.1-unstable.174_1673761679291_0.9197991860218726"},"_hasShrinkwrap":false},"0.8.1-unstable.175":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.8.1-unstable.175","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"^0.3.0-unstable.2","@sphereon/pex":"1.1.5","@sphereon/ssi-sdk-core":"^0.8.1-unstable.175+e2117fe","@sphereon/ssi-types":"^0.8.1-unstable.175+e2117fe","@veramo/core":"4.2.0","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.5.0","@veramo/cli":"4.2.0","@veramo/did-provider-key":"4.2.0","@veramo/did-resolver":"4.2.0","@veramo/utils":"4.2.0","did-resolver":"^4.0.1","nock":"^13.2.1","typescript":"^4.6.4"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"e2117feeb7afddfd41b6fab1d755040520c64107","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authorization request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst authorizationRequest = await agent.getSiopAuthorizationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authorization request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationRequestDetailsResponse = await agent.getSiopAuthorizationRequestDetails({\n  sessionId,\n  verifiedAuthorizationRequest: createAuthorizationResponse,\n})\n```\n\n### Verify authorization request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthorizationResponse = await agent.verifySiopAuthorizationRequestURI({\n  sessionId,\n  requestURI: createAuthorizationResponse,\n})\n```\n\n### Send authorization response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationResponse = await agent.sendSiopAuthorizationResponse({\n  sessionId,\n  verifiedAuthorizationRequest: verifiedAuthorizationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.8.1-unstable.175","_nodeVersion":"16.19.0","_npmVersion":"lerna/4.0.0/node@v16.19.0+x64 (linux)","dist":{"integrity":"sha512-XgsATIqsvnPgwFJukrgG9olxGt5BSSiZy1rCPgGrCtjlkyB87tkLv8X+olT8vu+5mvFVodhsqbN17baxfDCD4w==","shasum":"db132bd6b7661bc879c2b108af54766f5266b078","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.8.1-unstable.175.tgz","fileCount":24,"unpackedSize":102679,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICKkCQvXETDPP9jME9HGFceNn7VPgBjwee1wmgT2BDP8AiEApl0jw5xUySw5XC0H8twXegX4F0XwVE0N4K8MB7Mf+7M="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjw7QdACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqgUQ/+No/Jw1WByA23+6dxh62Gukc3+xU+avkW8fEyEPcuEwQO+y89\r\nnZ2KogYiIoLY+FkTVH6gXed4sqRnrr05Q7TXv71PHX3kbh4mn8jdhgCW70RR\r\nQeSmCnfJ5ub9kCzmqrXfLrXHIHemw1+DaTVh/jHvu7m9LKZ9H0DEvT9+uhF4\r\nQ+XOfwjxoNxrY541VqLqcC5mKIBveYDyi8PZDCLZ66L9Nn285hVeP0CpsyS+\r\nFsV+H7k5ebonGsfoltQUDEtYxN5g4jEs6yOc1wNsm4/yYDuI3WLAhDw15N6t\r\nqEu/GUdewQPcBCh4h4D6EdgCFOEP5Bmohb5GDYgrKSi51djhnFPy0Q9vKSJo\r\nXETOr5Z1T/M/21130Tgap43Jbp2JXs+eZ/6hurDFjq+420DcdxN9Kus5hKcO\r\nlnkEFTjVdcHA1ENJ7Ew3Vv7FUJTmXCfth09hV/LTu3eQcS4q4PeJl5ysG3De\r\nAo4OyZuaMBm4le7QLk4IaMKQvALrs8n/IAMAOW4wuyCTPLetEX0hsjuB20q6\r\nVnhS8Q0HQe7bwCKzN23h3Tqd3hv8rsDsKOPR3LmfI1F46gZRxlux3fXnZ/SI\r\naMELlhHblQiWkSj2iPwS3IEk+C7AggmpqIYKbrcrjPUFbgp0NnIK5b55whiJ\r\nC3jy2ihiME+E2a7eDJUkXoEtlRWzwXPs8ak=\r\n=9TnC\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.8.1-unstable.175_1673770013021_0.9336561720348755"},"_hasShrinkwrap":false},"0.8.1-unstable.176":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.8.1-unstable.176","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"^0.3.0-unstable.2","@sphereon/pex":"1.1.5","@sphereon/ssi-sdk-core":"^0.8.1-unstable.176+f57ae17","@sphereon/ssi-types":"^0.8.1-unstable.176+f57ae17","@veramo/core":"4.2.0","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.5.0","@veramo/cli":"4.2.0","@veramo/did-provider-key":"4.2.0","@veramo/did-resolver":"4.2.0","@veramo/utils":"4.2.0","did-resolver":"^4.0.1","nock":"^13.2.1","typescript":"^4.6.4"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"f57ae177d5df83d347401dc57aa4a887806e56ea","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authorization request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst authorizationRequest = await agent.getSiopAuthorizationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authorization request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationRequestDetailsResponse = await agent.getSiopAuthorizationRequestDetails({\n  sessionId,\n  verifiedAuthorizationRequest: createAuthorizationResponse,\n})\n```\n\n### Verify authorization request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthorizationResponse = await agent.verifySiopAuthorizationRequestURI({\n  sessionId,\n  requestURI: createAuthorizationResponse,\n})\n```\n\n### Send authorization response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationResponse = await agent.sendSiopAuthorizationResponse({\n  sessionId,\n  verifiedAuthorizationRequest: verifiedAuthorizationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.8.1-unstable.176","_nodeVersion":"16.19.0","_npmVersion":"lerna/4.0.0/node@v16.19.0+x64 (linux)","dist":{"integrity":"sha512-SSSWCab/kGztZEd5qI2xKBoAzprfmD/6iKas5/CDDa58JBP5c4Hx3yntWA4oxRrPBgtt6qMRoeEGrlSIoV82IQ==","shasum":"e4a699c00a0ccf8112fa963751a88966cf6091b6","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.8.1-unstable.176.tgz","fileCount":24,"unpackedSize":102679,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHHzDJyGLAU2tVdwtpL6yNuXsJwepp80z4nEbl6w513bAiAWyXoTIvA1S6GAD0rdMx6UOR+bN5nilAzgziRLfDgqPQ=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjxLHUACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpQeQ//ZvyeCxQCtkPsk9nm6TugBIXxC40z64ih1dX2+drigTI+z9i0\r\nNtmWXfT3pEm4Ka9VEQS5yVw7j2oJVv5OUK23ZlhMYWCUWbcyTwJYGv/PDUV2\r\ntLt3utiiKnSfFaW01YvCdsFX2AN02GicBQ/TJQpku8jPALiNw1ifFM+tbz4T\r\nW9kYWK17u5m83OQU4nn3CdMNyZw6jCcqB8zJ0y3rjrq4NYnXxeiinjufd29U\r\nv9yk5RFk0pb6j2xqB4boLRiccsl4+R8I9oqd+BrYm6daSnx8l3BjJieLkcKR\r\nI47EESGn6sP7Qgbd2KWILNf0/QagRGhwQFsLio3XEgJW7zrG0RsDs7VipYmr\r\nGIRuFVgrBCm+blQD0fbPvEqBou9YQGHo4sjvc3+6moHEyTQOziiE1xOz8pLz\r\ntyjselNILJpaCO9z9m7Fn6EQz/WGdstE2ZsVdOFJL0zI77Lqoccb3ti3QuuA\r\nGhM5DEiSKijo/DQ20AD/b/o6D0+Hiuk2t9B7ZH2zJscdZcoTqaJ2HMFQsW2p\r\nbS0UNoU3jarOP1VB2WnEakxE+tiiW1D4qPUPrk1pg04WI6b0FSivLF+oS1N3\r\nytFFk36l878tVftu+VWiJ7fPsvCrWykIp3jo+6zqgk4nGLyul0FJjXrwROlv\r\nmxj29tLOUNJ51as6U6+42xbQdHFohOBe5VA=\r\n=QA85\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.8.1-unstable.176_1673834964574_0.13470339092329975"},"_hasShrinkwrap":false},"0.8.1-unstable.177":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.8.1-unstable.177","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"^0.3.0-unstable.2","@sphereon/pex":"1.1.5","@sphereon/ssi-sdk-core":"^0.8.1-unstable.177+4d82518","@sphereon/ssi-types":"^0.8.1-unstable.177+4d82518","@veramo/core":"4.2.0","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.5.0","@veramo/cli":"4.2.0","@veramo/did-provider-key":"4.2.0","@veramo/did-resolver":"4.2.0","@veramo/utils":"4.2.0","did-resolver":"^4.0.1","nock":"^13.2.1","typescript":"^4.6.4"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"4d82518653ff456383561c22870856f110976aa0","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authorization request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst authorizationRequest = await agent.getSiopAuthorizationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authorization request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationRequestDetailsResponse = await agent.getSiopAuthorizationRequestDetails({\n  sessionId,\n  verifiedAuthorizationRequest: createAuthorizationResponse,\n})\n```\n\n### Verify authorization request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthorizationResponse = await agent.verifySiopAuthorizationRequestURI({\n  sessionId,\n  requestURI: createAuthorizationResponse,\n})\n```\n\n### Send authorization response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationResponse = await agent.sendSiopAuthorizationResponse({\n  sessionId,\n  verifiedAuthorizationRequest: verifiedAuthorizationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.8.1-unstable.177","_nodeVersion":"16.19.0","_npmVersion":"lerna/4.0.0/node@v16.19.0+x64 (linux)","dist":{"integrity":"sha512-XeamOiR/f4jQd+KZ63TL4Aam1RzNydfuwlgJiuLb+8FkVQ4fSftprz27vwl+pK8jLnLbev6rL2W+XPbTEFhgPw==","shasum":"4d7db7f984ab44ce958f04d3ee2f3c3b92aeb145","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.8.1-unstable.177.tgz","fileCount":24,"unpackedSize":102679,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCu9zEYRifcLzMPlE37rMhjTYfaklticfsV0utHs4emmgIgadP/+dz2gnsQJ4jwNkw1vFilmony2L9Twd7GzXMnIYk="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjxNZWACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmrg+Q//XWpqVJkFrtDmCV5P7jE9DVktoTz5QPjvDm6yVOrt1RcaGK2Z\r\nAm4n/RNIG6g0vVby8IsDsMmdcTeGL+MTgcwRZSBQPYFSDJvW3W29MoPBVqZG\r\nG/9H5MbP9f75WUZWob6yeAcISAZH3ZZPc25zYF7acv6IEqgI8xKEBQV6vqAw\r\nstPpLV75UmnJE5+ljUDz+qIalNPRBcsXBGWPfn3eXEVVoZ0E1KO38zh7+c6j\r\nXAXBu1kIGJ2H3O/71dTBob4qq+6rhMk0I9MCxTCJdqlDvionchTHwXsPBSHD\r\n1mxCEwOqhywIDWBRFwvLEJ72kaQpd5hhlETJkEt3N72Hj7gJiHm9nww4AK1n\r\nLemgYHGp21jMDTeIEupm2VTxyVUN4kkQkTRfJL3/JIbtLYmDWVXwfeij8bFJ\r\nT4SjaSclQC43AHvSkb1vDeSrQjT54I5l66kCLDi0PW7fVYVa7pu4PRjUsnDw\r\nLuA5YO+Xe0b4Jh3KDcbbzDEbYmtwA6NBH8c9maBUNODuV90ISJ+1fGVuCPEu\r\nmUPcdxAIMZp3Ftor66gnsToXf2m5niLRWOo849VYbhuMkhO0T9aS9/8k+cUw\r\nAPw6Gt8I4juzoNCBjw/DOsR+DzM9u2VkLkK081kRf6UScEWu3h5wNzYrIfqU\r\n8fvvl6t9oz+vhTxDCtAUakSZgSFlZOnoArY=\r\n=WBqh\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.8.1-unstable.177_1673844309864_0.8720571579450842"},"_hasShrinkwrap":false},"0.8.1-unstable.178":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.8.1-unstable.178","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"^0.3.0-unstable.2","@sphereon/pex":"1.1.5","@sphereon/ssi-sdk-core":"^0.8.1-unstable.178+5f183ce","@sphereon/ssi-types":"^0.8.1-unstable.178+5f183ce","@veramo/core":"4.2.0","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.5.0","@veramo/cli":"4.2.0","@veramo/did-provider-key":"4.2.0","@veramo/did-resolver":"4.2.0","@veramo/utils":"4.2.0","did-resolver":"^4.0.1","nock":"^13.2.1","typescript":"^4.6.4"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"5f183ce655a40332a65480634b356ae8fa4d7a84","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authorization request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst authorizationRequest = await agent.getSiopAuthorizationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authorization request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationRequestDetailsResponse = await agent.getSiopAuthorizationRequestDetails({\n  sessionId,\n  verifiedAuthorizationRequest: createAuthorizationResponse,\n})\n```\n\n### Verify authorization request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthorizationResponse = await agent.verifySiopAuthorizationRequestURI({\n  sessionId,\n  requestURI: createAuthorizationResponse,\n})\n```\n\n### Send authorization response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationResponse = await agent.sendSiopAuthorizationResponse({\n  sessionId,\n  verifiedAuthorizationRequest: verifiedAuthorizationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.8.1-unstable.178","_nodeVersion":"16.19.0","_npmVersion":"lerna/4.0.0/node@v16.19.0+x64 (linux)","dist":{"integrity":"sha512-ywlMWe2mBSukj8cS9lawwaHZiLBa1v4cbzfQ+XWFE1BYPW/lmXtfqseM2bxoKmcJjnDTqqHv0qNqHppykMZjxg==","shasum":"20bca136f17f36e41c7b67140efab019621f24f8","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.8.1-unstable.178.tgz","fileCount":24,"unpackedSize":102679,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDQKWGcY6wkv6CvOSOnGC1F5dQvnqqqQ4bMhjxEIBkRuQIhAMFn5JlZVrHYbi24rqcxhaEeyFdGD+g5FIQzPzWjS75L"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjxNn/ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqnWhAAhvkOoWpbk7By9Vk8bc3O3g9rNuvEPl7jRwUGxAM7Bw4mRHrL\r\n03QFQSDTRedVqjuIWoEiKrTf0rRfurCuBkV3EJiS9gI08wNDACZm3FWOrEjr\r\nMk6kGL6mmJ22tEiXhOysb2RjH9dkQs3ysGfQlJgIB8MCK0C6sYN3tvVWfl+4\r\nZpSd3eJYePU6J65x5asdTUhl3zlp5UQKep2PpWFXfuULIUFOwRGAF49tZKk+\r\nOjRY8EXlMUGPn3ONVUIiRB2RGhRxlJ9QIk9BqF1iSut/UZ0j5n/ZjKYg2Edy\r\nJ8kY7k6mu8wTTACFr8qJZJUc6hm0bgW7BYbzXoXr48biu0jV2UM1F7kD4Kep\r\n1vgvx+rEGK2KsAx9BZO8ykTVbsnH0BeugGMp76OolqKFIRw8LTXpz802ubKC\r\nR6UiL5aLY6LMSUICQwxUlAIzd58gZQtyEc64k0yqj6Wn0II6GBa2S4cpV7R2\r\nq0aqKWhXzRW7NJZyIt/NotsC/4xNJ41crhSdq3WMztXtCo1qBKHe3MIc/ZXR\r\nuPOOPyf36i9fyNwPFdhDgm9rJz2hMzaKEx6n3y+AcgU/XN3NQ1SCITMv9DDH\r\nKmquhIKow9Z9gMCnrFN1KgyBKd3oiub3daPSrIMqiGNJRr4ok9Mb0bqujRyQ\r\n3ujicfGBm0/PFjCFdkRK4YBhb/yu/0B3njQ=\r\n=TDx0\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.8.1-unstable.178_1673845246735_0.6752046866671448"},"_hasShrinkwrap":false},"0.8.1-unstable.179":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.8.1-unstable.179","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"^0.3.0-unstable.2","@sphereon/pex":"1.1.5","@sphereon/ssi-sdk-core":"^0.8.1-unstable.179+2e97af6","@sphereon/ssi-types":"^0.8.1-unstable.179+2e97af6","@veramo/core":"4.2.0","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.5.0","@veramo/cli":"4.2.0","@veramo/did-provider-key":"4.2.0","@veramo/did-resolver":"4.2.0","@veramo/utils":"4.2.0","did-resolver":"^4.0.1","nock":"^13.2.1","typescript":"^4.6.4"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"2e97af6eeab2fe0530cd12425fd6eaf72f42a012","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authorization request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst authorizationRequest = await agent.getSiopAuthorizationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authorization request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationRequestDetailsResponse = await agent.getSiopAuthorizationRequestDetails({\n  sessionId,\n  verifiedAuthorizationRequest: createAuthorizationResponse,\n})\n```\n\n### Verify authorization request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthorizationResponse = await agent.verifySiopAuthorizationRequestURI({\n  sessionId,\n  requestURI: createAuthorizationResponse,\n})\n```\n\n### Send authorization response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationResponse = await agent.sendSiopAuthorizationResponse({\n  sessionId,\n  verifiedAuthorizationRequest: verifiedAuthorizationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.8.1-unstable.179","_nodeVersion":"16.19.0","_npmVersion":"lerna/4.0.0/node@v16.19.0+x64 (linux)","dist":{"integrity":"sha512-DXQMg+j8dE0lYenDN48C93fEcZ0mDbZ9i5coFWeIecnrjHFSO4dx0jdWww7dGe3u52iaHlO2HJVwQ83INX+iVA==","shasum":"e363b9e56ea20093c3f01be97f92315357fa1ffd","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.8.1-unstable.179.tgz","fileCount":24,"unpackedSize":102679,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHs3i47wCxVl37EjCl8TdhUfAprz8tkL8pQ40I8nf9BNAiEAy1V1r5KmT5JxxvaZjtZ62XgE8f9pedXrEiujniSaliU="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJjyesaACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrsUQ//SVObNL6rStmfrsTiN0ry/MHyHx0L0x+N14hPR+iYGHh8L7+R\r\nA9T1Em3arnXp9JaSxTiwXSY8PU01uXygZ95P1tbAGDLKKZdxXI4q6DhvEDkt\r\n1JOSWlYO5YF8ALpr+7gbSM2ohUUt5mNMcTkFNiFso4BC5PzRlU32ftdEdh4h\r\nYPbHCZiykLG172gAr6s32Kf3/f2pCOCScgXoZf0OYIXk9YtEkxm4nxVvkP3/\r\njLvEcttGUGTlwDVQMZzdWAhVVXoRy92OyrNXMO03aiI0EfIwjhWhM9tELuu4\r\nBcJt3rk6p9kZy7/3pSFE/IGCS45yLu20D860wD8nUBPPsz9+yHTjxalTnK/V\r\nfjE848ds7zoPVS75ZBfs/lapKJSDHtDWDkIjCRxAmS7eOTn2FkAOPqBFYcni\r\nOrfqGoeg2uLpSg7yMZPPKnlqJKJA3879H77lrVT3E4/QnH2jysCh4HO+NUDo\r\nB6gk2i3MPg6flOiI0NB5Dnjc7uxg/19UFviiB1wCiPwPbFZvYWYiDxZvc/Iy\r\nEvMsDo/NpxzOaRsUm6fXLb+TjysJlj3ylQ8KWjB87bb+obgcdU/wmrjDQusz\r\nkcu3zioJh9ZhQtFuHX6WNrtmF5pyri07gY96B0ReT0h98+1gQ0GfeTj1ZXU7\r\nVWQA572puj1TOYjeOnYp86zIUMdV4oOI1Ww=\r\n=Bi88\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.8.1-unstable.179_1674177306525_0.5281783533688067"},"_hasShrinkwrap":false},"0.8.1-next.179":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.8.1-next.179","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"^0.3.0-unstable.2","@sphereon/pex":"1.1.5","@sphereon/ssi-sdk-core":"^0.8.1-next.179+176cd05","@sphereon/ssi-types":"^0.8.1-next.179+176cd05","@veramo/core":"4.2.0","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.5.0","@veramo/cli":"4.2.0","@veramo/did-provider-key":"4.2.0","@veramo/did-resolver":"4.2.0","@veramo/utils":"4.2.0","did-resolver":"^4.0.1","nock":"^13.2.1","typescript":"^4.6.4"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"176cd05cb2412a799a55a460f7983afbef80fa36","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authorization request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst authorizationRequest = await agent.getSiopAuthorizationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authorization request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationRequestDetailsResponse = await agent.getSiopAuthorizationRequestDetails({\n  sessionId,\n  verifiedAuthorizationRequest: createAuthorizationResponse,\n})\n```\n\n### Verify authorization request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthorizationResponse = await agent.verifySiopAuthorizationRequestURI({\n  sessionId,\n  requestURI: createAuthorizationResponse,\n})\n```\n\n### Send authorization response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationResponse = await agent.sendSiopAuthorizationResponse({\n  sessionId,\n  verifiedAuthorizationRequest: verifiedAuthorizationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.8.1-next.179","_nodeVersion":"16.19.0","_npmVersion":"lerna/4.0.0/node@v16.19.0+x64 (linux)","dist":{"integrity":"sha512-lNU1+9hFoOzOvRqfZKWd8fBFFnTllgoG1Oa5sr0Q5yxxUPfJFwhCM/wxB4n843tk9sbi8oIch9d8u771hkJ8rg==","shasum":"478a5cac5c9d0a71af873a7db8a701784212a25e","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.8.1-next.179.tgz","fileCount":24,"unpackedSize":102667,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCeU0fg4DE1fwFmU4OtaHan2ga+lZZ1KQoAzZ0PYK7lQAIhALVLVSVpcadh4klT/aak/VGNXTE24jcioNVo5FIrblKF"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj0aCIACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmoxug//WitDickzV18lG5tELliRESc52zFZU8rU3euuUZ1//1oFSOXr\r\n3LF6zCaBf5J4CcvMIICybFjrOqJMQPAQW+bpotf2eX/B4rMEfIRTkr0uePnl\r\nkV+svwQK1V1VnqgQV9PALAjclADbm1MLitMKit07osiWInfhATJd9RmFPPMS\r\nG7eNlY4BNhrwb9hYpislpndK/1QW7Ip/Ikp50kbhafgy1LZ70IyJwGB9FRHq\r\nxH0NeVHEcPogzbcb1RQ7V8fxIeJdhzj5mBe4nvXRluDSJa5ProIUctGRqIuk\r\n9xgiMX8WieDBUfb2q1VFWm1FqsPPfnGw4v3YOyvAJu7ePvj+XLWxZSmk46G8\r\nv30edRaDX+2fJ5IJHZEQguZPBSZK/Nu4YU33/DyCwuHSZ4M/bjscg96hKeYP\r\neI91/tfU4cOZqsEMIuD/oMexkpXVUJdT6Lh5puBACWPy3BurXRkaYUDf1yI5\r\nUNGs4rzePQQLT0pilwSe0wykcYgqiRSkIyrx05R/ir9SKhR3i4iL/jGmxWqt\r\nbL5aqMZNUUeS0+hxpwQFBMd6fO842SINqhwRmzW/fEHB5m94ZoJ8WswyyARS\r\nF+OUwKKOARtNqBJJKBG0L/AldX4xcOpqOaFdsrwvId69/I5KxeLVnuuf98Mx\r\ncYDdvzjpa1QgA3x7ZMWwwQwzfA2NQ6QtVNY=\r\n=WHX6\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.8.1-next.179_1674682503983_0.29229601668508853"},"_hasShrinkwrap":false},"0.8.1-next.190":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.8.1-next.190","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"^0.3.0-unstable.2","@sphereon/pex":"1.1.5","@sphereon/ssi-sdk-core":"^0.8.1-next.190+35cba86","@sphereon/ssi-types":"^0.8.1-next.190+35cba86","@veramo/core":"4.2.0","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.5.0","@veramo/cli":"4.2.0","@veramo/did-provider-key":"4.2.0","@veramo/did-resolver":"4.2.0","@veramo/utils":"4.2.0","did-resolver":"^4.0.1","nock":"^13.2.1","typescript":"^4.6.4"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"35cba864cc44acdaa17e4d81f6215282bf80e9ca","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authorization request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst authorizationRequest = await agent.getSiopAuthorizationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authorization request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationRequestDetailsResponse = await agent.getSiopAuthorizationRequestDetails({\n  sessionId,\n  verifiedAuthorizationRequest: createAuthorizationResponse,\n})\n```\n\n### Verify authorization request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthorizationResponse = await agent.verifySiopAuthorizationRequestURI({\n  sessionId,\n  requestURI: createAuthorizationResponse,\n})\n```\n\n### Send authorization response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationResponse = await agent.sendSiopAuthorizationResponse({\n  sessionId,\n  verifiedAuthorizationRequest: verifiedAuthorizationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.8.1-next.190","_nodeVersion":"16.19.0","_npmVersion":"lerna/4.0.0/node@v16.19.0+x64 (linux)","dist":{"integrity":"sha512-nIEicz/Fc7KzYo6M43Wy2FsqQ/S+IlV+4BkoCMUHjLJS2OEVts46PQr7gIFIXJIjz6xpDUgX0guas7nyC4d/hQ==","shasum":"0e3c5fa7e66f9eb08643408f1ff9f38e0a970c3f","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.8.1-next.190.tgz","fileCount":24,"unpackedSize":102667,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCEDrKKIlb+NFsMtKwEXcBXsm5SNbeCr1FYnqSo5NWr8QIhALhc4FBjelBcMf3Hq0ZztdDqyESm8Wr++XmhJPJviBaJ"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj7f+LACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmomzw/+JrGgFOh2AqLYVG9LLSkhAkU7wLrUrQfwjZ7BXVcZk59PjYgx\r\nPzHt1k5xUKwUapB4pRDfsVoeHMdUGYLC/YOrAUuDHOGfomswJeedvbHxdDUz\r\nZmPXooFekZXQFw5zBEBxRjy45XZob01eTb3Yel1evaLBB+dof1CeC+veGm+W\r\n+tEl/nkAI5oEVZOKiHodHir2U/bFcD9u9AQUVbyl3amQuAggfaej9dh/4Hsx\r\ntvIjt/+/W0bDuoP+cexi/aK1FTyy9URT6MVMhg+VoKkswvwoiN0N5Y5cb6QZ\r\nI+UV3uWfOpOgj5W58YfrpOhuoSzgZMYoElJB3WXxPwDQ0RDzI2oIsdz41DaF\r\nYarHgTsToAkp+CxsMuP9qLUkW2jOE1ExWlmT5t9cprAOm6by4OHagPrblnOu\r\nQoH15mQtBNgtVpOfWFprTiwZlnFNDiFfZ1heFpD+vsUs94EyysvDtmFC8+4m\r\n6vXgZlBNJhFavzR2YRGiAxb9LhCNH/dmSZTxhxTuTByTs1KLBfH50pRWcvZw\r\nX3ah7GBCVLNUfOAPfkqoXm6vc1gdgPRCpqzhlBebbwAvql9tHKAZuwl0Qw1I\r\nBlG62BeCTaUQtapO/K1OQjsoMTY+IWcpY22qqItWSn/pzmdNKyC6JWxsbnXg\r\nt+roLh5ApxuibXrYPGuzRTeRPj8U/EfYsA4=\r\n=pqW5\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.8.1-next.190_1676541834818_0.07643224799121162"},"_hasShrinkwrap":false},"0.8.1-next.192":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.8.1-next.192","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"^0.3.0-unstable.2","@sphereon/pex":"1.1.5","@sphereon/ssi-sdk-core":"^0.8.1-next.192+7033a2e","@sphereon/ssi-types":"^0.8.1-next.192+7033a2e","@veramo/core":"4.2.0","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.5.0","@veramo/cli":"4.2.0","@veramo/did-provider-key":"4.2.0","@veramo/did-resolver":"4.2.0","@veramo/utils":"4.2.0","did-resolver":"^4.0.1","nock":"^13.2.1","typescript":"^4.6.4"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"7033a2e5a80935335e5ad7989f1c03850270a986","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authorization request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst authorizationRequest = await agent.getSiopAuthorizationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authorization request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationRequestDetailsResponse = await agent.getSiopAuthorizationRequestDetails({\n  sessionId,\n  verifiedAuthorizationRequest: createAuthorizationResponse,\n})\n```\n\n### Verify authorization request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthorizationResponse = await agent.verifySiopAuthorizationRequestURI({\n  sessionId,\n  requestURI: createAuthorizationResponse,\n})\n```\n\n### Send authorization response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationResponse = await agent.sendSiopAuthorizationResponse({\n  sessionId,\n  verifiedAuthorizationRequest: verifiedAuthorizationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.8.1-next.192","_nodeVersion":"16.19.0","_npmVersion":"lerna/4.0.0/node@v16.19.0+x64 (linux)","dist":{"integrity":"sha512-1oW8XVUEPWH0MHuILHMI2c5KrSqvfuZD9SR3MqSFG/IjQQI1xa/CVr70zoftpOTVhzpDSYk0preDAiRPxPgDAA==","shasum":"42769f45c83dfbc55631504a73c29dcbcbdba157","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.8.1-next.192.tgz","fileCount":24,"unpackedSize":102667,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIB/9spY6s1eRv0ZcennXe84jxMiihRv2xhwUniiUXs03AiEAmi6Hp3oeLBenOG3dhGSzh+4D2K3+NJqNwrcVoyX/2k0="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj76TAACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrmSxAAmwfhR9UNETL5VDid4sJ7Fpp/DnUn2yd7jVHDKmlGb26lKtsc\r\nRFA/uK3ZzDcIbOZtU9tM6MQK2uKk24o82hrWI11rg/VyzyNWDo0WzVLS4+3c\r\ncUKZyEi4q5tFWJfEUKrYcWBSdosiUgfM9XrXqVTfehrwz+SFMTkZpHr2PIl/\r\nGb2DxI1gSRwA8H93JsOUo1M+FvQsl74AmQslbFKghDBzqNyGiIPb5mWc2ux9\r\nK4az+1IaQvjoTVrfrwoWoJMo2cZnQtcVAb4x67g4jkHsincCEQG3GvmCxQV5\r\nN9z5ZSwc+JR+6XlEVuveTkhbhozuThMnazC3jEo0V+aa2rfyHb5dvt/QWwaG\r\n/4rGufEL6RQlm+mAb7+IaKSI7PVI/Mbvbk6phYQObP80Kc17BIf8kIEmsRIo\r\nmtFOIBxZzRfZGnCo6smOgrI4/DrwuhJ2j+yybsJkPnOSY851vc5MTkext/BL\r\nLo+B4fLDSNp4mZ1T2irgfqHwb5q4cJwxXu3/ZKUCFTFO7t6Yyxm519POhsUp\r\nXNLCYuBffnecUSkTD8/MicrNozzdyLdCCZynNyMGb/mt4TALSXpyo4CRymv5\r\n6kyF1YCVjXR5cYEd1efS/eKTSILIzDtUlKt1JDPnz3xA52/O1K5Mpf4iT3h+\r\nFb4B5c9L55Ip6amww05eU3DsTNTg41LTey4=\r\n=FVEh\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.8.1-next.192_1676649663831_0.12006235851168268"},"_hasShrinkwrap":false},"0.8.1-next.194":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.8.1-next.194","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"^0.3.0-unstable.4","@sphereon/pex":"2.0.0-unstable.5","@sphereon/ssi-sdk-core":"^0.8.1-next.194+1db71de","@sphereon/ssi-types":"^0.8.1-next.194+1db71de","@veramo/core":"4.2.0","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.5.0","@veramo/cli":"4.2.0","@veramo/did-provider-key":"4.2.0","@veramo/did-resolver":"4.2.0","@veramo/utils":"4.2.0","did-resolver":"^4.0.1","nock":"^13.2.1","typescript":"^4.6.4"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"1db71de2a69c72a14bf393d8093e559554f2ab34","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authorization request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst authorizationRequest = await agent.getSiopAuthorizationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authorization request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationRequestDetailsResponse = await agent.getSiopAuthorizationRequestDetails({\n  sessionId,\n  verifiedAuthorizationRequest: createAuthorizationResponse,\n})\n```\n\n### Verify authorization request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthorizationResponse = await agent.verifySiopAuthorizationRequestURI({\n  sessionId,\n  requestURI: createAuthorizationResponse,\n})\n```\n\n### Send authorization response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationResponse = await agent.sendSiopAuthorizationResponse({\n  sessionId,\n  verifiedAuthorizationRequest: verifiedAuthorizationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.8.1-next.194","_nodeVersion":"16.19.0","_npmVersion":"lerna/4.0.0/node@v16.19.0+x64 (linux)","dist":{"integrity":"sha512-R74/SW6gJpdnNSgmWH+RgSOSSFBFKlFZjveEVob5cqU7hfRljwPgop92xo9XoQlvIWAo5JlqvJYoLtIm4aK0Hg==","shasum":"836c291ec9131b340087a16d4e277b3331bd052e","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.8.1-next.194.tgz","fileCount":24,"unpackedSize":102678,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIChSSQGXi2vEx2cKXtcswFHcV6kqsyRrNYNjYSHl8/DzAiAs3WQ/lpkBWVOQopx0iwjVawWjYlngJC9ZbP5ay97yjw=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj7/nqACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmpe8hAAlMdPaod+7MFdnHH5cpzjFFiZvjRhO6l9DLU7CsO1amau7gWT\r\n02CdOJ0w7eejo/mPpgUmSbfC2aZhrXbzD0QOQ4wc2fAxuvtaPow7c9uLrtQT\r\nGPj3gIxQF/qSvkixJ/+UeyVezXd5nLWx9hxV+AQgkhHXtgRJTGhd17JiQl13\r\nJmQMePa6++LGD8qHfbBYn7NvVVRcRc+Qafm3x+9Y+EJIDN67RL0rmogvwMvk\r\nEZeB6JlxzNGL1ukBIDZtL+GA1PiAfjXf2knDbs0ykVbe9U1MpnQ41VE0oe2/\r\nyUDRX3hKfLi0cEgdZZ+XMIsqXfs3ZsZsrvirpnYTC6To5zjYkXIr4Mj6lzEJ\r\nMJMMCFD3/OBSRXtKGw9OqEV45x0ZUOoPU+4ei8JLBhSb5vw89ZiG7kq0l/98\r\n/uk0xg5kgKlzTbs37s6uK0P0Irekp62l2vqWm/pxT16A/Y2bDiM4uXkvyS+A\r\nD3Bn6pTcPhiP0kO2b7WY7MA0ZFw8iY3DsywQhmqqVBRZM7OyQH6NNcT4QwY3\r\nDyhEI+vCUlBc2r4fPSsZF7tqDg635zFOLAt9PEOTHsakjkEEEbk6vymV3oPq\r\nmCTqM+ACYwIdVgrmTBTD9V9yAAKjwTumbChQA45XxCYHnPAZiBkNyrsUMgBp\r\nHfT6rbXsUinkMd4yMO/hK+lHK5RmtbRfTcA=\r\n=taEk\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.8.1-next.194_1676671466465_0.3055705911483857"},"_hasShrinkwrap":false},"0.8.1-unstable.195":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.8.1-unstable.195","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"^0.3.0-unstable.4","@sphereon/pex":"2.0.0-unstable.5","@sphereon/ssi-sdk-core":"^0.8.1-unstable.195+926e358","@sphereon/ssi-types":"^0.8.1-unstable.195+926e358","@veramo/core":"4.2.0","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.5.0","@veramo/cli":"4.2.0","@veramo/did-provider-key":"4.2.0","@veramo/did-resolver":"4.2.0","@veramo/utils":"4.2.0","did-resolver":"^4.0.1","nock":"^13.2.1","typescript":"^4.6.4"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"926e358ef3eadf19fc3c8f7c9940fe6322c5ff85","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authorization request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst authorizationRequest = await agent.getSiopAuthorizationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authorization request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationRequestDetailsResponse = await agent.getSiopAuthorizationRequestDetails({\n  sessionId,\n  verifiedAuthorizationRequest: createAuthorizationResponse,\n})\n```\n\n### Verify authorization request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthorizationResponse = await agent.verifySiopAuthorizationRequestURI({\n  sessionId,\n  requestURI: createAuthorizationResponse,\n})\n```\n\n### Send authorization response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationResponse = await agent.sendSiopAuthorizationResponse({\n  sessionId,\n  verifiedAuthorizationRequest: verifiedAuthorizationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.8.1-unstable.195","_nodeVersion":"16.19.0","_npmVersion":"lerna/4.0.0/node@v16.19.0+x64 (linux)","dist":{"integrity":"sha512-IqDpOq0Ytiw1S8MvnaCf7YyBdoyZXnyFsxxW2FJO2IZqzVz2xBkE5WWw43gsf9rNLYi++gsUGZFiyQHQ9dE1dA==","shasum":"7cef4f5477b0ea38d69ca901308e7185acfe5b5a","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.8.1-unstable.195.tgz","fileCount":24,"unpackedSize":103948,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCaGf/Ek9gc4/uL/g2Xr8DByTtrV/3ZEH+HbdBjlzhgFwIgO5GQ+nBmJYXlsSIfSl2uN8nC+/dMTjdHFDDfF350Rcg="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj8B7yACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrFnBAAhTn1RA1SQaTllW+IKllx0GX7HP6VWrp+3bJNmXvYzEcWD3dE\r\noZhMGZ9tcbW3L/i/+JJZDlLFVRpD0q5u68/JDml+Kw8YvMgC9INh2WVRVYuY\r\nBabhD/Uj2M/Pqz2rx4yloNEEma47R4cFPsEkyKNuwE62WKIR8opVDpdaf2GO\r\nd0Wa0+cgFE1XoLOnqS/mqDSOMIcF/imWxYAZw6oQdmDaPD681BsAG80LHuDO\r\nM98ETSEnZfffubZaDJBGNPIJonfYxkgNUGPoB4Mjzdto3y9vO5mxmi6Icmov\r\nLZXneVypZRTrzNIDBKfsjToXsIezwysWooTOSIJE/GV19I87F1jUn1C+zBXX\r\nCSmr9nE/ZoNFXrTeQhOIdti5UTloU/2COllAuZJRLFBw6O9S6bUBi6Nirz3C\r\niLDWBkICJd2pigz4Z6faGrIO0D3GnYbG8NdBTTPJDlzIureXl4/nvDFy4Vj1\r\nFHd1Y8vjg37j628dj4d7d6u0WguXxvcfNiq6yhwC/fbKMZKrLac4nc2AFij4\r\n2Lu/IR1anWUJ6Ng2eiERzwF0Ns+1mimEfMlLUxYJimmFhxda5qs1JBGMBKp3\r\neHomJzNn5xRqAUb73UbC4C+nuDkYdlvhs8eVqzNKIZtK4PSX3816xmaoJldM\r\nrTQ1KUiXJDz0ynDIMu71cAmXPsyi3z/tTAU=\r\n=ve10\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.8.1-unstable.195_1676680946396_0.27565529765784547"},"_hasShrinkwrap":false},"0.8.1-unstable.198":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.8.1-unstable.198","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"^0.3.0-unstable.4","@sphereon/pex":"2.0.0-unstable.5","@sphereon/ssi-sdk-core":"^0.8.1-unstable.198+cd7ce41","@sphereon/ssi-types":"^0.8.1-unstable.198+cd7ce41","@veramo/core":"4.2.0","@veramo/credential-w3c":"4.2.0","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.5.0","@veramo/cli":"4.2.0","@veramo/did-provider-key":"4.2.0","@veramo/did-resolver":"4.2.0","@veramo/utils":"4.2.0","did-resolver":"^4.0.1","nock":"^13.2.1","typescript":"^4.6.4"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"cd7ce41993a9558adccb4f960643151bd7523c4f","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authorization request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst authorizationRequest = await agent.getSiopAuthorizationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authorization request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationRequestDetailsResponse = await agent.getSiopAuthorizationRequestDetails({\n  sessionId,\n  verifiedAuthorizationRequest: createAuthorizationResponse,\n})\n```\n\n### Verify authorization request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthorizationResponse = await agent.verifySiopAuthorizationRequestURI({\n  sessionId,\n  requestURI: createAuthorizationResponse,\n})\n```\n\n### Send authorization response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationResponse = await agent.sendSiopAuthorizationResponse({\n  sessionId,\n  verifiedAuthorizationRequest: verifiedAuthorizationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.8.1-unstable.198","_nodeVersion":"16.19.0","_npmVersion":"lerna/4.0.0/node@v16.19.0+x64 (linux)","dist":{"integrity":"sha512-FuDQU3f1LFZX8lVvR7hIpMLdg45bd2gsZdPs6BQhwvs2WXUCATB+6HG/U1WBQhrqSWM3Hglp8z278pXGLacgLw==","shasum":"7538d90f926ffa6bcf8a462318944289c29d57e7","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.8.1-unstable.198.tgz","fileCount":24,"unpackedSize":110533,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHwXxI+0YJub9xKK1jLLma5joo/a6XqCnNtFEngpEJOoAiAZtGg+YQ92QRne4RMZrpRIBAYdtFSbdERfrW6knCVtJQ=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj8D9yACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqngQ/+KF+d1qOM00ZJn3z9ka8XcLH/1l96JT2lq3m7C/0Jqsn+7szH\r\nWsU02zVll5zaAt99Zcjq6WjrIHyC+Hkb5Nf5pM/s8j12zgEbdqhLB4NGM6go\r\nbZuSrMjhLnKMLA7swGFT3XxSojJEeYNeIJmFMc5CRNTnRppEGGSyB2V353JL\r\nicBwpVsgL4VI/7GcRqxvdRbMvXE8wcGq/D30q8NUskzqahY8vKKYX/2O1nFE\r\nv3GRpKJQRjKgOb66LRmRcI8DtuxFen5FHHflhli+ASpk8WcWLlIa/ia0S/3f\r\nVWyVJRyhWnNbBVuUiE3Ew0M/1J3xof+zT2VAf6cRpnaI2K3qKmSgzxzQXuzO\r\n5Xp5yHMJ7FDepu6z3BYGrKUwQJr9s8WbKemCRNr4MLU1vzE9O00/UJzCLNnc\r\nMCQpZqNz75pQVTiaU92vV6Lds9bPaum2V+ZwrTyrANAaQ2G6a65DbNQFqY+K\r\nrYlNhLxxaM1h/HQCLV092xWJUab/WZpKUP4SqfrLji9yziiHH38S8Hudk+Do\r\ncdNE9ALT1ldyCmAS3wb8pNxFu0CqVY4CKz+6RFsFzgkn58wrKuIFzplXTAwq\r\nXNBMSVfny4Y34ulb2XWhNgrI+RG93j7MWb7G7mMFue66/f+w3dTNcHN8lTrc\r\nrkG8AtF2pfJE2CeVO415NIXWCqtff0N9kIg=\r\n=VvWH\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.8.1-unstable.198_1676689266427_0.34235758947176875"},"_hasShrinkwrap":false},"0.8.1-unstable.200":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.8.1-unstable.200","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"^0.3.0-unstable.5","@sphereon/pex":"2.0.0-unstable.5","@sphereon/ssi-sdk-core":"^0.8.1-unstable.200+559efe2","@sphereon/ssi-types":"^0.8.1-unstable.200+559efe2","@veramo/core":"4.2.0","@veramo/credential-w3c":"4.2.0","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.5.0","@veramo/cli":"4.2.0","@veramo/did-provider-key":"4.2.0","@veramo/did-resolver":"4.2.0","@veramo/utils":"4.2.0","did-resolver":"^4.0.1","nock":"^13.2.1","typescript":"^4.6.4"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"559efe254d9b5780b8cd10ca8e70875c3c835ca0","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authorization request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst authorizationRequest = await agent.getSiopAuthorizationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authorization request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationRequestDetailsResponse = await agent.getSiopAuthorizationRequestDetails({\n  sessionId,\n  verifiedAuthorizationRequest: createAuthorizationResponse,\n})\n```\n\n### Verify authorization request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthorizationResponse = await agent.verifySiopAuthorizationRequestURI({\n  sessionId,\n  requestURI: createAuthorizationResponse,\n})\n```\n\n### Send authorization response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationResponse = await agent.sendSiopAuthorizationResponse({\n  sessionId,\n  verifiedAuthorizationRequest: verifiedAuthorizationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.8.1-unstable.200","_nodeVersion":"16.19.0","_npmVersion":"lerna/4.0.0/node@v16.19.0+x64 (linux)","dist":{"integrity":"sha512-ysV3dwVIdXwRj9UNvm1/jAKvySHxI5QKdMsS7G5vmCcD8YyEAzRFliQRijCWTFTR+fxg0o4fRZA+DyvoQIysrg==","shasum":"24b076e5244d6bdf3b90873e3662b38e2669ea21","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.8.1-unstable.200.tgz","fileCount":24,"unpackedSize":110533,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDirJyKvNBqNgG32pvFaDX+byLTcmgERHzeQ5CvyBTbgAiBE9+9dSPQHZ11+SPNGzjg+cf2S6xeyZmZ+N6rKAcDzrQ=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj8M+zACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq3PQ//ZgF3wZHqz9kTliberasJVvMBXFMM5mfVKLFKtfxGVcvG0URD\r\nIOr2oSNyyGlvicOGkbIA0L1Pkf0GpbTZTdPzoBjX93dIWbe8v93G5mB/b+38\r\nUlQdQdjGzrh1H7UXY2ordCzv1P3NIyrlUDpFWeO6cYLRpsO56YjinZh9BLZI\r\nsGETuYbt7cgQH9leMJc6vI5Dwx723ze/Jwv6nbSD5wp0UjxWXOQbBiVH07e9\r\nuKPvxYff9NGJ2FTsWnLNmrm+qPp0TE5TjWFNz3T47VVClHbGMs9p32Lkq2DZ\r\naWBUacc+RL5EYF9srYbBdzAGShDVKHhw3YzEAdT9xh7o6cp5qhFy6kjT+w4l\r\n4zXM7UqNBGizNdaCHpBBJfkKAJepZ7VK8NDlUT+I8IG9USI0CEk5iizFHepL\r\n85aovbLLYlS4QzzUXr80nnstl2MFZsnec9P2sOLytron3Sra4Zr6NgesgcEy\r\nlnmo2Ks7HjWcqJkPgrImCWWGbT1oULHPQQRPt5LEFTAkkrDCmjxwVFi7Vkml\r\nvwpXjdMUOfSf6aw/Hk+jxwzgOboqwBCNxrYqKgWbJi5lmbQ5gg7hkY++HGRL\r\nTzWqk9Dl855uefa1NxfPNqWq2C23nMryIgzVev/13b+7w2wesH/VTAZMzqus\r\n2ya0/iepNl4U4aUGfoYL6UKk+R9etHfsjJ4=\r\n=vHKk\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.8.1-unstable.200_1676726194928_0.9084929564549822"},"_hasShrinkwrap":false},"0.8.1-unstable.201":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.8.1-unstable.201","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"^0.3.0-unstable.5","@sphereon/pex":"2.0.0-unstable.5","@sphereon/ssi-sdk-core":"^0.8.1-unstable.201+f04345b","@sphereon/ssi-types":"^0.8.1-unstable.201+f04345b","@veramo/core":"4.2.0","@veramo/credential-w3c":"4.2.0","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.5.0","@veramo/cli":"4.2.0","@veramo/did-provider-key":"4.2.0","@veramo/did-resolver":"4.2.0","@veramo/utils":"4.2.0","did-resolver":"^4.0.1","nock":"^13.2.1","typescript":"^4.6.4"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"f04345b97ff9a78a3dff096599f0b675b3239a3e","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authorization request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst authorizationRequest = await agent.getSiopAuthorizationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authorization request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationRequestDetailsResponse = await agent.getSiopAuthorizationRequestDetails({\n  sessionId,\n  verifiedAuthorizationRequest: createAuthorizationResponse,\n})\n```\n\n### Verify authorization request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthorizationResponse = await agent.verifySiopAuthorizationRequestURI({\n  sessionId,\n  requestURI: createAuthorizationResponse,\n})\n```\n\n### Send authorization response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationResponse = await agent.sendSiopAuthorizationResponse({\n  sessionId,\n  verifiedAuthorizationRequest: verifiedAuthorizationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.8.1-unstable.201","_nodeVersion":"16.19.0","_npmVersion":"lerna/4.0.0/node@v16.19.0+x64 (linux)","dist":{"integrity":"sha512-WGOol6jVR1anUq37EwWUaeoK3aA1QY30bhfmv4vaBdq1NKPAdcegtVNgNYuz/Zh2bvYNfAY9kx6td7tk/4anAA==","shasum":"bc7491aada2a025eefb1461a79fe4769d21de56a","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.8.1-unstable.201.tgz","fileCount":24,"unpackedSize":110535,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCi70teOLqfPDOwHLEjYG89oKp9shPWsS6N+HvjgHBzNAIhAMAfxmcNQmkjLE0UPRRmVaK2l/MqP4t/3lECbfoMt2Xk"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj8NsSACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqBXA//dUBwtrhRDcSvIS3VXGpxEVCXuuFI2j2St/V0JZ9g+RMJnQmP\r\nnWWyEKnzy0WtIInksyy7aIQukDJLz10v1lohebf4j6XiDqqkVG+MEDW3mSM7\r\n9m4aGerlADp+RkY0KHC7g4DbtPxrQPu9anDeRlk2koawARUw2cvgplovkHR6\r\n7XuCN+BSsgc2FdUS3D6/dfTpmZsS5CsiQ9nDVAl/eBKehBqUCHX1Bwju8iIY\r\ntgDQuWmSHC0yV1CHkGTuuN/nhR8+Ria4f1NETvItGhZ6S0yCiqF4wUhuh8Qd\r\n1r65d5Ic8LygcBM7l6dKq3UUQeFkgOPJro8Grg2tCe+7cm7v/Iq5C+ug1QOy\r\nPiEsxpzgtosuzDLD5xW3n/iaZ6G78ixaIz1xgJ6VEtC1zbZ9pDCYYCpOnz+U\r\nIyGg/DgW0CXfQR0QrtDuuckyB6mFbbJiNPdYeFNoXlaDaeQWagRtov22iCbL\r\nZidO1b5dHHxvs4+kdHyxpgWQly5px7MumROqbxtWHpcW+KmKcH0XYngRrVv2\r\ny480JgtZOPzBYCcjKeCuBudVzUvWOtZIJTc2YaQ3zdZFeQvneufFZQzzNLJv\r\nzOmYmD9L5SfPh8O221V3l7DimLlqPBwmof9TehCv+2CkJqUiWzqm4WqukaUX\r\nu9Q4ChM49JPlIuZgsgu/QCmI1HYCM9kMw9A=\r\n=sKxF\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.8.1-unstable.201_1676729105869_0.07018239822261818"},"_hasShrinkwrap":false},"0.8.1-unstable.203":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.8.1-unstable.203","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"^0.3.0-unstable.5","@sphereon/pex":"2.0.0-unstable.5","@sphereon/ssi-sdk-core":"^0.8.1-unstable.203+129b663","@sphereon/ssi-types":"^0.8.1-unstable.203+129b663","@veramo/core":"4.2.0","@veramo/credential-w3c":"4.2.0","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.5.0","@veramo/cli":"4.2.0","@veramo/did-provider-key":"4.2.0","@veramo/did-resolver":"4.2.0","@veramo/utils":"4.2.0","did-resolver":"^4.0.1","nock":"^13.2.1","typescript":"^4.6.4"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"129b66383752e05ab3067e459bff591a07aac690","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authorization request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst authorizationRequest = await agent.getSiopAuthorizationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authorization request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationRequestDetailsResponse = await agent.getSiopAuthorizationRequestDetails({\n  sessionId,\n  verifiedAuthorizationRequest: createAuthorizationResponse,\n})\n```\n\n### Verify authorization request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthorizationResponse = await agent.verifySiopAuthorizationRequestURI({\n  sessionId,\n  requestURI: createAuthorizationResponse,\n})\n```\n\n### Send authorization response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationResponse = await agent.sendSiopAuthorizationResponse({\n  sessionId,\n  verifiedAuthorizationRequest: verifiedAuthorizationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.8.1-unstable.203","_nodeVersion":"16.19.1","_npmVersion":"lerna/4.0.0/node@v16.19.1+x64 (linux)","dist":{"integrity":"sha512-vsXuOmMg9XY8Wp/w1ss12lhpUsR5Ta6WojUVa+2CftLeJL8P3Ew6arg3pae9oAh9gszZaJ2ia/sHHShy1cLj9g==","shasum":"f13f538fcddc0275985df74f8d67e7df87efdb86","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.8.1-unstable.203.tgz","fileCount":24,"unpackedSize":112009,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDT/fgrSHg+rJOnilXrVmNldtjdxHfGOV9mvoFJ/htb2AiEAvn4Inl+v5YRp1iRDNKq2wOnJhAhEtPeEIuflp52UZjw="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj8VY+ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpYIQ/8DG8KIiJ+obHC98hGBdbcq4/SdjgRwterCZXOEAJvGJrxnNUB\r\np3g+QNJxG7kh820LuuGirZ2qs3iwpTGju4g7hOp+7fq1zmziU0EGz3poTXXt\r\n0I/sdrdilhUL4fgNgmInPzWSECvGlklnZwZHQm0xaAzRLYd95mFFJPDNU+CI\r\n0Z+/ZG9lJeBcmr06ehFmclf0cC8g1Q0DniUhZeUyESDv+l0WJ33NWjdV3eoB\r\n/IvjTmkww0yktDau6yS/33VuSKN1lNaH/OSRs66rCV/DNQa5VAnuhGOxLjsv\r\nSVGb3VEbPf5ff+8H5qDdeeMgcrBh+SPeK3zk2jqFoazOqYMBAuDqzMKbHfMU\r\nafDSxiHcEpMgDqczkdV51VK4vzQ6pgeXTJv1XV1HA2TPXQOy54ftgxnEekfz\r\nFnmKFekpibKcTC7rKWvh5586vVW6ucpnaMDe2p1A8IGkTynHQP/dQAhBgdJ7\r\nl03FxaGYp4Rka2rC8/QvWHV6usHK0GqAFWarB18mgq+92wqAn7sAS9L324f+\r\n7m+Ge8GsTZr7XoCFBYCDCQtURSBkY1/SAa0YTcHd/Ji7SQyabMB8Ai37P8Fx\r\nGwR6ZqQV4IV3FnYaJkiLjvAYtTTivay7nS7iX89y4P0iiEFZjh86j7LMZLjI\r\ngmp1R887uzSaxJVOR0mA7WAFlYb76wgyJY0=\r\n=9bdA\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.8.1-unstable.203_1676760638410_0.6435919017805878"},"_hasShrinkwrap":false},"0.8.1-unstable.206":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.8.1-unstable.206","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"^0.3.0-unstable.6","@sphereon/pex":"2.0.0-unstable.6","@sphereon/ssi-sdk-core":"^0.8.1-unstable.206+61712f4","@sphereon/ssi-types":"^0.8.1-unstable.206+61712f4","@veramo/core":"4.2.0","@veramo/credential-w3c":"4.2.0","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.5.1-unstable.1","@veramo/cli":"4.2.0","@veramo/did-provider-key":"4.2.0","@veramo/did-resolver":"4.2.0","@veramo/utils":"4.2.0","did-resolver":"^4.0.1","nock":"^13.2.1","typescript":"^4.6.4"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"61712f427df2d8f61f72d1e1887f1fed095f56e1","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authorization request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst authorizationRequest = await agent.getSiopAuthorizationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authorization request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationRequestDetailsResponse = await agent.getSiopAuthorizationRequestDetails({\n  sessionId,\n  verifiedAuthorizationRequest: createAuthorizationResponse,\n})\n```\n\n### Verify authorization request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthorizationResponse = await agent.verifySiopAuthorizationRequestURI({\n  sessionId,\n  requestURI: createAuthorizationResponse,\n})\n```\n\n### Send authorization response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationResponse = await agent.sendSiopAuthorizationResponse({\n  sessionId,\n  verifiedAuthorizationRequest: verifiedAuthorizationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.8.1-unstable.206","_nodeVersion":"16.19.1","_npmVersion":"lerna/4.0.0/node@v16.19.1+x64 (linux)","dist":{"integrity":"sha512-KpnQjOlFYcdwD1JMQyxMP7G4pv1kL6OT8UulVoW93IPesGhoqUOfR+UX9XGDhxPeR9531cs+byrVKWh0l/bG4A==","shasum":"264418e4a162981e27479e2ebc720301b8687d1b","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.8.1-unstable.206.tgz","fileCount":24,"unpackedSize":113634,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDlcKlGlWa8G84sdbyDsqVM0YfxU4QuKL3fckEG5ZB49AiEA58s4TaskXL8LiZV2UdUoT9GYEjldIUL9POhRvWRyJNQ="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj9CK5ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmolAg//fRCoi2/TUOCRs5IN681+lYNSJZ5mCj7elZZOFpGQpn9Q56db\r\nj7GoxNCgV7BJ/QNO3Nk/N6OyK5p/soNM6gCXO0zBKkgAOIVTGz8rgaLWCs9t\r\niIRr58aokLs5fAmcCjV0ePvhd1CmKcoW/aD/x4ZuMFd03XJOL3d7JY+BQHtQ\r\nbofS0LbEPOa6OQjXTMBTO/UlTNVKNYCaqK2b8/UE5XaMSdRj34rBbvL5Ihoi\r\n+OJmbye+rldLS/yEuhS12OE29ZnwjLriMWRse+/bCJ5foN/rutnfzzf1F7LG\r\n21ifvgH6ywWNADiOgumJHOA+tu2OxXgk8EV/ZGrvRwHQjQjoZ/kMHdcou8bd\r\niYohVa9lyZRv04v2RTWUIktT1LAc8jWuDCDznL/pzQh73Sc3xvdEAdn6mHOa\r\nESSALfgHnP4yfcJWJXiRKlhhwloWucRUFc8C80YNv8Jzss/FqsVpH/r2SKu3\r\nAmxlaRDA8XzME1RaTnmh3oChp8iy7xUYErixmX9greCanx3zSgN8UgcDrJMy\r\nF4oI4wSi15Nt+aS/J6TONnyfM3QDI4gKYb0IczE3eFMPFrZPyh/iW5OeFFQZ\r\n7XsGUFSMj373ZPIx9ymw0ifHb13isE4lgrIqc5Zm7gMni3exnkN+Dd1mMAIM\r\niOVZcBdIuRufShtMnX9DLHnnd6D5FS0V4zA=\r\n=e30q\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.8.1-unstable.206_1676944057367_0.37811288646814045"},"_hasShrinkwrap":false},"0.8.1-unstable.207":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.8.1-unstable.207","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"^0.3.0-unstable.6","@sphereon/pex":"2.0.0-unstable.6","@sphereon/ssi-sdk-core":"^0.8.1-unstable.207+8b4f22e","@sphereon/ssi-sdk-did-utils":"^0.8.1-unstable.207+8b4f22e","@sphereon/ssi-types":"^0.8.1-unstable.207+8b4f22e","@veramo/core":"4.2.0","@veramo/credential-w3c":"4.2.0","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.5.1-unstable.1","@veramo/cli":"4.2.0","@veramo/did-provider-key":"4.2.0","@veramo/did-resolver":"4.2.0","@veramo/utils":"4.2.0","did-resolver":"^4.0.1","nock":"^13.2.1","typescript":"^4.6.4"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"8b4f22ec199a2b9fcb297c705edfa4e3dd1be7a8","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authorization request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst authorizationRequest = await agent.getSiopAuthorizationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authorization request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationRequestDetailsResponse = await agent.getSiopAuthorizationRequestDetails({\n  sessionId,\n  verifiedAuthorizationRequest: createAuthorizationResponse,\n})\n```\n\n### Verify authorization request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthorizationResponse = await agent.verifySiopAuthorizationRequestURI({\n  sessionId,\n  requestURI: createAuthorizationResponse,\n})\n```\n\n### Send authorization response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationResponse = await agent.sendSiopAuthorizationResponse({\n  sessionId,\n  verifiedAuthorizationRequest: verifiedAuthorizationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.8.1-unstable.207","_nodeVersion":"16.19.1","_npmVersion":"lerna/4.0.0/node@v16.19.1+x64 (linux)","dist":{"integrity":"sha512-1FZ8pUhHjQX6X/gE/Us20cMZ/A0O1KTFG3l5wDB+mXGrP0P9wUHAUhiV/ykx9tV5htMR50rLS6jShXh1LGIDtA==","shasum":"7fa9f0833da7a822c3f4f6fd2650a273172de919","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.8.1-unstable.207.tgz","fileCount":24,"unpackedSize":113700,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC7UKv53m6N82iUrLEDFB8F6/SAH+jbjH16P/jzzssawwIhAPAoXIaAZ4Rzy413s5wVLInNdiZtqmJwhTRcswGqk9+W"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj9Cd7ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqQnw//eCnPAZUeYtDq1ZCpIzYhVwuj1RJM4pX9vJlhf+M0HeBRkdPI\r\nRpYm5NTnVcFXM5KmIgECNqWa/ItO2mt0y177OhLRSsD1F0ZX1QGsMU++1YN5\r\nrbBFQI/HvB4xTmSQ1EAM7F5cqrcURNjkpY0JDXngf/u8FAiIAxHn7wnqH/21\r\nRrAvNrDsxDdyQ6N0LjC4TjCzxZmXLZHdXUu7IHr9qcdOiW1/3i1Vd2DY36Si\r\nYx+BkeaGhGsHYtDxwg6VTU/3mJzRRlAM4Td0U8kwNGsBEfrDFhB1rRnGokbu\r\nroNesRWOs+sTOw9u2rpFhldzKezVb2Tg+qWqp2wfxfGRtkxfRKk3d5nDjdLQ\r\nmdbUVJHxTjjxGtZ6U9J/pdkIojIfGVGXlcrbRhLG3yXGrP4syeJKrMqK11X5\r\ncZRaSE/Q9rQpU0ItSrYMn+z+ywTFv07cPPFK5ZMUDSEsWOJEazgLQhvLOjsn\r\nN96GY2chsOlvizNbEPC2NggLBB19fdYbWN9y3ERRCYnlAOWYJqScy7Ceup3B\r\nZ4038Pp2b56uyKaFwewnQyqiKMXBUWrVNTlEkRiIbM+prCat3RpoPXqZNtxD\r\ngqWX0QhZyZJksWj742ToX8awZ7S+AUrt5eu4SiHzWy+ixGnlfc0kEW63qwZ4\r\n4RtQDXd/0MGihrjF8L0eNhj1ZL6Ziiyw7vE=\r\n=7/+K\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.8.1-unstable.207_1676945275717_0.8256976359258466"},"_hasShrinkwrap":false},"0.8.1-unstable.208":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.8.1-unstable.208","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"^0.3.0-unstable.12","@sphereon/pex":"2.0.0-unstable.6","@sphereon/ssi-sdk-core":"^0.8.1-unstable.208+2beea04","@sphereon/ssi-sdk-did-utils":"^0.8.1-unstable.208+2beea04","@sphereon/ssi-types":"^0.8.1-unstable.208+2beea04","@veramo/core":"4.2.0","@veramo/credential-w3c":"4.2.0","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.5.1-unstable.1","@veramo/cli":"4.2.0","@veramo/did-provider-key":"4.2.0","@veramo/did-resolver":"4.2.0","@veramo/utils":"4.2.0","did-resolver":"^4.0.1","nock":"^13.2.1","typescript":"^4.6.4"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"2beea04a6604d82b12ecbc11e68a9f41775c22ed","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authorization request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst authorizationRequest = await agent.getSiopAuthorizationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authorization request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationRequestDetailsResponse = await agent.getSiopAuthorizationRequestDetails({\n  sessionId,\n  verifiedAuthorizationRequest: createAuthorizationResponse,\n})\n```\n\n### Verify authorization request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthorizationResponse = await agent.verifySiopAuthorizationRequestURI({\n  sessionId,\n  requestURI: createAuthorizationResponse,\n})\n```\n\n### Send authorization response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationResponse = await agent.sendSiopAuthorizationResponse({\n  sessionId,\n  verifiedAuthorizationRequest: verifiedAuthorizationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.8.1-unstable.208","_nodeVersion":"16.19.1","_npmVersion":"lerna/4.0.0/node@v16.19.1+x64 (linux)","dist":{"integrity":"sha512-+j6RdYHT1j+G1U8BD5cKWpEAp0VJJT8dL2U8/n3ILZkBMejHcIhg7Jqy0r3jJixGKZZLK/1yW7oJwhyuOMK78g==","shasum":"b969c0e6b2fe64ca93c652211dbde68e33567e9c","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.8.1-unstable.208.tgz","fileCount":34,"unpackedSize":129621,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC3wqFxEnH2FS3vB0ftzBMI9FJ6GFl/wAunKiC9lKIvEwIgbrRnB2m87etdsVFuWvXZsVO0gfD6kMyOiIIdTAlrxXg="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj9YtyACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo8Zw//bxd/G0zFCVulX6liWgiNvvgr98Ik09byU5+fc3hpR5ljh6T1\r\nyicUXTRE3pwT9Ok4ZctOCZCCRUt59Az7cf9ZfKceWx6W25q7dvI7MJksveNM\r\nFx0WkTgs2uYreWL8Kg9gq/0mahFc5m2UKlYckAKqIm7wkMLWootIKgw27i/W\r\nGqkBSgf8WYhEiWJIBfeA+t6PbOWuKA+JOYilc7iT81BFalZ5Dk64kmaySdfW\r\nffg1S5ZUtTPNbmFI7zw42wK1gJEyyLjGXJVIUlEXsiddy196W2aby5Jn7oq7\r\nX79fmTonxe/Wvo4Qrt1A7HI5KD1ltjZVBParPt5/ebLHjUOFfuDxT2J+InZ5\r\nXWNVUyOAVI1wpRSAVKbKQ157xt7W5TyqIrJMk6IvB0aVEwYq7rXJups3xJEz\r\nPkazarhWtJuaUIysuV68FFjCpUJMJ+kWR3sbKumHU63uqwaxn7dLTK1MQZoD\r\n4riKzuqggkKRvWf2uHHeQKaCBjrgfhCkGVqKiT60N270bsSQHSim17ZEFW7+\r\nSdFGVgZeczWgt/J/8gsFyN0i8AyUwTe0U779ic8lOyxPJRpbVgmkw5Xgp+8M\r\nsRe5KKOH3ypD7Yil20giMRwsLp2KHss8L4WyoiYofeFuMxhLpa7ztmBB1kIi\r\nE0ZZ8bF621p3oCVLGdzXnX9Lgsx4SWoHtDk=\r\n=S+Kt\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.8.1-unstable.208_1677036401900_0.1754575145201427"},"_hasShrinkwrap":false},"0.8.1-unstable.209":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.8.1-unstable.209","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"^0.3.0-unstable.12","@sphereon/pex":"2.0.0-unstable.6","@sphereon/ssi-sdk-core":"^0.8.1-unstable.209+b9b4c2a","@sphereon/ssi-sdk-did-utils":"^0.8.1-unstable.209+b9b4c2a","@sphereon/ssi-types":"^0.8.1-unstable.209+b9b4c2a","@veramo/core":"4.2.0","@veramo/credential-w3c":"4.2.0","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.5.1-unstable.1","@veramo/cli":"4.2.0","@veramo/did-provider-key":"4.2.0","@veramo/did-resolver":"4.2.0","@veramo/utils":"4.2.0","did-resolver":"^4.0.1","nock":"^13.2.1","typescript":"^4.6.4"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"b9b4c2a81e92d8d9fff64cd652125f521d8d5cee","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authorization request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst authorizationRequest = await agent.getSiopAuthorizationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authorization request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationRequestDetailsResponse = await agent.getSiopAuthorizationRequestDetails({\n  sessionId,\n  verifiedAuthorizationRequest: createAuthorizationResponse,\n})\n```\n\n### Verify authorization request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthorizationResponse = await agent.verifySiopAuthorizationRequestURI({\n  sessionId,\n  requestURI: createAuthorizationResponse,\n})\n```\n\n### Send authorization response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationResponse = await agent.sendSiopAuthorizationResponse({\n  sessionId,\n  verifiedAuthorizationRequest: verifiedAuthorizationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.8.1-unstable.209","_nodeVersion":"16.19.1","_npmVersion":"lerna/4.0.0/node@v16.19.1+x64 (linux)","dist":{"integrity":"sha512-0aarz8ZPX1Q6nQlkXeiZawOwwKCwQxB5DBrApSY2z8LdVmghkIQ9h+NFil1KwLoiNbMSawhIWHGowMWzo9r23A==","shasum":"177cc904de5561d9cf214eacb3bb56fc568948b8","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.8.1-unstable.209.tgz","fileCount":34,"unpackedSize":136225,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHxti8TdQnwe4SztEtSfqZpbZ2Viq46PanvTE8SeLMtIAiEA1ykQ8F2qtOtjbsMCzOOlyUjWK9r7P1iLgAbOFlgik1c="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj9m8lACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoJNBAAkha4ZaVYNJCvSQcIrmYbGotTZtBbA3lxiVlPrlPH/YUZY493\r\nwt/hpZAIoj+sbZDABg4d3MTGezVbGKRvtaLKIhht+0uKMBA6nYMIJGWii7Z9\r\nw1nM2IU0HRKV9JicNdpL7fvnYQcMwBMSx8CiPT79S08Ct9Ffh72tnWOvIeUb\r\nKydEfjzVOMC8599RxYhmOa2zQKKcCOqBx8Cr2Y2eii5ClijLWs3azfDzoed0\r\ne0ztGxFqkhO1jjpq0OWXDQqIQUEL4ZCk9v4M96WBNIXb8qA/TtYHCiaFZBZG\r\nZNy1SBmX52rR5uy7vowsInFAkBoMTxHybZhxlqPKshxah25RTuuEbhvdvTXF\r\nDbSkFHqebLVvps7JKNRnYoZUWOOpSUpuAG5qtsMgsz6uJxBcSmQ7XaFPsaID\r\n3c+OtItV9jky86fDIrmy525k/3mYjTNmNb+kmRMHGL5N8mvgSlvtl6ozFpeB\r\n5SrBvXrM+PR+QsUpLKCdtbnS0x5LyzNi2IyVvPPxEgkmtRAhZoyXUf3JSGKm\r\nd5qJfU+OlK1/jnQZIqM1fC41+f2GjITaDTKykZxvoNFBhqSi+NkwhaJ14ybO\r\ngFuvjaL291a7Ncj4+7WSlvplB9QRsBag6IIJpf1On4EOw6zj4MuppcP5yyed\r\nLRwEGmwpxeSU2mEiIk92RNAb34EfuniZE2w=\r\n=6cub\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.8.1-unstable.209_1677094693627_0.4135960030351866"},"_hasShrinkwrap":false},"0.8.1-unstable.210":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.8.1-unstable.210","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"^0.3.0-unstable.13","@sphereon/pex":"2.0.0-unstable.6","@sphereon/ssi-sdk-core":"^0.8.1-unstable.210+482d119","@sphereon/ssi-sdk-did-utils":"^0.8.1-unstable.210+482d119","@sphereon/ssi-types":"^0.8.1-unstable.210+482d119","@veramo/core":"4.2.0","@veramo/credential-w3c":"4.2.0","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.5.1-unstable.1","@veramo/cli":"4.2.0","@veramo/did-provider-key":"4.2.0","@veramo/did-resolver":"4.2.0","@veramo/utils":"4.2.0","did-resolver":"^4.0.1","nock":"^13.2.1","typescript":"^4.6.4"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"482d1191078fd53a9bd5f8413a2bab93cd8ae60b","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authorization request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst authorizationRequest = await agent.getSiopAuthorizationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authorization request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationRequestDetailsResponse = await agent.getSiopAuthorizationRequestDetails({\n  sessionId,\n  verifiedAuthorizationRequest: createAuthorizationResponse,\n})\n```\n\n### Verify authorization request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthorizationResponse = await agent.verifySiopAuthorizationRequestURI({\n  sessionId,\n  requestURI: createAuthorizationResponse,\n})\n```\n\n### Send authorization response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationResponse = await agent.sendSiopAuthorizationResponse({\n  sessionId,\n  verifiedAuthorizationRequest: verifiedAuthorizationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.8.1-unstable.210","_nodeVersion":"16.19.1","_npmVersion":"lerna/4.0.0/node@v16.19.1+x64 (linux)","dist":{"integrity":"sha512-xNTvYt2RgnJ4yQ4KBSHfYf701UThxhXmfRyTYty5LvsxDn+x8cmU6hPbXURnZjLSNinKAw39JJiF/5kT6zzdiw==","shasum":"2893936763bdee363ef7cee6d3f9e1f4bf5277e6","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.8.1-unstable.210.tgz","fileCount":34,"unpackedSize":136670,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD+9Db/2ofpXuqnHlJPmjrAF1f4niJjm/WoDVO329MDSwIhAJ3SwssdBmd0x+cn3miE7dLQFXXCO8xbuh6qSuFNH6qf"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj9qhpACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrScg/7BduF5HTf291V2sAWcyou3GMW6ASWLQJJCuH8f2qnpGmTMcKb\r\niCebuFa2Mhzz5VvtQozkhP4rszUJzCyWogThk14ZebhgWN2KOSv/2pid2FXu\r\n0STG3l4nDnpAsUYsKMegN96KeyhS48pyA4z/cUBPwjgEjOuhdstatj60TscG\r\nkDKWCu5OzC+YfXktoyIXVka2TmoF421BKK1gfXgKnVXnL82FkPojBS7jNaLh\r\nt0kY+m6/RSUjp0jWTALj87oBtVoQVx1lXFQj1KKnYdx2kco/Q5BE7ZqsoJyB\r\nuGpXx9HoKkSu+2gHMSkbHCdTq0+dBLmj+6m/HNamRDamYzcq1uf4bBsxkBKE\r\nsoIifMcupx2atbf7M9hAO0Ph+7vf7didITYdMoAPV8hj4AB6mdnaI3c8yXKD\r\nGluW3YE3/uTwXUWgQ28qZi3HeNAkB9U0OxNAJRi8Dq0QR2hlXDHDATEOzalT\r\nwEHOub3CkvpbczTKRkvW4swW1j7n7pLJHOciSKuRtK+Asnz8IdUAClNzrQ3U\r\nIkAT9ozZCPo5HcPUb9JVrev6/7W84OJhuxY7qZiL+WxdyF8hxe6VTQQtngXB\r\n7ITMaQi/TLd8v1LUn5F/DnTcT+Uz93Du90vPErMijj6pMS4pqzSE+m6M9xW6\r\nEuk2DC8Z696ftJre7yueInqtBD+oId1TZac=\r\n=ozvI\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.8.1-unstable.210_1677109353144_0.8917316513250941"},"_hasShrinkwrap":false},"0.8.1-unstable.211":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.8.1-unstable.211","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"^0.3.0-unstable.13","@sphereon/pex":"2.0.0-unstable.6","@sphereon/ssi-sdk-core":"^0.8.1-unstable.211+fd0012a","@sphereon/ssi-sdk-did-utils":"^0.8.1-unstable.211+fd0012a","@sphereon/ssi-types":"^0.8.1-unstable.211+fd0012a","@veramo/core":"4.2.0","@veramo/credential-w3c":"4.2.0","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.5.1-unstable.1","@veramo/cli":"4.2.0","@veramo/did-provider-key":"4.2.0","@veramo/did-resolver":"4.2.0","@veramo/utils":"4.2.0","did-resolver":"^4.0.1","nock":"^13.2.1","typescript":"^4.6.4"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"fd0012a9ab01e5eade331e849f0de1d0047643ec","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authorization request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst authorizationRequest = await agent.getSiopAuthorizationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authorization request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationRequestDetailsResponse = await agent.getSiopAuthorizationRequestDetails({\n  sessionId,\n  verifiedAuthorizationRequest: createAuthorizationResponse,\n})\n```\n\n### Verify authorization request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthorizationResponse = await agent.verifySiopAuthorizationRequestURI({\n  sessionId,\n  requestURI: createAuthorizationResponse,\n})\n```\n\n### Send authorization response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationResponse = await agent.sendSiopAuthorizationResponse({\n  sessionId,\n  verifiedAuthorizationRequest: verifiedAuthorizationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.8.1-unstable.211","_nodeVersion":"16.19.1","_npmVersion":"lerna/4.0.0/node@v16.19.1+x64 (linux)","dist":{"integrity":"sha512-1rgUYR6h/KNg40Ze4Kl4Vfdfhv7VSZjyoGKRUJ1s9Vs+jb40oRaw+oePNevl+ILocg3shkWD1YgAzNcDv3jn4Q==","shasum":"ab66889058253af17e461db56707d695c910ae26","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.8.1-unstable.211.tgz","fileCount":34,"unpackedSize":136532,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDh0WntsbVQAxHb+u0MU8sXOnhu0DS4VGfCCJIRIXkYQAiBfS6OS2PsBwrobF3y2ZgSNgxH6q5fSelMplwFvVTsLxA=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj9rAxACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp3ug/+OxyWIoJedL59+OpgZgpoc8N/sy5JsY6VUX2u8eMHWKZ5AQfp\r\nYAgaOHwAcG4VJUfYWWGtxYQt2BNbUkjtaiAbFf9/Tk3TTWHZNOG4ZcLInn2u\r\nHDDT1MUO+BXKixvHKTPL76hK3QkJhHgDASa6UWUOHLDB1Jq395qCNiWy7SQM\r\nL6jMzgpX9DEPw+OsS27pm/twUmvlFVlxdSMxJkJmX2mM82o01VgF3Ve1cfES\r\n6Nr5s++1qKQVFzia8Z4D7kSkQms85UKmLrNovfqLaRkxiQNDsUbGjrUCpAgw\r\najPdGUCf5AmuM8c15EA9OJxQiD5t1JYCDC2DxUska4nUIAv6fXoKN2sBlmPI\r\nCSnEcg6uj/eWIAwG3vWoANL3EpT/P6aBNYdQQaaD6IKel/9rNXz+kjZrp63a\r\nfmFnZjKQb47hu769VzU50rUfbGw2cIBi/LkwmaaivRm7V8gdBNvIIJrQBQpb\r\nv08nPEp/FH0Z6mX8uSofUFyAKUqOmRZSssZxFzJRqoVgBVVtnK30O9lwFJgI\r\n8yUk5jRKJpcdOo7VyPeCRzHllG2OXC8UliV31/8ottz07lypTbZ5fSpI92nH\r\nDwtz1APfypr0OkFYk0gdlH+4LEgOmSwD1TlIA6YgssEMsncHEYe4SQgHmDmK\r\np1iEcdA0aFCohqGCGUjFce8AxPAUZzpF/1g=\r\n=L/Ma\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.8.1-unstable.211_1677111345650_0.7615501765069579"},"_hasShrinkwrap":false},"0.8.1-unstable.212":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.8.1-unstable.212","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"^0.3.0-unstable.13","@sphereon/pex":"2.0.0-unstable.6","@sphereon/ssi-sdk-core":"^0.8.1-unstable.212+acb75ff","@sphereon/ssi-sdk-did-utils":"^0.8.1-unstable.212+acb75ff","@sphereon/ssi-types":"^0.8.1-unstable.212+acb75ff","@veramo/core":"4.2.0","@veramo/credential-w3c":"4.2.0","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.5.1-unstable.1","@veramo/cli":"4.2.0","@veramo/did-provider-key":"4.2.0","@veramo/did-resolver":"4.2.0","@veramo/utils":"4.2.0","did-resolver":"^4.0.1","nock":"^13.2.1","typescript":"^4.6.4"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"acb75ffdad63691167cbdaa2385b8d1e302f757b","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authorization request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst authorizationRequest = await agent.getSiopAuthorizationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authorization request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationRequestDetailsResponse = await agent.getSiopAuthorizationRequestDetails({\n  sessionId,\n  verifiedAuthorizationRequest: createAuthorizationResponse,\n})\n```\n\n### Verify authorization request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthorizationResponse = await agent.verifySiopAuthorizationRequestURI({\n  sessionId,\n  requestURI: createAuthorizationResponse,\n})\n```\n\n### Send authorization response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationResponse = await agent.sendSiopAuthorizationResponse({\n  sessionId,\n  verifiedAuthorizationRequest: verifiedAuthorizationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.8.1-unstable.212","_nodeVersion":"16.19.1","_npmVersion":"lerna/4.0.0/node@v16.19.1+x64 (linux)","dist":{"integrity":"sha512-pAWXwC4kyuCniW8LOn2TPr9foXF2sXRUKZnrtvFYbSUKa7IV/8NCuocH0IUSKaYuu4UlBZf2DqcaFz7wUOPyXg==","shasum":"6a59d56bbfc56e3287a2051734e62b074757e0ff","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.8.1-unstable.212.tgz","fileCount":34,"unpackedSize":137407,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHWRDfQUq5leu1ySC3dYdj01kTUnTsfDHIle9PWe2XSfAiAIy62ywoWlZrWrG3E0JlBWF+q341m4tShDwkNX8gWX/Q=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj9sUWACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrfBA/+KPQtZFKqmZCq9J+ayirigjD5mInv4E2CLIMw4Y0NW8gfrzNt\r\nNgZWJcsgXFbcerd+SlKVQMkPXGqwqFj37T/jJtpN4X8FRckckHCuQWpuRM59\r\nbgWKVgjgQ0VLAtMSV+PsNexhqpTdIYRCaRPVCDoHQ2TW80gdlnvuv9CBtI6N\r\nWyRm1qsslb5BLhUNWqw5jUIkp0BcCfi24C6rmWYLqB1UV1HV5WpAC9pokUa0\r\nfhPZLlP3hD1AqoJc5Rc0iIpdYCxX6XFzvkBPj8c2l0kDZpv3BsFdgt040RkQ\r\nBUgy3aymXq/8ORvBYlTKShK2PMOIgKLR9E0/0OjHBVjQ98TTdRMxpzwqzq++\r\nwMaEJ+sXKDvrIEjWQK0igCyQpeL5XMvl/51SNM/M1hqisyVvMpW+YNuNXCjY\r\niVeUoGCA6uzRnVNJoCIWD98+5LQgWNITF8WvsMoLMJwimn32ej9iDsji5zc8\r\nzeWwWwsanTRV3I/4wkxA77LVFhJXWQCrrnQaKK/MW+LpERk8t91mXpoBELiM\r\nTS2a1NQK34QFVCy0qLZf0XFw/QTgH8BGDAhiQaTPPhWPiq39luGhJfyOCPp5\r\nkPsMTdK1v5DkPtTpZyYEGtiRw/pEIi7q+roEHESNmG/aOQ17TqS3z5CA5oeP\r\ngKAGIQPydj681eRHTpbL9zRT1hyE5FapbV0=\r\n=8SqJ\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.8.1-unstable.212_1677116694752_0.23630045134085287"},"_hasShrinkwrap":false},"0.8.1-unstable.213":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.8.1-unstable.213","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"^0.3.0-unstable.13","@sphereon/pex":"2.0.0-unstable.6","@sphereon/ssi-sdk-core":"^0.8.1-unstable.213+beb99bd","@sphereon/ssi-sdk-did-utils":"^0.8.1-unstable.213+beb99bd","@sphereon/ssi-types":"^0.8.1-unstable.213+beb99bd","@veramo/core":"4.2.0","@veramo/credential-w3c":"4.2.0","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.5.1-unstable.1","@veramo/cli":"4.2.0","@veramo/did-provider-key":"4.2.0","@veramo/did-resolver":"4.2.0","@veramo/utils":"4.2.0","did-resolver":"^4.0.1","nock":"^13.2.1","typescript":"^4.6.4"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"beb99bd2861034dd6e739e18b6863118a7af44e9","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authorization request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst authorizationRequest = await agent.getSiopAuthorizationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authorization request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationRequestDetailsResponse = await agent.getSiopAuthorizationRequestDetails({\n  sessionId,\n  verifiedAuthorizationRequest: createAuthorizationResponse,\n})\n```\n\n### Verify authorization request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthorizationResponse = await agent.verifySiopAuthorizationRequestURI({\n  sessionId,\n  requestURI: createAuthorizationResponse,\n})\n```\n\n### Send authorization response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationResponse = await agent.sendSiopAuthorizationResponse({\n  sessionId,\n  verifiedAuthorizationRequest: verifiedAuthorizationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.8.1-unstable.213","_nodeVersion":"16.19.1","_npmVersion":"lerna/4.0.0/node@v16.19.1+x64 (linux)","dist":{"integrity":"sha512-ClAGPAQDLP5r8r8V4XX4PkBQDCo8VNAAfsLCndoJxpfie/xHVxmT5kOVfH9UoQxwW54Co5M6V8ixR0sZ1+Ocmg==","shasum":"77bbd4fd4b3f275d0d14344ad906f3a607610ae6","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.8.1-unstable.213.tgz","fileCount":34,"unpackedSize":138632,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCSXSLVQ9hs+Zv0DSDlFMEjVGdkI5e1lgCIWyXsCIMwYwIgdUARRqJXs7HKhbqJt1XPAoe2ROc3nI0BCie1Qehffc8="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj9svTACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoQqw//eaN5kJh23R5WuK2flsh4BR2A5WXJ5O0V80YKdiCAWNrZWOur\r\nGEGbpBtntwjk04TuASJmZKYgTRier2pns3g0aiL2sYn7JJKa2nNNiockaOSI\r\nGjG9aWsbgH09fJonvJzsqtPgQJZb6SGaG6EVmKeovJLOhwcladyii2XxaFM2\r\nHouA1yOCVFs6vg364s6M4eit9gXDfOIs4zneKxlO0zAQrYWaeV/slfJVEW9n\r\no/CsFfIWdsEZIJXkOBlwf0OpwzOEGP1GGUYuhOkw6KNN5m0YyFe1bBvjcFwX\r\niPYtDq2AWWWMhtKTpwsvJjrhWOkl74zJOBTUZ+DJ2XpE7mtPmPBPz0gVhY9T\r\n6EK+3riB7GFs/+VJc4exThwEWWR3f1QkJneH4IrsxImEF1PIWT0iIBXncFv/\r\nmy2BYF9OAS7JVaue1FumBo1S3ZhIT9HcJKN4Wf5u5RRXPY2s/zPiwudE4Wgs\r\nygKSn8B/2jDiQeoM0ipiKYA4aMRRbrTQOg3m2JZYKIFkORmEDfdiI+pWasPQ\r\nrXoGuRY9VWFU9KCqD+Hb7N2gWAI2hfYFyxIYzWJLHsaz/jKcm55j+x16G1Tu\r\n1sgEHHQq8imADCqb92cYi2V1V+Nm+2v1qi19hyVcdGYI36svf3di99O4r0NK\r\nTBA4nCPpaZsJVNQK1B44YqtBzhdZX1mjlh8=\r\n=y56M\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.8.1-unstable.213_1677118419388_0.1042651966139847"},"_hasShrinkwrap":false},"0.8.1-unstable.215":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.8.1-unstable.215","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"^0.3.0-unstable.14","@sphereon/pex":"2.0.0-unstable.6","@sphereon/ssi-sdk-core":"^0.8.1-unstable.215+f76cceb","@sphereon/ssi-sdk-did-utils":"^0.8.1-unstable.215+f76cceb","@sphereon/ssi-types":"^0.8.1-unstable.215+f76cceb","@veramo/core":"4.2.0","@veramo/credential-w3c":"4.2.0","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.5.1-unstable.1","@veramo/cli":"4.2.0","@veramo/did-provider-key":"4.2.0","@veramo/did-resolver":"4.2.0","@veramo/utils":"4.2.0","did-resolver":"^4.0.1","nock":"^13.2.1","typescript":"^4.6.4"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"f76cceb2244a237570dbe8e97056362e842a55e6","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authorization request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst authorizationRequest = await agent.getSiopAuthorizationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authorization request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationRequestDetailsResponse = await agent.getSiopAuthorizationRequestDetails({\n  sessionId,\n  verifiedAuthorizationRequest: createAuthorizationResponse,\n})\n```\n\n### Verify authorization request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthorizationResponse = await agent.verifySiopAuthorizationRequestURI({\n  sessionId,\n  requestURI: createAuthorizationResponse,\n})\n```\n\n### Send authorization response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationResponse = await agent.sendSiopAuthorizationResponse({\n  sessionId,\n  verifiedAuthorizationRequest: verifiedAuthorizationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.8.1-unstable.215","_nodeVersion":"16.19.1","_npmVersion":"lerna/4.0.0/node@v16.19.1+x64 (linux)","dist":{"integrity":"sha512-KeoUCoEOuqiCYP0eb6APbZAQ8Y+ac+QUj6I6yJquDQEtaRm1uKAqIsHP5MwwOLehOnoZJBsEl3eAMN4fMl72nQ==","shasum":"fcd27aa97e33da8020b8434c06cc1fe869529e08","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.8.1-unstable.215.tgz","fileCount":34,"unpackedSize":139119,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCImA+Hw7yr+uRgokkp+tt10BU6ZpreaYAgeCbfvGAimQIhAP1DOSln7AtXqH5ApSH9BkYGg/4mJP4PjSNOiHlTfXfp"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj9797ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrfTBAAkxlHTXzxA05OzLPGk715i4bjXcOEnpWjfg4ZWgcdqFCMvSH8\r\nyZkK/hEqogmRNQZx5ADfR5qlXiKGCDtckSvBR1906gE5CCRY7pGMKfNHuOIN\r\nKc9XnDHtIHo/UJufY/dDeUmel5OQZan3kkO+1oupYPxYQYMjwVjdB/daLSL6\r\nDvHz+P/T/zMwJ1R35XKgPG2mkcs2snA9ANNVp1q9m8RD65XHHM8la+zAiMSs\r\nEQ7IaQ4ABl/rHWocetMW1+NwKoQ/5Krhf+U3qMAgZYWvLmfrrftkIjoQyFWo\r\n83QtqMJ+MDxfZ+mukt5gv2Pf+jbav93n1nxQsqo/nCR1Qv7P3Q0vM6KwrZ5s\r\nZTgxRmdJkHZ93twf4U3YDzMahmha4OLYpIOA7v5WF85FlkfcgZQNyqt7T0s8\r\neFCgvBKKMsUo/vwSGLay6TVL3FVkIicbfuqKx+C2IrEZtWp6HM134eW+6+Xe\r\nMU8t55FCAwK1iZUbLhDJUA6gA3jhjFLgxHRxw4hYks0OewaDIrBUy9XXrOns\r\nhg1G9Lywxvkws8goheTfVDPaElDIzD3s4mcBZEFhGQ3WyRjcqKVH96GH0pqr\r\ndfCMEQT5HmqeRle93jkjf15yo+ZguIGFmnok/jm+m52lpMkZzRHg075MVHVy\r\nHe5/WpTtYYxp89PAo07X7U0mPYVFN3A9dGg=\r\n=X68A\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.8.1-unstable.215_1677180795188_0.43681600788955555"},"_hasShrinkwrap":false},"0.8.1-unstable.217":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.8.1-unstable.217","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"^0.3.0-unstable.15","@sphereon/pex":"2.0.0-unstable.6","@sphereon/ssi-sdk-core":"^0.8.1-unstable.217+bc342f9","@sphereon/ssi-sdk-did-utils":"^0.8.1-unstable.217+bc342f9","@sphereon/ssi-types":"^0.8.1-unstable.217+bc342f9","@veramo/core":"4.2.0","@veramo/credential-w3c":"4.2.0","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.5.1-unstable.1","@veramo/cli":"4.2.0","@veramo/did-provider-key":"4.2.0","@veramo/did-resolver":"4.2.0","@veramo/utils":"4.2.0","did-resolver":"^4.0.1","nock":"^13.2.1","typescript":"^4.6.4"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"bc342f9d00dc5dbcf5c127eb90ca78392a33b546","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authorization request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst authorizationRequest = await agent.getSiopAuthorizationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authorization request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationRequestDetailsResponse = await agent.getSiopAuthorizationRequestDetails({\n  sessionId,\n  verifiedAuthorizationRequest: createAuthorizationResponse,\n})\n```\n\n### Verify authorization request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthorizationResponse = await agent.verifySiopAuthorizationRequestURI({\n  sessionId,\n  requestURI: createAuthorizationResponse,\n})\n```\n\n### Send authorization response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationResponse = await agent.sendSiopAuthorizationResponse({\n  sessionId,\n  verifiedAuthorizationRequest: verifiedAuthorizationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.8.1-unstable.217","_nodeVersion":"16.19.1","_npmVersion":"lerna/4.0.0/node@v16.19.1+x64 (linux)","dist":{"integrity":"sha512-pWkmib+9/TN+7MeTWBYG4oMedSSk13y9ZbuWcsJsZyfxAvEYW3jQD9yFPqWM6V+GY8/H3BoN0zIi2lJQ45GZoA==","shasum":"7cad250c0df5b76e5f85af51e7411c9ecfa43770","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.8.1-unstable.217.tgz","fileCount":34,"unpackedSize":139119,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFXpy8K/9Iv2JD2Zzzt4/9iFrEbVDeIUXbyzP6Bk/uAXAiEAzbAN7BBct4mUa/P6lzkO6w07kD0q505i75dRP4ESkjc="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj980jACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp4shAAnC5QXW3pqybaUPdSXcVhd2O7pvWGmDgaMJyX9kSOmZB8pa0J\r\nRa/cIoDGdfTuT8PYg1Ahv2TTb2ORz+/ecxzllKFMOjwmFq1hcpY7QUzd/8t+\r\nI9NKeFmQtZDPPinX4cgaNjSJBV/UnrzP7Wz1xLd9jlnL4e6jnQEU/Lf8pBko\r\n9LbvBYaE9Q/WOo/cz6SnorzUscKYScNajCVcBGxix1FzoBTNo3XNK+OgW54X\r\nGxYVBSS+O2NmUwIdUsUmeiv1ToViSeNWZhmW0dGv5wPHEEzjICE+D1Gj/Sel\r\nvH29LIuN6jI4CJdy3QEJUd3NAcXpSLjxlc3X0n4UQGxyjRtuVF/yecYVu9Ha\r\nfZLAYn03K7g+flpYIyh0WsCbgdbzDZzfjlr2BOdMiXypxpbnu/LWW+Bgra5U\r\nwRVPmbUD7d7VqJCOHYLKGDIGKBdq8U1gY3A/h94EY/8E79EWEgLAYkbzW3th\r\nW2a9oLmvt0r6vv9jECaH1XnDOcxjAIGvAAAuM3WpfLCj37IAAaE5Hb6awVDQ\r\ndutr7fZDpHtJQC1JGekWhDCDj3YXcvVom6WLafwg5xNVaNazcRahOXgvb5oi\r\naM0opRQzpexI+k6pFejSgQ9OFzXsJduucf+V/xTf04mIFeR44dWzhmzMV59T\r\nToyoF90KwblplUL6nVhGwEcqoC1FJZRcZC4=\r\n=2RDE\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.8.1-unstable.217_1677184291402_0.3134847698060166"},"_hasShrinkwrap":false},"0.8.1-unstable.218":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.8.1-unstable.218","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"^0.3.0-unstable.15","@sphereon/pex":"2.0.0-unstable.6","@sphereon/ssi-sdk-core":"^0.8.1-unstable.218+0708195","@sphereon/ssi-sdk-did-utils":"^0.8.1-unstable.218+0708195","@sphereon/ssi-types":"^0.8.1-unstable.218+0708195","@veramo/core":"4.2.0","@veramo/credential-w3c":"4.2.0","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.5.1-unstable.1","@veramo/cli":"4.2.0","@veramo/did-provider-key":"4.2.0","@veramo/did-resolver":"4.2.0","@veramo/utils":"4.2.0","did-resolver":"^4.0.1","nock":"^13.2.1","typescript":"^4.6.4"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"070819585e783410dc75c51d88cc3ade45e69148","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authorization request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst authorizationRequest = await agent.getSiopAuthorizationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authorization request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationRequestDetailsResponse = await agent.getSiopAuthorizationRequestDetails({\n  sessionId,\n  verifiedAuthorizationRequest: createAuthorizationResponse,\n})\n```\n\n### Verify authorization request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthorizationResponse = await agent.verifySiopAuthorizationRequestURI({\n  sessionId,\n  requestURI: createAuthorizationResponse,\n})\n```\n\n### Send authorization response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationResponse = await agent.sendSiopAuthorizationResponse({\n  sessionId,\n  verifiedAuthorizationRequest: verifiedAuthorizationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.8.1-unstable.218","_nodeVersion":"16.19.1","_npmVersion":"lerna/4.0.0/node@v16.19.1+x64 (linux)","dist":{"integrity":"sha512-v/95/QKgEYxC+yNkTmZTLvNdJigDOb4RREnWD6q8kaORFGNzjcQpVxPwjMkJdI32s8NCG6+XoyBisIYBZoOKgg==","shasum":"ac62aafbf4e0041658617e2eba7820f9f4161e77","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.8.1-unstable.218.tgz","fileCount":34,"unpackedSize":139169,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDLFYZpd2UkZkGoe2dZ0vOm24Qo+rcdpTMYKIWBg9R4KAIhAPhn+g0YMh18RUB0yeENEC4gM2yFRWJspnZ770hL44u3"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj9+S5ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo5KQ/7BnbBbvYGgA9RnWoAoG1h9sANx6FH+X9Zp+f0SU6RMufyVm2v\r\n1jwB89zta58SLwX0/lyug+Xh3jGxDegWDT5IYuKuvpVZk/4cFhthq3C4isTs\r\nquw+fjwIfEoBvH485ooMNjU+hqAC747xKWJ97FHqP4qJrUS6a/emMwGWIJlx\r\n7Dv1vdwSdr0pYEGbgOBkrywVdU31zSkDcZ1PLNGraa1ROxjdRWy16jGfrrfh\r\nAp7RecmUneaiLCXi43YpAjTblKXXH7tLnq5Z2tP90NKV5HN/8qE0vji1vXqn\r\n+ugLQdHyonNWBdx4A5NnXWjS41nIeI5gOuvvEGFgGgNrhLvvpbsLrURntbYf\r\no9QvJY7HoLhAeyPMW3MYFQA8m2HPP4ubPsd1/mcHSymCfNHwyVg65COQgrlI\r\n/UE5o4bdQcpjdOEKnn4xk3p0nP874358Yz83818ZhDbQzRkQv/uPmUhwaqWT\r\n7SHY2GR0AxFmA59Tzk2Eaw2/4TH06dUOEa41xVgqXJXYhuQACs7lhdIaPo0+\r\nUC3ZPzfyAZuQShrjHmcl+PcAwnobvz2Pd/dsJ8a0KmSn1IGhUtC1yMG3+KxN\r\nLOuqqQVCLlNX+sNRp+NmO0PU7A+4G22IhEBjfcoBvGy4MokUbqA5PZ6neBuw\r\npxL1iVd0rkLjLgENT5Ki2GUh+YKaXtLKYgk=\r\n=woHo\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.8.1-unstable.218_1677190329220_0.7356680286176924"},"_hasShrinkwrap":false},"0.8.1-unstable.219":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.8.1-unstable.219","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"^0.3.0-unstable.15","@sphereon/pex":"2.0.0-unstable.6","@sphereon/ssi-sdk-core":"^0.8.1-unstable.219+39c84c0","@sphereon/ssi-sdk-did-utils":"^0.8.1-unstable.219+39c84c0","@sphereon/ssi-types":"^0.8.1-unstable.219+39c84c0","@veramo/core":"4.2.0","@veramo/credential-w3c":"4.2.0","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.5.1-unstable.1","@veramo/cli":"4.2.0","@veramo/did-provider-key":"4.2.0","@veramo/did-resolver":"4.2.0","@veramo/utils":"4.2.0","did-resolver":"^4.0.1","nock":"^13.2.1","typescript":"^4.6.4"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"39c84c0a44d0bfff00c630ac10eed2b540eab5ee","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authorization request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst authorizationRequest = await agent.getSiopAuthorizationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authorization request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationRequestDetailsResponse = await agent.getSiopAuthorizationRequestDetails({\n  sessionId,\n  verifiedAuthorizationRequest: createAuthorizationResponse,\n})\n```\n\n### Verify authorization request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthorizationResponse = await agent.verifySiopAuthorizationRequestURI({\n  sessionId,\n  requestURI: createAuthorizationResponse,\n})\n```\n\n### Send authorization response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationResponse = await agent.sendSiopAuthorizationResponse({\n  sessionId,\n  verifiedAuthorizationRequest: verifiedAuthorizationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.8.1-unstable.219","_nodeVersion":"16.19.1","_npmVersion":"lerna/4.0.0/node@v16.19.1+x64 (linux)","dist":{"integrity":"sha512-qI9jl2xfxUgR5U4Wh88RfqOzActtWdFRuwBw/kgsS0jQugBr2lqvF2OTkJI3WZdxhpCKFoAv1SGFSiyxnNuWiw==","shasum":"2a39295d84a47199b8e1e84f0ff1ad29e4894b7a","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.8.1-unstable.219.tgz","fileCount":34,"unpackedSize":139151,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBHSdwlCtSdIjwOQjE/PcHm8ve8BDbOssMJCADjUVUh1AiEAxPGjdCqd7yoTevP7QMQwSVUXWxMG2QC63ynZ9QGeJdk="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj9+4FACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqEJQ/+PIUXNiT1GJyrfgA6fcGJxYNlL/cF6sQxc72X+EovYRwhM4Vm\r\n4Gq91BQo2yKAG/HWQlEjQhtsd8D9e1PQwGzE9Pq+eRPTiJ2W7tewCFB4LAsE\r\nJjtKXhrowlGer7TPVo6taQOSAfbproT86Jgo/4kdtsCK4q3ZMo+MVXnD6TMO\r\nVPRfzTw6ymhFNIe9zrIbuqfwf6CWgBPIVJaRaucK78FH4xD6NvgEWisdnNVE\r\nc9Tw58ea39lZCfte8t4SujQeFN0xoMq51yukRz7sAUphufQP6l9QMoMl0xhy\r\nYmglKG3Ed3ITR0QYtleiLJ/LfSdb06f7BnuqqapcaV0YJy06BB5IKQ5VLh3G\r\nWxGg7UEFTs/xv51imiq+kFH29816v3QBv60VRpcb1niTvF8FZZGzvJT/cMGk\r\nPIzux4F0Rx2THnUbdTIcKHjb6eAOSkADdzV73UcK+KxOE2rA+iOnjRTrnW89\r\nkwFXK1KOtgcB1qfSyaTGjqoV+mhvO+jmWSWt5kudoj5Ul7g7181lbV9y7xWo\r\nJMnYluv/TjqNhspVYcC5d/0I7roUaEJCy3DYDq9oVEru8dWKupS1tsuUGop+\r\nyBoWlw8QqSvUgkTLwkCQYIJhgB6X7uyRBhlPUz2guocJMxenJ3hkDBUI0KES\r\nyEv/4h9VArO7y++UW+0luHlYmli3xZh7+Gw=\r\n=89YO\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.8.1-unstable.219_1677192709028_0.783183294194685"},"_hasShrinkwrap":false},"0.8.1-unstable.220":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.8.1-unstable.220","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"^0.3.0-unstable.16","@sphereon/pex":"2.0.0-unstable.8","@sphereon/ssi-sdk-core":"^0.8.1-unstable.220+eca3e18","@sphereon/ssi-sdk-did-utils":"^0.8.1-unstable.220+eca3e18","@sphereon/ssi-types":"^0.8.1-unstable.220+eca3e18","@veramo/core":"4.2.0","@veramo/credential-w3c":"4.2.0","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.5.1-unstable.1","@veramo/cli":"4.2.0","@veramo/did-provider-key":"4.2.0","@veramo/did-resolver":"4.2.0","@veramo/utils":"4.2.0","did-resolver":"^4.0.1","nock":"^13.2.1","typescript":"^4.6.4"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"eca3e1811df58ea348aef1d8e353711a50bab0c1","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authorization request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst authorizationRequest = await agent.getSiopAuthorizationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authorization request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationRequestDetailsResponse = await agent.getSiopAuthorizationRequestDetails({\n  sessionId,\n  verifiedAuthorizationRequest: createAuthorizationResponse,\n})\n```\n\n### Verify authorization request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthorizationResponse = await agent.verifySiopAuthorizationRequestURI({\n  sessionId,\n  requestURI: createAuthorizationResponse,\n})\n```\n\n### Send authorization response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationResponse = await agent.sendSiopAuthorizationResponse({\n  sessionId,\n  verifiedAuthorizationRequest: verifiedAuthorizationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.8.1-unstable.220","_nodeVersion":"16.19.1","_npmVersion":"lerna/4.0.0/node@v16.19.1+x64 (linux)","dist":{"integrity":"sha512-0noSL2kALOaZRoRLWh9LbTiBJCMse7cN4pq3Z0SFcp5tn6DhN1Zxt+YgPKR166lD+bAbS0E5cwqT8oXWwOvR9A==","shasum":"1377e785251065746c670f99e14df605fc0d4d57","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.8.1-unstable.220.tgz","fileCount":34,"unpackedSize":139151,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCID23PI136zZmdKzbdMLDPFDunvhNaMzgjFdW2ckL3ALNAiEA1kYn0RUk+2LvvObTswpTKKfSgVdU8PVrt/Bwuhy6RVc="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj9/YPACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoNeA//fdXz6V3RY/bABzrblXtvcV5tKbenWpuqMWjOzcXVINNJxXFD\r\nIKk7mLoAORs281itKEYjfJbC5MIUcYBOQQkCffmWTGT4vBjskfqWWls376O1\r\nHWo+klGcTMwCoYHhdnVNMaxJy5itiz4o37DHf4+nlPPkxcatf/ZEXfs5zDFg\r\n82tp9mQ8oLN4RVbjpTYl975ALRvkiViJkZUxbz0mPC70GlNWeJtWS9BEofJf\r\nqxOSM6/AbgN3IAXIvvYHqVTW7fR3vJ2hv+Z/DuWLD8oVyP/AXU641YLkzjjy\r\nhJ35yN9PeO7/r2MNd4NA8uJNuWOmjF8N85rK78Wlk9+T3l3vggMKJADFOhNR\r\n0Tju1OtifKR+lcB0lGhZVfae9YYEyC0Go3vJoxfYrUo6UrqU3NfphrXUBKat\r\nlWMLUr5YLUF8yLAs7GdfatKxVwp/ezypwbyhXtce268FTQRO3fQhrL8DnID2\r\nr/cfdQAX4MJTrDDS1KvkNLlFJ6CFkSb1bTAAwiUAglSDp5XGzo/G4Y/0sEF4\r\nquBKkNI3brQunKh4PK9LQ/t695yq6BJBg6Bi4ChIRWU2T+cRBWkaR4KbvCxl\r\nT/FCu6EA7/pdPcBpiLl9gMaRi11rARAcvebYau6YIRYoYWvLHhgZ6kILEGRj\r\ngBR+EL5+Z8vKHKKW7h7tK+fIERDZI70NRgw=\r\n=TtjB\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.8.1-unstable.220_1677194766982_0.7847145856375206"},"_hasShrinkwrap":false},"0.8.1-unstable.221":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.8.1-unstable.221","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"^0.3.0-unstable.17","@sphereon/pex":"2.0.0-unstable.9","@sphereon/ssi-sdk-core":"^0.8.1-unstable.221+66cff3f","@sphereon/ssi-sdk-did-utils":"^0.8.1-unstable.221+66cff3f","@sphereon/ssi-types":"^0.8.1-unstable.221+66cff3f","@veramo/core":"4.2.0","@veramo/credential-w3c":"4.2.0","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.5.1-unstable.1","@veramo/cli":"4.2.0","@veramo/did-provider-key":"4.2.0","@veramo/did-resolver":"4.2.0","@veramo/utils":"4.2.0","did-resolver":"^4.0.1","nock":"^13.2.1","typescript":"^4.6.4"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"66cff3f98096f061b797655e1d83f64a03e74663","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authorization request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst authorizationRequest = await agent.getSiopAuthorizationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authorization request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationRequestDetailsResponse = await agent.getSiopAuthorizationRequestDetails({\n  sessionId,\n  verifiedAuthorizationRequest: createAuthorizationResponse,\n})\n```\n\n### Verify authorization request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthorizationResponse = await agent.verifySiopAuthorizationRequestURI({\n  sessionId,\n  requestURI: createAuthorizationResponse,\n})\n```\n\n### Send authorization response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationResponse = await agent.sendSiopAuthorizationResponse({\n  sessionId,\n  verifiedAuthorizationRequest: verifiedAuthorizationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.8.1-unstable.221","_nodeVersion":"16.19.1","_npmVersion":"lerna/4.0.0/node@v16.19.1+x64 (linux)","dist":{"integrity":"sha512-5agg7BN1WNgtk/jMibyHWoEPwbzcPAz65LjndX8yP0s6t9iE9Mx5WOIvqGtfxBEErJCgZ37DxeGxeMd/cmqioQ==","shasum":"fa7f0facda246e7948da4636bc0b981f0c65ac70","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.8.1-unstable.221.tgz","fileCount":34,"unpackedSize":139151,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDiucGV8N96KUzCAjeicYL7pIf0JjurIIqJwREOrt9zeQIhAM70+Aqe5ZGjb2xiJDTU1g+VRI3LfdPy5e7LXfDemz8e"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj+AVTACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp+oBAAgaiH2pKzjngELN3zYNLg79oX0ZLKUzar8Z0gNiuyRBL7ADmZ\r\nkIwCn4TBNcFmr/tlCsr1+7bPAt1dxQud09ykrFRCDBUjLh+03vSE4wd9ioXX\r\nudjXdvsPbla3xm6jNhJo8sHyywVGAaTVPNzae/rZUaoEejO1VI38OnTFwe2/\r\nlgSKCZA90K5K9ueWswpeWv8rZMoeqQ+9Z7xfS3Mkchvbi0uW8viINkjGrYv2\r\n65us96chuzHyWhwd1atOxJqtXmVOlzBv5Z3ZK3B0OpN9A3jdxfTia5L0uV8w\r\nh/dEIJtdBhnlqMQfEedaNOf2V+KbttoNVQZ/CXrOBPJYLIX7Iftir6APrndd\r\n+QQootgqaK0nrsrU4O8+O5Q7ja7KDOcjzuVgN3p0/EtsoGnHgfh66pqotF+n\r\nvOwrijqB82INA2CkUOTi/XG6/z/jSzpvP9IUWidhvMyGVE/LEDSEHeOP8Xf6\r\nSQ+Pv6iA1ABxJ3kmISU5t7nziwTwWhz5NARvCzj7gmCoQiJpqQP8hfH6AgXM\r\n7vARxdpugXPobXmpeJVBWNJgN5KjLtZcJIYGPl+KpLTw61PgXctT0a93KHMs\r\nPuPcXKvfIFVi0ryAGHS+8x6/DJMPGXCfkMjXvCwdGa6xA9gHFrYpHOcjwg72\r\n4hguFTzRXrknXkKWvXKTQlRT0xtpBaXSYQo=\r\n=6EOH\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.8.1-unstable.221_1677198675132_0.9962588496360762"},"_hasShrinkwrap":false},"0.8.1-unstable.222":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.8.1-unstable.222","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"^0.3.0-unstable.18","@sphereon/pex":"2.0.0-unstable.10","@sphereon/ssi-sdk-core":"^0.8.1-unstable.222+4b14542","@sphereon/ssi-sdk-did-utils":"^0.8.1-unstable.222+4b14542","@sphereon/ssi-types":"^0.8.1-unstable.222+4b14542","@veramo/core":"4.2.0","@veramo/credential-w3c":"4.2.0","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.5.1-unstable.1","@veramo/cli":"4.2.0","@veramo/did-provider-key":"4.2.0","@veramo/did-resolver":"4.2.0","@veramo/utils":"4.2.0","did-resolver":"^4.0.1","nock":"^13.2.1","typescript":"^4.6.4"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"4b145421eae3e49df6417bfa296585752ce4c295","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authorization request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst authorizationRequest = await agent.getSiopAuthorizationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authorization request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationRequestDetailsResponse = await agent.getSiopAuthorizationRequestDetails({\n  sessionId,\n  verifiedAuthorizationRequest: createAuthorizationResponse,\n})\n```\n\n### Verify authorization request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthorizationResponse = await agent.verifySiopAuthorizationRequestURI({\n  sessionId,\n  requestURI: createAuthorizationResponse,\n})\n```\n\n### Send authorization response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationResponse = await agent.sendSiopAuthorizationResponse({\n  sessionId,\n  verifiedAuthorizationRequest: verifiedAuthorizationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.8.1-unstable.222","_nodeVersion":"16.19.1","_npmVersion":"lerna/4.0.0/node@v16.19.1+x64 (linux)","dist":{"integrity":"sha512-3891f7vKTmrtNuwKLOb+FPCxO1/FfhOBOZr8JssvfpwULi1go2DD7S9E0NTcvVDAP7yBbKMHRXrPzBTva6dlhg==","shasum":"a0b2b63219ec493b3b521390a647f110b17d9fa6","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.8.1-unstable.222.tgz","fileCount":34,"unpackedSize":139152,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCFd6dNvtMFbpSFHgZRgnO1UwbsqT8hAAWpWKtdHz0BUQIgbyamcoZqZmt8hN1oaUXc2TdHYQz951mjEfi/7XxMi7Y="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj+BIFACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmqhfw/8D9YARmMsrAOoyiZ1SqvUa0Ys/Vl77+ebRMWdIUh271ZhoWhZ\r\nR+Tprm+I/R3rAMpTOStTOUIi7GB9nJcSCqKJD7cyWhLc8HJOxIjeqsurq98u\r\nspKlJl5UB/5JMI2Z2/v6V3U3uof4xhO9o7sfWXOHR75S/ymEWY8j0XPYiIX5\r\n1noFhJaDhyYl4S9aNf38XFnjOBlt1hObAbVZCM7sXw8L+GQ0W7Jsu/2LTMi5\r\nCsDUt4StCFOHIWW6AMYMwmF2JHTNe8JR8hBzBm13cgT6xxN+BpSIhLT5TaBw\r\nthX9OCmj75sBV3DSaxGE/ZMruJf4eUtbxRozjr7HArg+0FxM5pEkO79CVIgo\r\nQJG0xY9NMeDXasvNRK40T33FIrO31rrF0z/m77WbT/pvLRsz2hC87flu9OJ+\r\n3VZ6jxcGl78rhoyyhutiJhrhRX8NyTElG+/Essbq/3Ah3QT9c0ferNlnxZQh\r\nCQAG+cjNz28D+RiENjw+6HRAFHt+jqBuc4baVVE67TdvnCl1OG4nvQYZZvPm\r\nX/aNmzzrMtoEdnGgIDR2bPU7nNQajHWMB30WCIDFAy1N3W7md+3obE8d87I3\r\n4cOLoNVGu3349zExrKs3yBRIAZ4vsYZQ1Cw5Gvcbif0QF5UwVtsCnc5gjt6o\r\nmBgHlsGGSnIztQB88GOfjGKSIgCQbjHIyKs=\r\n=OapK\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.8.1-unstable.222_1677201925552_0.7952271629886045"},"_hasShrinkwrap":false},"0.8.1-unstable.225":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.8.1-unstable.225","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"^0.3.0-unstable.18","@sphereon/pex":"2.0.0-unstable.10","@sphereon/ssi-sdk-core":"^0.8.1-unstable.225+5a87aa3","@sphereon/ssi-sdk-did-utils":"^0.8.1-unstable.225+5a87aa3","@sphereon/ssi-types":"^0.8.1-unstable.225+5a87aa3","@veramo/core":"4.2.0","@veramo/credential-w3c":"4.2.0","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.5.1-unstable.1","@veramo/cli":"4.2.0","@veramo/did-provider-key":"4.2.0","@veramo/did-resolver":"4.2.0","@veramo/utils":"4.2.0","did-resolver":"^4.0.1","nock":"^13.2.1","typescript":"^4.6.4"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"5a87aa3eeed588b910636b358c7d718ae74f54c9","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authorization request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst authorizationRequest = await agent.getSiopAuthorizationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authorization request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationRequestDetailsResponse = await agent.getSiopAuthorizationRequestDetails({\n  sessionId,\n  verifiedAuthorizationRequest: createAuthorizationResponse,\n})\n```\n\n### Verify authorization request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthorizationResponse = await agent.verifySiopAuthorizationRequestURI({\n  sessionId,\n  requestURI: createAuthorizationResponse,\n})\n```\n\n### Send authorization response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationResponse = await agent.sendSiopAuthorizationResponse({\n  sessionId,\n  verifiedAuthorizationRequest: verifiedAuthorizationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.8.1-unstable.225","_nodeVersion":"16.19.1","_npmVersion":"lerna/4.0.0/node@v16.19.1+x64 (linux)","dist":{"integrity":"sha512-A42mFPejhvMKJQD0/xwHsOOD/wdDcfO8ETdbsoRuw0gtEE5m/wgCT5HXRc56BkXFMEq8SLoQTVusfc8H1eLJTg==","shasum":"cc469c47d7f60c7073b3d7d7796599935136ffe8","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.8.1-unstable.225.tgz","fileCount":34,"unpackedSize":139152,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBLrFKOOJHls2ZuX1BaxfmU2rAfsPgJHYwgtqnr02uEgAiA7n2Qvq29NSP6fNwAhInc1czEM0rWN/9ZU6y0kQ2Ed3g=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj+Dh/ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmppaxAAnkjJju3Kp66YSPHexqLtNzFvkAtGCIEoTtJAjPRcio0aUvHa\r\n63IU4jBnVzpFnCtKOG1t1h9K5ohi86CWkeHaZtf0BDgLUQ8sH5Ss2kVsGJTY\r\nY2XIYIo+bB+CJyofr/3Sy52NEGihcij6SNba2lq9ScejWrfO5hMD8qKfhuBM\r\np1dSJIEs0n1wrhSb4W/011L33nsLyTy1GIDXuo9RInhUMABt3sSgncYcaTZv\r\n5bBxICB25wOGtYkebszhpNk14ssX//ily1N8V2Uk7/N8CMnmCqKzHJiUGrHG\r\nLq0x/2wf/azjg67k9Cq7yqI7Wrd0IDUrvBzUwrAVRKOq2eSPDWLcuX0sQQXW\r\nJZ/gbVyUsSWoN5iRZBOVgkioNK2BvQxCLrNrwcbkv2hifTPTfe4y1hsnaoPn\r\nzF+KJoVZw3bCKw6oKct6PCOU2DH6Wl9e6cQcpAROc6rgOFm8dHIAEW+1evZN\r\n9ThXwSGZFP0gkwPKdWI/9hpFOhnUJk3Jfdbbh+CsP6PNKzZ+bqDAeQhpLWhq\r\nz1rHuz5jxbmiqRVMQLbDyhsjcEwirkeVq0jXnSd0dmwoJ32+Adwt+Rwedixv\r\nF1PaCQsXRIEwn292podcGgOikZ8HXNGHmYE4RRIG+vMXVWVDba6K6iKAT6L/\r\nOSGEBnj8yHQS46sPP4z+NmtoaOjomHJa6iY=\r\n=6vCu\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.8.1-unstable.225_1677211775462_0.7841414862758498"},"_hasShrinkwrap":false},"0.8.1-unstable.227":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.8.1-unstable.227","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"^0.3.0-unstable.18","@sphereon/pex":"2.0.0-unstable.10","@sphereon/ssi-sdk-core":"^0.8.1-unstable.227+b7ab1a0","@sphereon/ssi-sdk-did-utils":"^0.8.1-unstable.227+b7ab1a0","@sphereon/ssi-types":"^0.8.1-unstable.227+b7ab1a0","@veramo/core":"4.2.0","@veramo/credential-w3c":"4.2.0","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.5.1-unstable.1","@veramo/cli":"4.2.0","@veramo/did-provider-key":"4.2.0","@veramo/did-resolver":"4.2.0","@veramo/utils":"4.2.0","did-resolver":"^4.0.1","nock":"^13.2.1","typescript":"^4.6.4"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"b7ab1a095dcff2bdacfd93c99a68baf8ef37146f","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authorization request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst authorizationRequest = await agent.getSiopAuthorizationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authorization request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationRequestDetailsResponse = await agent.getSiopAuthorizationRequestDetails({\n  sessionId,\n  verifiedAuthorizationRequest: createAuthorizationResponse,\n})\n```\n\n### Verify authorization request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthorizationResponse = await agent.verifySiopAuthorizationRequestURI({\n  sessionId,\n  requestURI: createAuthorizationResponse,\n})\n```\n\n### Send authorization response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationResponse = await agent.sendSiopAuthorizationResponse({\n  sessionId,\n  verifiedAuthorizationRequest: verifiedAuthorizationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.8.1-unstable.227","_nodeVersion":"16.19.1","_npmVersion":"lerna/4.0.0/node@v16.19.1+x64 (linux)","dist":{"integrity":"sha512-sDw0HWbZT8+VBiYbei9F56opvUMfmQVzCeb4Mb69XDlP0jXN1xVepDL5QpqeXFK50ZaE4OvkAieCUrclN9G6bg==","shasum":"d7de20ce2358a8484683206ad5201dc31a236b09","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.8.1-unstable.227.tgz","fileCount":34,"unpackedSize":139152,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCrt3ABhKIvtnox7eNYdIjZ7Fy5gwQ/lQfv5FQe4W3ztwIgWL1O4RhHIaPrqkjyYV1/QBFiy8JNeKVcD8i4dfewzq4="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj+V5KACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpNbg//csEAzLoabgp4O0FmYwwiu0bLFkvy5584CoFn2L99g7VN9eHx\r\nK2vwsP7zPfrGutms92sxNe1nwrTfv0BuOJL8aynf6kzorwsgWTY6Vt5ypzls\r\nXsZLUZLN17wJUYOO4Queb8ZWfWLScOkcY1H3blwJVWxOUVbVYEFl2wSVBoHD\r\n3jJZTvpKeEkf2kUIFvVy6/ExzYJrr5oyOd5MXBfA6uGxZNStwhm1Dj+JSiT5\r\nFlbC80jOmDxmlcZwOMqJGA2/kdk8WUd2ckeILMXK5F0rvDOPSkMk0pvHK2CL\r\n5VfpaNMc9opXW8gYpknK0eQPY4p/oEemLx5LbLWCzAVkP3WIZE21fqJUhAkP\r\nQ/jsHOU/01WzCtI+28gGjBmk/wZjlT+Z+612XYGdi1A13lTZrs3Qyln7ZQUa\r\n7Wq9g/BVimFBt/qFJaY2Wsc1aZU5r5/M4uhlkv6C/2EhQIiKOuSBFrVRCQh2\r\na+hymYRARHCTPov5rznFEqPjcUHnwGlo6TrTLwnvn1g/hJjfTvlQGYrGUxPK\r\nFSacq3cuwQVbKVeb7TPr0tp6k3Be7HfXpNUfR+qMXwrZ26mnlp1i4s6eeCWH\r\n6gLKJhzuaJoq3riKBbF+0yK4zcwwbqzULkei0KGrR7Aq9klo8/WOZXUGxl3r\r\ndyfEY0Jd7gDyfi9KsQU0vcRG95WfunQDkdI=\r\n=mAZl\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.8.1-unstable.227_1677286985913_0.5670929927776789"},"_hasShrinkwrap":false},"0.8.1-unstable.228":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.8.1-unstable.228","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"^0.3.0-unstable.20","@sphereon/pex":"2.0.0-unstable.10","@sphereon/ssi-sdk-core":"^0.8.1-unstable.228+d19bd2e","@sphereon/ssi-sdk-did-utils":"^0.8.1-unstable.228+d19bd2e","@sphereon/ssi-types":"^0.8.1-unstable.228+d19bd2e","@veramo/core":"4.2.0","@veramo/credential-w3c":"4.2.0","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.5.1-unstable.1","@veramo/cli":"4.2.0","@veramo/did-provider-key":"4.2.0","@veramo/did-resolver":"4.2.0","@veramo/utils":"4.2.0","did-resolver":"^4.0.1","nock":"^13.2.1","typescript":"^4.6.4"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"d19bd2efe1ada5c3854de7b86cd6e2e13689d86a","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authorization request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst authorizationRequest = await agent.getSiopAuthorizationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authorization request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationRequestDetailsResponse = await agent.getSiopAuthorizationRequestDetails({\n  sessionId,\n  verifiedAuthorizationRequest: createAuthorizationResponse,\n})\n```\n\n### Verify authorization request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthorizationResponse = await agent.verifySiopAuthorizationRequestURI({\n  sessionId,\n  requestURI: createAuthorizationResponse,\n})\n```\n\n### Send authorization response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationResponse = await agent.sendSiopAuthorizationResponse({\n  sessionId,\n  verifiedAuthorizationRequest: verifiedAuthorizationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.8.1-unstable.228","_nodeVersion":"16.19.1","_npmVersion":"lerna/4.0.0/node@v16.19.1+x64 (linux)","dist":{"integrity":"sha512-Z0qDFztdp384686u0uvyZ2pWmoKWXndR3FcmZcjVx1+qvsO4f4h59cGv4oENqwCRoPqzc8uaI92IEUxF1bBz3Q==","shasum":"ddfa987753c6236a3ac349830ab21a5e9b8b0b6d","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.8.1-unstable.228.tgz","fileCount":34,"unpackedSize":139152,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGRs2LJ2sLJyPmhM7cuD20tiXzQQ9J3g7c0GEMxBGpcCAiBe3cuKegwXK7p8Q4hcmsUGLNzsGPsBFfnvKkbEbyfRfg=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj+tD/ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp1wQ/+M2MjAJTi2EuFwxPrQQ1xqBKY2xfP6/TCxKqFE/MNG6MLWfRX\r\ncBr7fQuDWg+0xAhu+ueqfDue3mEYzKtGIXtymjpj+ysTGWIpNyXtFy/Ss2nQ\r\noiZoa/0aflNpJs4+opqnO/u8kZNRF+r55O6JH4MB/T+i2nmwYIRJFqOOtiOQ\r\nj3lpFIeiKDaTOip3K2a8uBgyZpL1L6jnxo6h5QwiAlgDfGZWP7yTNuBadsTh\r\nYY/eUtbSerRG8PvRrO68FgCPPcJc5JatHJLEdZfOgaDxZzqGt0KJ8SV7AuV/\r\nlEPEdtwx3hHWVzhkQJJrP7IJyTs+i5nSrlp/vu8BxdYORkr/ba2PgoZRRdyQ\r\nklQg7evgAXqckt3qJQ1LToRKhQ2SCWhohZKqWqFpirauVKsIBA/IOUeo0Ktj\r\nz/pBdLMzAWh8CPJxWPg+tpzkxoAyOorq+g/fdLX3rvFN+vfgzLBWa5QWsM3J\r\nZ7UCXnNwzT3XXxvoqZgwLL2GZ/Vsu67raqeyCluV/JfQxreP5vwKk7uWifmV\r\nforP5J2NGDgs0Nhx+vFAQnon5KiVdzqDK3FZlXDOd2bj8nB+ksutpt3ue3Rw\r\n8JcwxEXx3Q5y0Pqh/pYC8j9baIyll6PrvgB/8U3rJzHZiQ9Ex5PJKtetLS2w\r\nMD+KR+My6L/+2C4CGEC4Ak0v2xSb+A7feq4=\r\n=qiPk\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.8.1-unstable.228_1677381887093_0.9714238385675968"},"_hasShrinkwrap":false},"0.8.1-unstable.229":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.8.1-unstable.229","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"^0.3.0-unstable.21","@sphereon/pex":"2.0.0-unstable.10","@sphereon/ssi-sdk-core":"^0.8.1-unstable.229+457a5f8","@sphereon/ssi-sdk-did-utils":"^0.8.1-unstable.229+457a5f8","@sphereon/ssi-types":"^0.8.1-unstable.229+457a5f8","@veramo/core":"4.2.0","@veramo/credential-w3c":"4.2.0","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.5.1-unstable.1","@veramo/cli":"4.2.0","@veramo/did-provider-key":"4.2.0","@veramo/did-resolver":"4.2.0","@veramo/utils":"4.2.0","did-resolver":"^4.0.1","nock":"^13.2.1","typescript":"^4.6.4"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"457a5f8f586050881b170d35c89716f9b72dd139","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authorization request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst authorizationRequest = await agent.getSiopAuthorizationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authorization request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationRequestDetailsResponse = await agent.getSiopAuthorizationRequestDetails({\n  sessionId,\n  verifiedAuthorizationRequest: createAuthorizationResponse,\n})\n```\n\n### Verify authorization request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthorizationResponse = await agent.verifySiopAuthorizationRequestURI({\n  sessionId,\n  requestURI: createAuthorizationResponse,\n})\n```\n\n### Send authorization response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationResponse = await agent.sendSiopAuthorizationResponse({\n  sessionId,\n  verifiedAuthorizationRequest: verifiedAuthorizationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.8.1-unstable.229","_nodeVersion":"16.19.1","_npmVersion":"lerna/4.0.0/node@v16.19.1+x64 (linux)","dist":{"integrity":"sha512-PcI8Y3NZ6LUC8THwJsizDLSm61yl56xat7SI8sELMMXFxBmihRUYQffiK1mXkwjPBdq2g48e9p4OHXp6edUQuA==","shasum":"0df4b23b4ed0014c2464f0904c75001a62c76bf9","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.8.1-unstable.229.tgz","fileCount":34,"unpackedSize":139202,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGSuwm2J+m2n1Icica0r8D/yMfM1AwxorGyYdrHm6GdtAiAI8h0olruqz0QC20ldsJXXytrZlEkEVdbvJoBoqhG6Kg=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj+wUDACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpSOg//WiECbbMG/YhMx2moPap5TTaPsbaqn5m7wfZUB3fuxI3uuchz\r\n8yo5E7z5Y5SAHnOISOGphSdmbaFb8WYzLb/vdRQQwMGbzgzRt7Imzu8Zyk10\r\n3Hh8FlCpNcG+u+NMSOnJaPL84h2XpUvq6sDQo3K8385XieTW+H4PY6Fojh5o\r\neU+6vWE5ugCcoHUGEMyr1JqDM41r24u+UfxsxoLur6l8FtbCyLWeqDNhbwMC\r\ngZwyD9UzkX9OjNhtyQE8+nTndD58vtygUloDtPOzVD+ElS3kXi3uILo31+Ml\r\n0dfrV59w3m1t3N0gP5CmGt8hIzUi5VBzEIOXJ1jDaijcMseiFT5iHstH57kp\r\nxEPAl+1ZcUyYZkZ+7zd7X6wYbXi1HBUmzh/o2ovlsXhKraluqBi1fa9xGLXA\r\ntmRXiP+eLO78q/8ASIGORsGHylm8a15JhKWI+PsyIF8W+0RXRAPMnGZEh/C3\r\nuW1ERudDGM/aQ33U4XRiEY9bJHxlVUWhax/Z8oG5HnAxqBw2JGNFL1lMRH7h\r\nShH1i4XvSnOmOzaCYZ2cAx7zWtFG6e0HaMDdF9K6XKUgxAHbMEvYC8S5uLA1\r\n5qiy6re2T5Bpqk2JQR9jAkhoUlW2zS+yhM7RJVTVefnKIlwBdDExCJ3v9Tw7\r\nYmjXGP0bNf4joUXB/APwdlKtZpeHVNvBo+Q=\r\n=t/T+\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.8.1-unstable.229_1677395203187_0.3141462794496559"},"_hasShrinkwrap":false},"0.8.1-unstable.230":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.8.1-unstable.230","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"^0.3.0-unstable.21","@sphereon/pex":"2.0.0-unstable.10","@sphereon/ssi-sdk-core":"^0.8.1-unstable.230+1139352","@sphereon/ssi-sdk-did-utils":"^0.8.1-unstable.230+1139352","@sphereon/ssi-types":"^0.8.1-unstable.230+1139352","@veramo/core":"4.2.0","@veramo/credential-w3c":"4.2.0","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.5.1-unstable.1","@veramo/cli":"4.2.0","@veramo/did-provider-key":"4.2.0","@veramo/did-resolver":"4.2.0","@veramo/utils":"4.2.0","did-resolver":"^4.0.1","nock":"^13.2.1","typescript":"^4.6.4"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"11393527630c48fdb34f5f2394b96305a9597ac3","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authorization request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst authorizationRequest = await agent.getSiopAuthorizationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authorization request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationRequestDetailsResponse = await agent.getSiopAuthorizationRequestDetails({\n  sessionId,\n  verifiedAuthorizationRequest: createAuthorizationResponse,\n})\n```\n\n### Verify authorization request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthorizationResponse = await agent.verifySiopAuthorizationRequestURI({\n  sessionId,\n  requestURI: createAuthorizationResponse,\n})\n```\n\n### Send authorization response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationResponse = await agent.sendSiopAuthorizationResponse({\n  sessionId,\n  verifiedAuthorizationRequest: verifiedAuthorizationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.8.1-unstable.230","_nodeVersion":"16.19.1","_npmVersion":"lerna/4.0.0/node@v16.19.1+x64 (linux)","dist":{"integrity":"sha512-3nOSVd/3N17E+MpDhDKFu9/0F+4Yq24U4LSQdKrjhnYimruJzaCkjj+UJkfnDqlHWP9tMZogA8t7F4fz3IR5+Q==","shasum":"54c267426e77f0e3314ae40cb0861a10034eb810","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.8.1-unstable.230.tgz","fileCount":34,"unpackedSize":139202,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCz1YdGMm4FwlDFCfEgD4poYHc4gpXhEybJHenLdAwq3gIgEa83yprj6WuwKHmIjbUP4qVukN5mWPSrCP6pqSCD+wI="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj+wvqACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqKWBAAmNCCiotH7kC2Jc+nCBT+Vt3gFVLetSAIPppdOFKn9FXi/663\r\nPRDv7poKMpTeUzf8rcZnT1c0RJ7mcRVtAqFVhXuCPtGX58dwYiAY4zGUeS2a\r\n9KNsQltitM8/O+lYqMftjc3qw5iesccXuiDYmXHh44+Sc68I6tjBgXSnv5X6\r\nS+V3ej8sB8uVrq6YicPbqPCWdUB6mae93G+7VW0G7gDASb9I7bHOY0FSRGMx\r\nTTdaMdwgFiUPWJq2hR6DKRoH5IOoFdvuawOhJ3bgDkjP3NE/EHVhw0yZyyHH\r\nS8euWzedlIVlKhZXe4mpv6uQOPUIkGHpdVtrR5A3bp2QP+IsdQedQ2I+aCU4\r\nCOdm/udGq9GKKfgnBSWmbNDKIObhJSfUvEn/XRL571ZOfIBEAaLaoS+f+yFi\r\nga0auO0jkP2gow0GtdXs505gQrx3NuXWBG6bb63zp+YFzMc/KrV2t34yWBn2\r\naJW2DsHGBD3uEvGlJ5t4mpYwM/liXySdyL/XyYiYoG2dunEYS0af7d/PB0f6\r\ncsTuycBBQIfZJbp6XU55S6UaA6rhmzIdOmDfiBQHSqhR2wNa3B2IZCtwa4Rr\r\nt9E4f19R24Uj3F9KdI1dSvR/8x57dRH/rhXq8aNNVABss2wamxaYM0yDAKjp\r\nTSKx9s49TmDU6HrB5iLNgwvcQJj5KrNqyAo=\r\n=bGlV\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.8.1-unstable.230_1677396970094_0.14854254951709778"},"_hasShrinkwrap":false},"0.8.1-unstable.238":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.8.1-unstable.238","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"^0.3.0-unstable.21","@sphereon/pex":"2.0.0-unstable.10","@sphereon/ssi-sdk-core":"^0.8.1-unstable.238+ec062f8","@sphereon/ssi-sdk-did-utils":"^0.8.1-unstable.238+ec062f8","@sphereon/ssi-types":"^0.8.1-unstable.238+ec062f8","@veramo/core":"4.2.0","@veramo/credential-w3c":"4.2.0","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.5.1-unstable.1","@veramo/cli":"4.2.0","@veramo/did-provider-key":"4.2.0","@veramo/did-resolver":"4.2.0","@veramo/utils":"4.2.0","did-resolver":"^4.0.1","nock":"^13.2.1","typescript":"^4.6.4"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"ec062f8ec01de800469ef10b05b0a79a5ba5dea7","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authorization request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst authorizationRequest = await agent.getSiopAuthorizationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authorization request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationRequestDetailsResponse = await agent.getSiopAuthorizationRequestDetails({\n  sessionId,\n  verifiedAuthorizationRequest: createAuthorizationResponse,\n})\n```\n\n### Verify authorization request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthorizationResponse = await agent.verifySiopAuthorizationRequestURI({\n  sessionId,\n  requestURI: createAuthorizationResponse,\n})\n```\n\n### Send authorization response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationResponse = await agent.sendSiopAuthorizationResponse({\n  sessionId,\n  verifiedAuthorizationRequest: verifiedAuthorizationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.8.1-unstable.238","_nodeVersion":"16.19.1","_npmVersion":"lerna/4.0.0/node@v16.19.1+x64 (linux)","dist":{"integrity":"sha512-HzY4FAkx6RRoiQZn04KhMKIPmSlnDrwp25rby9fyDvnuXJ/ACwrD7EhscJiiZsc9G/vbgW+8f6JoWkqwepeLzg==","shasum":"e2fcaffd325d9ef8ab9cfedfe94b6d47d6822371","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.8.1-unstable.238.tgz","fileCount":34,"unpackedSize":139202,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCJm1+dndXPSgAuFAJVVue/Eaw129iJv16+7WixAROa6gIgZZ5Pc9OmNSexRXSOP7ldYOy6XkNlEKHMwXtISvzFm8o="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj+ytkACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpEew/+LfXVU/xtxlc72IzSUwUULEtO+LPoHM9SZFpeMJcPYxVzZi1G\r\nM22qg9yI0NL7ZLk2wLO3/dKnhzsMBlyDnzq/d79H3mPwpN5td9QemqyRQOkD\r\ngf/6VxSzk1APpwZCXX7w6Rm0B0volsP5PKq/SDjC2ZOTyJ8LAiCLi6nS19ZJ\r\nfuo0cEt236e9++7I1aH6pIWsAEsHr1nECAN14O/IxgQJANwmf0AILstBmcM3\r\ntrJrLam7l8Lkl39E/tZX+L87RjdMLNM58NvWjf+iQrTkLBhcoynRuFm/UPXa\r\niteeNV0m6QYjclgBZc+Rm9iXn7T8/90Rmwz4iiqw+gQAa75vcP2X05MGXy9n\r\nobalKmS31CQL5AmPoFye9AAmB+A1GyRErGNoYUyIhszTMPPEOdyiJIu9Jyxk\r\n2DGej1HZMOPgLgfRMhPCN01oDwiyrxjrZ0ngluyB5fdOfyzj25SMPzsUL2ep\r\nBa0Fs5TWtL9l6ne+dKFKeMPYw3SxyPkK93izcUC2XHyF1ejNONEjpdYovUUO\r\njQMTKE7xxNZ76xQZYsiRiQfLgjnhtyQ2+EjRP1HgaWlNKaVJjFX3hH0sIfLk\r\nzHr9OWGaSMD51tZJoGQvNavT69nZ5dEpMm92KzXzbiGBj9gvJ2SuZM5mxEeH\r\nLYK8eRz/HG2AxIvXJr4PfAfLhaAnoRppR4g=\r\n=B6gg\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.8.1-unstable.238_1677405028413_0.4464882035034605"},"_hasShrinkwrap":false},"0.8.1-unstable.239":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.8.1-unstable.239","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"^0.3.0-unstable.21","@sphereon/pex":"2.0.0-unstable.10","@sphereon/ssi-sdk-core":"^0.8.1-unstable.239+ffdc606","@sphereon/ssi-sdk-did-utils":"^0.8.1-unstable.239+ffdc606","@sphereon/ssi-types":"^0.8.1-unstable.239+ffdc606","@veramo/core":"4.2.0","@veramo/credential-w3c":"4.2.0","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.5.1-unstable.1","@veramo/cli":"4.2.0","@veramo/did-provider-key":"4.2.0","@veramo/did-resolver":"4.2.0","@veramo/utils":"4.2.0","did-resolver":"^4.0.1","nock":"^13.2.1","typescript":"^4.6.4"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"ffdc606a95d43d831fa9fe2eabfacf47e62d1361","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authorization request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst authorizationRequest = await agent.getSiopAuthorizationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authorization request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationRequestDetailsResponse = await agent.getSiopAuthorizationRequestDetails({\n  sessionId,\n  verifiedAuthorizationRequest: createAuthorizationResponse,\n})\n```\n\n### Verify authorization request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthorizationResponse = await agent.verifySiopAuthorizationRequestURI({\n  sessionId,\n  requestURI: createAuthorizationResponse,\n})\n```\n\n### Send authorization response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationResponse = await agent.sendSiopAuthorizationResponse({\n  sessionId,\n  verifiedAuthorizationRequest: verifiedAuthorizationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.8.1-unstable.239","_nodeVersion":"16.19.1","_npmVersion":"lerna/4.0.0/node@v16.19.1+x64 (linux)","dist":{"integrity":"sha512-dPMnkrN7bYGeV/JRtGPr6PJ1BNmEAkff0OYKKU8/aR7xDBy0bFW5FyhM+yy/AUMgdNl6aOAEDZbuxwR5srtCSQ==","shasum":"73eea03b4affb9f7c5e108bca2f93b67876b28df","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.8.1-unstable.239.tgz","fileCount":34,"unpackedSize":139202,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDqKaSd/kRQXowbJ+dJAjxK6BM87p6zUqam6SHThr/3oAiBu3fqXTpuLYBr19FC9OOPUY8L6LjBNvkJnU6TQM/wRZw=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj+43QACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqEIA//ao40TuZCCta/mE3dely4XFVk5pQhQ43znqhF4X+2NXFLjE04\r\nxQ4GHqDqMCW3yBzttWDxL11GtZEaFXqAZiB2AbP0s6REY/hWDzGBlNUiQe2q\r\nnfj2wQn7Ugg+1JPBKyx7vyv1i0zJ3K1VCsuIGn94osY/QzELQ2c6zRqLhMRC\r\n6tWn1ZHIu/nffXOqepvJVmJevz0YJv9ldXlG8zGdG7DW+nqwJh+7gNw0T4cR\r\nKoQOlYyzQRuLmI4ao1yMGT/0l8B8sXj6l2Vk7f015V7KYM9lbzyhhhXyxf+J\r\nFq8nWe239n7cuT+t2k/tZ54g1f9W4A0XFXKBvHJfehikpILHyAagUvxepDD1\r\n9ob6RoeNWy0Vycd0l/jd8oD75ATgP38qx8s5KOPSal9g7vnewSZpGCoJYDKF\r\naSC2IONqkCc+MkHpD9iMeGXzDPuh/Nrf17vcrTG6t7OjJjwQgH6f04R/Vof2\r\nfdrN1md5YGbTpB2FZZjilDZ5MBfCfUg/2cY7LeSAXjrDcECH4GgVyDGHJ8UM\r\nO+rc8f2py9mTxcZ0VsKE2rO+iJJGexE+1s86kcy1JubkGRrTGLbgrvwSZGzW\r\nPyEhrGk8TTTBqrPlUtquswQeDaM6U7hn3EDNaY6sMHcx9tNUsGF10iva6mhG\r\nMaZBLdC+XxpFu+shfZHIPtrm+okrgNtqfLw=\r\n=mWTq\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.8.1-unstable.239_1677430224135_0.6287508811720259"},"_hasShrinkwrap":false},"0.8.1-unstable.240":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.8.1-unstable.240","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"^0.3.0-unstable.22","@sphereon/pex":"2.0.0-unstable.10","@sphereon/ssi-sdk-core":"^0.8.1-unstable.240+2fcf72d","@sphereon/ssi-sdk-did-utils":"^0.8.1-unstable.240+2fcf72d","@sphereon/ssi-types":"^0.8.1-unstable.240+2fcf72d","@veramo/core":"4.2.0","@veramo/credential-w3c":"4.2.0","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.5.1-unstable.1","@veramo/cli":"4.2.0","@veramo/did-provider-key":"4.2.0","@veramo/did-resolver":"4.2.0","@veramo/utils":"4.2.0","did-resolver":"^4.0.1","nock":"^13.2.1","typescript":"^4.6.4"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"2fcf72d1acff4ea1b3b09543c37b75d098eec2e2","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authorization request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst authorizationRequest = await agent.getSiopAuthorizationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authorization request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationRequestDetailsResponse = await agent.getSiopAuthorizationRequestDetails({\n  sessionId,\n  verifiedAuthorizationRequest: createAuthorizationResponse,\n})\n```\n\n### Verify authorization request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthorizationResponse = await agent.verifySiopAuthorizationRequestURI({\n  sessionId,\n  requestURI: createAuthorizationResponse,\n})\n```\n\n### Send authorization response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationResponse = await agent.sendSiopAuthorizationResponse({\n  sessionId,\n  verifiedAuthorizationRequest: verifiedAuthorizationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.8.1-unstable.240","_nodeVersion":"16.19.1","_npmVersion":"lerna/4.0.0/node@v16.19.1+x64 (linux)","dist":{"integrity":"sha512-xsLMfxNWMer4ybKtWFKUAt2ztG7EvqPYVJ9qPL9lsZdBFalCzF11gK3ybShuTY3FPSpKH8xoYctJ0brRh09Cig==","shasum":"5782f8560581b33b9fa8d79596ac63451fac789b","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.8.1-unstable.240.tgz","fileCount":34,"unpackedSize":139202,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD1axSpaSPffz0uaOtUIMukc23SwSVscFDKKDgLspzNpQIhAJin6M5mSEiJ8uopKFvJnu5GttDrHNeRfmH4DKRb3Lju"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj++zGACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr2zRAAnmccmJL2qJlYVySFwmy1z5rtO4gH0rtL7TV6UUXdvOdyozVj\r\n+g5VPcIQlsrdTyAXSOuEtkCUQgO8Q/VFX1tupJ7lz2jQNmYrPgq4LT4X7QHL\r\niSustEUB201wB/SPCdtjzi7mUfX6Cy2/zuZoofFtFhUmVPWRyCZMKL3ugoyP\r\ntzUuuyrtOZYkatRnPFg29lh+fgTENIdgKa6RkcEH+khUPUE9QwNq/3BYGfss\r\njaOVr/OKP+isPgYMhRxSW/dy4ZepeY7WrHk12OPltQ9bq5AotSFijdXj0GSJ\r\nyd9gy0Yra6JAMSobKJUx5g0p6CqkHR8n2/E+vSATtpTAVyV9Kn5yIHMufzt5\r\nxCj3nVokOKYqXAln8ytpS+m0YmmobYjGgY1806xS3LIsrJSFEI2vEgdgnwKw\r\nQWMD3kTtlBMjnhnd/CAIa8pyD/uxnEIOtzV53/N+i5qbFFzipcj4esWwiJkN\r\nNJ6jU8A49ACOCKBZ2U7h9Y3qoth3zbMww6noB2FOW1jkrUjy4oXJ0dduaHV9\r\ngh7lwtULCMLLS77q3Ag84kN4IhqqzBFh3XBHUL4R1plYgFH00QHhUB1FoNoR\r\nkHpYc/YP2APwqt1xlamd1Onnak0JTgH5eN3P8nS7qH6A5QcWk0qpDbfaKYkG\r\nKD090ywpObLuiKMlw+Y6UyjMoH1FgqVbRYs=\r\n=oBb/\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.8.1-unstable.240_1677454534264_0.8574768406896278"},"_hasShrinkwrap":false},"0.8.1-unstable.242":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.8.1-unstable.242","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"^0.3.0-unstable.23","@sphereon/pex":"2.0.0-unstable.10","@sphereon/ssi-sdk-core":"^0.8.1-unstable.242+7ed0727","@sphereon/ssi-sdk-did-utils":"^0.8.1-unstable.242+7ed0727","@sphereon/ssi-types":"^0.8.1-unstable.242+7ed0727","@veramo/core":"4.2.0","@veramo/credential-w3c":"4.2.0","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.5.1-unstable.1","@veramo/cli":"4.2.0","@veramo/did-provider-key":"4.2.0","@veramo/did-resolver":"4.2.0","@veramo/utils":"4.2.0","did-resolver":"^4.0.1","nock":"^13.2.1","typescript":"^4.6.4"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"7ed072708585d2479928bd4314ce3244761c7f4e","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authorization request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst authorizationRequest = await agent.getSiopAuthorizationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authorization request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationRequestDetailsResponse = await agent.getSiopAuthorizationRequestDetails({\n  sessionId,\n  verifiedAuthorizationRequest: createAuthorizationResponse,\n})\n```\n\n### Verify authorization request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthorizationResponse = await agent.verifySiopAuthorizationRequestURI({\n  sessionId,\n  requestURI: createAuthorizationResponse,\n})\n```\n\n### Send authorization response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationResponse = await agent.sendSiopAuthorizationResponse({\n  sessionId,\n  verifiedAuthorizationRequest: verifiedAuthorizationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.8.1-unstable.242","_nodeVersion":"16.19.1","_npmVersion":"lerna/4.0.0/node@v16.19.1+x64 (linux)","dist":{"integrity":"sha512-EIjQ7HFblVsA2ZY/1HndVJvwMbjnlZIp+CRxC6WJlSIbY8mZKwJTiK5Q4JEPqCCO+WCVlyi4hSIps89lBwPqfg==","shasum":"82b84751903c057e551449473cda2fae00ac611d","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.8.1-unstable.242.tgz","fileCount":34,"unpackedSize":139202,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDAmVAmaGBl8aCed0y5d0WYK1IvM+aKseM2wBXKDvJXugIgBAxy7ZU3cr/s5/FNrFm1WSoGdI1BJa6mPUDx5DxcxEg="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJj/A6lACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmrx5xAAnuEsYzc6q6sOMQlSa30Qg7wqFE+o5QnMpgV4rjbq2IfmfysL\r\nkC2aQ91PkpNk3V5c0dlgpgF4t9STuykYhvlSuCnBkqz/IPYwTn9GX6cHdQxB\r\n2zhG4Lc/TEV3d3vr5Q4iPqVyWpLnv3D68dXE6S7GvatFCh6FJRaVL5YppW+5\r\nM2CPEYEE0AHP158p+V8HQ6bz3z5cU65p2eSxIUdEaYQv2ZaLFSBHJ+v16Khk\r\nmqNBrerYCq7tnWyVG8RRCubbbLqBXAUOkPzQoDkMMHqXCMu5/faPkeG1TrGX\r\n+R2lJQ4x7xBKzPr8075XZcGhvhEQkRvnKA4yoTasst7njXzFhhHWTUrxtkLn\r\nGb36ubFGczi7BS72uHl3rqjXltxW8bdfNZLQeupWB6bMu/FVcIQxhIhg8Pmp\r\nfGIPh4KX0v+wSh6VNlarKX9yBhfJ2Y1ZyiKE0ORcqKsDt1RbR4d9F5CwlXrU\r\nZFM+FBY82zRE0Y7yMM+/QzscMimO+UWC651G+xYWZCVcCH36BPaTwe5p1tj0\r\nRd5HC9e/pceCzHQbBq7UBdnGjgN1exTV/nA5U/JPp05DreOyGK1KKFQwZUHE\r\nYJAkXYSLyti2QGRuM9weyWMCEvjNE/9ls+h+BNj1rinLh3kxDJis/LQO+FxY\r\n0GBGicGZyqtEJ0HdKnDvD+cV/hyK/Oox4Og=\r\n=0vRZ\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.8.1-unstable.242_1677463205323_0.8332211607640074"},"_hasShrinkwrap":false},"0.8.1-unstable.264":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.8.1-unstable.264","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"^0.3.0-unstable.23","@sphereon/pex":"2.0.0-unstable.10","@sphereon/ssi-sdk-core":"^0.8.1-unstable.264+455ebb3","@sphereon/ssi-sdk-did-utils":"^0.8.1-unstable.264+455ebb3","@sphereon/ssi-types":"^0.8.1-unstable.264+455ebb3","@sphereon/wellknown-dids-client":"^0.1.3-unstable.1","@types/uuid":"^9.0.1","@veramo/core":"4.2.0","@veramo/credential-w3c":"4.2.0","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.5.1-unstable.1","@veramo/cli":"4.2.0","@veramo/did-provider-key":"4.2.0","@veramo/did-resolver":"4.2.0","@veramo/utils":"4.2.0","did-resolver":"^4.0.1","nock":"^13.2.1","typescript":"^4.6.4"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"455ebb3f0bbb50688c9cf62e10ba084d8fe41041","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authorization request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst authorizationRequest = await agent.getSiopAuthorizationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authorization request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationRequestDetailsResponse = await agent.getSiopAuthorizationRequestDetails({\n  sessionId,\n  verifiedAuthorizationRequest: createAuthorizationResponse,\n})\n```\n\n### Verify authorization request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthorizationResponse = await agent.verifySiopAuthorizationRequestURI({\n  sessionId,\n  requestURI: createAuthorizationResponse,\n})\n```\n\n### Send authorization response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationResponse = await agent.sendSiopAuthorizationResponse({\n  sessionId,\n  verifiedAuthorizationRequest: verifiedAuthorizationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.8.1-unstable.264","_nodeVersion":"16.19.1","_npmVersion":"lerna/4.0.0/node@v16.19.1+x64 (linux)","dist":{"integrity":"sha512-Ax09c5fK08usgmmLRC6GIJ6OovVzqMvo5E5l/fKk9sLd/OqEjwqY0uv0ZOYFWw16n+7jY7ctC69+/HbJyoi2tA==","shasum":"f10ba2700f6e7c3ba2442202dab4918734f36461","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.8.1-unstable.264.tgz","fileCount":34,"unpackedSize":139291,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCqekkLhmGiuuq0IyH30CtmP5YsaOsWzil+YTiuuKnPOAIhALOFNKMqk/NjzZs9JvfgzdKvcYQ56IJK066O14zjLszw"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkAbEqACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo67RAAnfwZI+OzIAyIupbigqawkPdnnv3pznyh3Ze+9PWB4T/nLHQo\r\n7Ku+GvtA9fc9GTPPIxWckD6P5jkZr32yWv0uFHV98jq9p03RLVqIL1advYWS\r\nlVFC5caxsf+FwutYugWsLC9UBidtTxvZTJq5upIjvUuYDbY+f0T90A5Q6gPA\r\n/JJ8Wm0xcwtNOoo8owXH3PAzE4kDaDQwx1f7xZSClp8GsunE5sKOtB8vfSpv\r\nX7ekY5/05eSJMnAigFegy9XuzcfuBitn89F7R+twL/20xYxi1fhAu7c7m7iY\r\nReKBzqeUeTsapeOyvpmfMpwqrr38+neF85ay+QVhLSyVGZKfKjqS0tuuKZM8\r\nChzuQ8n41JxHgld4K4jthscV+lYDFISOPxkyyDNZ6r/ZzWG1N0LvzInzG3Jj\r\nExu9zxNpe9I3X1fhd1P/TVhIamTDwcQ9EYsOsbp9G1nKMelYKca/nQ2TVdGE\r\nLtIiMqipNqXEF7cG4KicvRYMviBnbc4SCnQxF2Bn0nUkOUP9IbIMUBdgrMSx\r\n47g0hJ+p7Ot8P0jsp5mnY84Nh2EsYGQYr3hOXtsq+VMqBTURcneU46XUW6FI\r\nn/8LXL0h69Sc2PbMz7PzpTvL5OrZJAdSc3p86UcJ6mnOjpLSr/IvV+dYVzwq\r\n3HzIv09T6CiJUEsLeNNAGXwvoZtfBWD7m74=\r\n=iB90\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.8.1-unstable.264_1677832490337_0.24167259198024604"},"_hasShrinkwrap":false},"0.8.1-unstable.263":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.8.1-unstable.263","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"^0.3.0-unstable.23","@sphereon/pex":"2.0.0-unstable.10","@sphereon/ssi-sdk-core":"^0.8.1-unstable.263+0ccab93","@sphereon/ssi-sdk-did-utils":"^0.8.1-unstable.263+0ccab93","@sphereon/ssi-types":"^0.8.1-unstable.263+0ccab93","@sphereon/wellknown-dids-client":"^0.1.3-unstable.1","@types/uuid":"^9.0.1","@veramo/core":"4.2.0","@veramo/credential-w3c":"4.2.0","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.5.1-unstable.1","@veramo/cli":"4.2.0","@veramo/did-provider-key":"4.2.0","@veramo/did-resolver":"4.2.0","@veramo/utils":"4.2.0","did-resolver":"^4.0.1","nock":"^13.2.1","typescript":"^4.6.4"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"0ccab93d1692d0e82262f7778c22aeae8e8683e8","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authorization request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst authorizationRequest = await agent.getSiopAuthorizationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authorization request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationRequestDetailsResponse = await agent.getSiopAuthorizationRequestDetails({\n  sessionId,\n  verifiedAuthorizationRequest: createAuthorizationResponse,\n})\n```\n\n### Verify authorization request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthorizationResponse = await agent.verifySiopAuthorizationRequestURI({\n  sessionId,\n  requestURI: createAuthorizationResponse,\n})\n```\n\n### Send authorization response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationResponse = await agent.sendSiopAuthorizationResponse({\n  sessionId,\n  verifiedAuthorizationRequest: verifiedAuthorizationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.8.1-unstable.263","_nodeVersion":"16.19.1","_npmVersion":"lerna/4.0.0/node@v16.19.1+x64 (linux)","dist":{"integrity":"sha512-cTYD3Da7e3ddAz9VbW/v4ZkL2Hk+FZgbz/c242R/ThrywXybpLI7mUmYisS9p4Z/RZTVKwFQf0bhZZeAIHyRog==","shasum":"0688030027d4c8314f36c41f416c5043038429c9","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.8.1-unstable.263.tgz","fileCount":34,"unpackedSize":139291,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDUMlSZUHX35Z1nG4y/29D4TzMD9xw9ygNb743rY5mgHQIhALgySvHDxit2/2OEM6BrDNvMz6grzQ3Y3QMSyrqAKq96"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkAh2JACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo7QQ/9H25tDwb9neXWLe3y8cUdoJNqkzcCKlMKAFFzDue57fG2WGfs\r\n/QPDRQCojZZ5WfCObkVFH9084JPVhjKmx44a6PetaZtNP5OoZGCC75jbBdtz\r\nVwjHjKLzL5/5tkjg3eHmIO7Gg7cT1U5iE6SxrvMVkkQrfQ56fPSCZNg3pRbI\r\n2bjv3nVv/muU1Q0PEdDtri9SGr2xjPgvHqUg3MoZItoa53ZStT5Ak1Tvhh6o\r\n/LqsvHYavRJj9nIVlz/RLSi0aJUvHlME9kSuLOrXsRYiMuXcd+bKxwG90UD3\r\nPCi9szzKOKntLxpXvKnj4FcuizkXEpa1KfRfhhmc9iuSrJKEl0Lie210DAXN\r\nMKG76yHx1RqeDd5qObZ0yWD7jGjJR1nP/FBxzfauMCylsLYKoWHDRqIiE4D8\r\nTTOm/DiyaEPd9gjn+9/CccLVCDPs0fjY0yDh30yCSQ7X5YXVzqrnGsSlkNAz\r\nJajjpPihdHmVHKaQh0YnTXbjyjsmGKzbRYWOBkXAQkdbQA63YewiwsKVkdKV\r\nxlUKI6QNNSQW8WbJ8H0BuEsI35N5K3SnFlvoslp6jQE3/2m8VZ0cyF3RpC6v\r\n54eHpzTuE2nTw0UcK83WAha36TXGu0esBOLaBRnSzEKOT0Bnndp0s5GrLaft\r\nS4KfgzW69+V/rDvTo4x9/jvbi3VlUDkbqCk=\r\n=C6C4\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.8.1-unstable.263_1677860233070_0.6584946897416541"},"_hasShrinkwrap":false},"0.8.1-unstable.271":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.8.1-unstable.271","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build --clean && tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"^0.3.0-unstable.23","@sphereon/pex":"2.0.0-unstable.10","@sphereon/ssi-sdk-core":"^0.8.1-unstable.271+9a734b5","@sphereon/ssi-sdk-did-utils":"^0.8.1-unstable.271+9a734b5","@sphereon/ssi-types":"^0.8.1-unstable.271+9a734b5","@sphereon/wellknown-dids-client":"^0.1.3-unstable.1","@types/uuid":"^9.0.1","@veramo/core":"4.2.0","@veramo/credential-w3c":"4.2.0","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.5.1-unstable.1","@veramo/cli":"4.2.0","@veramo/did-provider-key":"4.2.0","@veramo/did-resolver":"4.2.0","@veramo/utils":"4.2.0","did-resolver":"^4.0.1","nock":"^13.2.1","typescript":"^4.6.4"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"9a734b5892bde59c0a57812d2f77c8168744c63a","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authorization request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst authorizationRequest = await agent.getSiopAuthorizationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authorization request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationRequestDetailsResponse = await agent.getSiopAuthorizationRequestDetails({\n  sessionId,\n  verifiedAuthorizationRequest: createAuthorizationResponse,\n})\n```\n\n### Verify authorization request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthorizationResponse = await agent.verifySiopAuthorizationRequestURI({\n  sessionId,\n  requestURI: createAuthorizationResponse,\n})\n```\n\n### Send authorization response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationResponse = await agent.sendSiopAuthorizationResponse({\n  sessionId,\n  verifiedAuthorizationRequest: verifiedAuthorizationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.8.1-unstable.271","_nodeVersion":"16.19.1","_npmVersion":"lerna/4.0.0/node@v16.19.1+x64 (linux)","dist":{"integrity":"sha512-S2vCSzHlcg/fPtwG30szqb9IykKdWdxxdPG5B3m8mg+Bo6MZ0SQrWPsTQrODFCxfZyMq2GdQZ/G7z4YXjuhM+A==","shasum":"f1a5c823207b195331ad83e2e6035d8be463ca7e","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.8.1-unstable.271.tgz","fileCount":34,"unpackedSize":139314,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCID6cwdsJ9FnRWTr2Fnwprr5FnBjMYsz7iVQcqAZ5gUp/AiALDHyFDugjD07N4XRVdqd5+JSNiCuHY5c/FD5Ibz5SwA=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkBfo9ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmptPBAAg4vcgxXuuE/11sqykpVZibFLqnnYEpLhB2VIlVguMH/Jl+N8\r\nB+zMj64nprAjKbVWCEQLdA8coylmY8L4+Ri0tNXfwckMB/M3Dg8neYSynDWU\r\n3QP6Pu4UuDhV8AbYGPDINjOrRyXfSgKAhZeeE8KsGX8vdn50buGtSKDQlz/q\r\nH88OhD7Ecvea1/EA6JtH6wc4N/v27MQQ1yCSi0AeS5E8tTlewfgyHCbOJ5nV\r\noSTxd16Ji9JhVS3VXMNaUGA4DuBtAZyq3uD0AtZaO6x7GoGN9iuUQRnI5gTT\r\nQ/zp1Ml+GxC84xLPYi0XaQrui8v+fgqRY9/TLwL3Kf7cjLIvQX5TNLYY5sv7\r\n6PasLYIdTPJuXgTopAqJ7Wk5dRc9WdeEGtH0K4QSF0sDX4dbj9E47sKerxHY\r\nksno3pNqNdosvxPd8vnH7qpp/kbl/GgBjKQ/FRCCIN1bay1xnOCTO3dsDnp7\r\nmJcrXKc/nPSK1xNDn+/fNvvo4doyNh3UhESZIu38WA5cqSk/hwOifz/oHRH9\r\nxGLh0Hm9BvD/TwhFl2eQX6+qmTRUZOyxlMqrPmSKc3fwqByLTuAtxKEAndZg\r\nKVpv7ko0lS/tyiNj90ptHGaaauLDGEPH1rJ5UUXOpGCxENZQSKQ6gM46Vn1o\r\nAY6D7X6oKXDPMecrIEhXUnWyNxK5cquRwY8=\r\n=EecY\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.8.1-unstable.271_1678113340849_0.6973938596029208"},"_hasShrinkwrap":false},"0.8.1-unstable.272":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.8.1-unstable.272","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build --clean && tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"^0.3.0-unstable.23","@sphereon/pex":"2.0.0-unstable.10","@sphereon/ssi-sdk-core":"^0.8.1-unstable.272+af4fcbf","@sphereon/ssi-sdk-did-utils":"^0.8.1-unstable.272+af4fcbf","@sphereon/ssi-types":"^0.8.1-unstable.272+af4fcbf","@sphereon/wellknown-dids-client":"^0.1.3-unstable.1","@types/uuid":"^9.0.1","@veramo/core":"4.2.0","@veramo/credential-w3c":"4.2.0","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.5.1-unstable.1","@veramo/cli":"4.2.0","@veramo/did-provider-key":"4.2.0","@veramo/did-resolver":"4.2.0","@veramo/utils":"4.2.0","did-resolver":"^4.0.1","nock":"^13.2.1","typescript":"^4.6.4"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"af4fcbf2de49be3defba0dd4985102f452bb7fa6","readme":"<!--suppress HtmlDeprecatedAttribute -->\r\n<h1 align=\"center\">\r\n  <br>\r\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\r\n  <br>DID Auth SIOP OP Authenticator (Typescript) \r\n  <br>\r\n</h1>\r\n\r\n---\r\n\r\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\r\n\r\n---\r\n\r\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\r\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\r\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\r\nas specified in the OpenID Connect working group.\r\n\r\n## Self Issued OpenID Provider v2 (SIOP)\r\n\r\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\r\n\r\n## Requirements\r\n\r\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\r\n\r\n## Available functions\r\n\r\n- getSessionForSiop\r\n- registerSessionForSiop\r\n- removeSessionForSiop\r\n- registerCustomApprovalForSiop\r\n- removeCustomApprovalForSiop\r\n- authenticateWithSiop\r\n- getSiopAuthorizationRequestFromRP\r\n- getSiopAuthorizationRequestDetails\r\n- verifySiopAuthorizationRequestURI\r\n- sendSiopAuthorizationResponse\r\n\r\nThe following functions can also be used on the session object without the need of a session id first.\r\n\r\n- authenticateWithSiop\r\n- getSiopAuthorizationRequestFromRP\r\n- getSiopAuthorizationRequestDetails\r\n- verifySiopAuthorizationRequestURI\r\n- sendSiopAuthorizationResponse\r\n\r\n## Usage\r\n\r\n### Adding the plugin to an agent:\r\n\r\n```typescript\r\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\r\nimport { Resolver } from 'did-resolver'\r\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\r\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\r\nimport { getUniResolver } from '@sphereon/did-uni-client'\r\n\r\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\r\n  plugins: [\r\n    new DidAuthSiopOpAuthenticator(),\r\n    new DIDResolverPlugin({\r\n      resolver: new Resolver({\r\n        ...getDidKeyResolver(),\r\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\r\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\r\n      }),\r\n    }),\r\n  ],\r\n})\r\n```\r\n\r\n### Get an OP session:\r\n\r\n```typescript\r\nconst sessionId = 'example_session_id'\r\nconst opSession = await agent.getSessionForSiop({\r\n  sessionId,\r\n})\r\n```\r\n\r\n### Register an OP session:\r\n\r\n```typescript\r\nconst sessionId = 'example_session_id'\r\nconst identifier = {\r\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\r\n  provider: 'example_provider',\r\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\r\n  keys: [\r\n    {\r\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\r\n      kms: 'example_kms',\r\n      type: 'Ed25519' as const,\r\n      publicKeyHex: '1e21e21e...',\r\n      privateKeyHex: 'elfcvtswdbn...',\r\n    },\r\n  ],\r\n  services: [],\r\n}\r\n\r\nconst opSession = await agent.registerSessionForSiop({\r\n  sessionId,\r\n  identifier,\r\n})\r\n```\r\n\r\n### Remove an OP session:\r\n\r\n```typescript\r\nconst sessionId = 'example_session_id'\r\nconst opSession = await agent.removeSessionForSiop({\r\n  sessionId,\r\n})\r\n```\r\n\r\n### Authenticate with DID auth SIOP:\r\n\r\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\r\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\r\n\r\nThese custom approval functions can also be provided at agent creation.\r\n\r\n```typescript\r\nawait agent.registerCustomApprovalForSiop({\r\n  key: 'example_key',\r\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => Promise.resolve(),\r\n})\r\n```\r\n\r\n```typescript\r\nconst sessionId = 'example_session_id'\r\nconst stateId = 'example_state_id'\r\nconst redirectUrl = 'https://example.com'\r\nconst customApprovalKey = 'example_key'\r\nconst authenticationResponse = await agent.authenticateWithSiop({\r\n  sessionId,\r\n  stateId,\r\n  redirectUrl,\r\n  customApproval: customApprovalKey,\r\n})\r\n```\r\n\r\n```typescript\r\nconst authenticationResponse = await agent.authenticateWithSiop({\r\n  sessionId,\r\n  stateId,\r\n  redirectUrl,\r\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => {\r\n    return Promise.resolve()\r\n  },\r\n})\r\n```\r\n\r\n### Get authorization request from the relying party:\r\n\r\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\r\n\r\n```typescript\r\nconst sessionId = 'example_session_id'\r\nconst stateId = 'example_state_id'\r\nconst redirectUrl = 'https://example.com'\r\nconst authorizationRequest = await agent.getSiopAuthorizationRequestFromRP({\r\n  sessionId,\r\n  stateId,\r\n  redirectUrl,\r\n})\r\n```\r\n\r\n### Get authorization request details:\r\n\r\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\r\n\r\n```typescript\r\nconst sessionId = 'example_session_id'\r\nconst authorizationRequestDetailsResponse = await agent.getSiopAuthorizationRequestDetails({\r\n  sessionId,\r\n  verifiedAuthorizationRequest: createAuthorizationResponse,\r\n})\r\n```\r\n\r\n### Verify authorization request URI:\r\n\r\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\r\n\r\n```typescript\r\nconst sessionId = 'example_session_id'\r\nconst verifiedAuthorizationResponse = await agent.verifySiopAuthorizationRequestURI({\r\n  sessionId,\r\n  requestURI: createAuthorizationResponse,\r\n})\r\n```\r\n\r\n### Send authorization response:\r\n\r\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\r\n\r\n```typescript\r\nconst sessionId = 'example_session_id'\r\nconst authorizationResponse = await agent.sendSiopAuthorizationResponse({\r\n  sessionId,\r\n  verifiedAuthorizationRequest: verifiedAuthorizationResponse,\r\n})\r\n```\r\n\r\n## Installation\r\n\r\n```shell\r\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\r\n```\r\n\r\n## Build\r\n\r\n```shell\r\nyarn build\r\n```\r\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute -->\r <h1 align=\"center\">\r   <br>\r   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\r   <br>DID Auth SIOP OP Authenticator (","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.8.1-unstable.272","_nodeVersion":"16.19.1","_npmVersion":"lerna/4.0.0/node@v16.19.1+x64 (linux)","dist":{"integrity":"sha512-1bzTaYamyirmsxofz13tKwlvlGJJ3BxkrM+2TW5Hi8xPYw9gTQ5RAa+146ICWr9v54wZREl0q66QZ04RcLEZMQ==","shasum":"daa9a7327a7ab4b30b012489e4b6a46b310f4515","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.8.1-unstable.272.tgz","fileCount":34,"unpackedSize":139732,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFG6Q/Jz6CHKxgvCZbSCDRQ8LLRL/FUvrRufYhjqX9eLAiEAx/hD8tYLkhLCmctkK7a8K21dpGMwJE1+pn0WnvyojLs="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkBgJYACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoPwQ/9GWkiZvDCW50RdyJtqUsRaHpsJzwwXUgUdHu4u3Ve786TcfYc\r\nQnWPBEvwycD+4gHhxJuchXEY+io4JglOfldkzK5J/VgtYvulyoYgurSzQqP8\r\nLuS0AU1lSDvB/NDFyCzo4IMfFLiESUQfD0E73RhP5wgKyHeLEYVah7lqghq7\r\nf1IU+64E+6ogVzL5Mu5uKcGmpj7Svk1JxGJUAfzBZC/6PCE/2aHeTDDHJyYN\r\ndjjs5pSoScwOCkol84BSu5FLQD1nc1/hnAlKRjQ4GOxUogfwwXhP2AalZ/dW\r\nKspwb8rM64UAWFJmdG0kjRzHW8F2XgbLRKhxb31OQwPskinwiLiBY2UprRBa\r\n+93IZ6ZNsEQeuXNQjSBqjKkMBYAAUilopeIUBoAH+pq6w3pwXg6dePGq2Bwh\r\nGKlsn9KSdFkSrm9+ONZV3gNE9KSNf/bz6EwTag2uQDtFODEETBwvhcHW5drx\r\n6oPw3mSqB0MmAwbdmy6A6FUzXpLdokWT6E6YVbMGYNe5sTNOYS3Nrnzqnqdw\r\nK6H4MWHnWVtL2FE+HLeB68Byj3CHI7UqbWVhq1IYo5GYmOFTSkNldkV5fwzF\r\nkT1ReMTTvP11Z1/CF7AjNyiDUh2nnJkmBEydB00dyW7AO5r2fFSx9TBJi5xO\r\nJMvUsulv6xgcmUqZyGHvZUZzg64545mJybI=\r\n=kbQ3\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.8.1-unstable.272_1678115416502_0.6088196821591554"},"_hasShrinkwrap":false},"0.8.1-unstable.277":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.8.1-unstable.277","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build --clean && tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"^0.3.0-unstable.23","@sphereon/pex":"2.0.0-unstable.10","@sphereon/ssi-sdk-core":"^0.8.1-unstable.277+9f18a4d","@sphereon/ssi-sdk-did-utils":"^0.8.1-unstable.277+9f18a4d","@sphereon/ssi-types":"^0.8.1-unstable.277+9f18a4d","@sphereon/wellknown-dids-client":"^0.1.3-unstable.1","@types/uuid":"^9.0.1","@veramo/core":"4.2.0","@veramo/credential-w3c":"4.2.0","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.5.1-unstable.1","@veramo/cli":"4.2.0","@veramo/did-provider-key":"4.2.0","@veramo/did-resolver":"4.2.0","@veramo/utils":"4.2.0","did-resolver":"^4.0.1","nock":"^13.2.1","typescript":"^4.6.4"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"9f18a4df8f65c5fc9fb23591404af2ab19b90a76","readme":"<!--suppress HtmlDeprecatedAttribute -->\r\n<h1 align=\"center\">\r\n  <br>\r\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\r\n  <br>DID Auth SIOP OP Authenticator (Typescript) \r\n  <br>\r\n</h1>\r\n\r\n---\r\n\r\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\r\n\r\n---\r\n\r\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\r\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\r\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\r\nas specified in the OpenID Connect working group.\r\n\r\n## Self Issued OpenID Provider v2 (SIOP)\r\n\r\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\r\n\r\n## Requirements\r\n\r\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\r\n\r\n## Available functions\r\n\r\n- getSessionForSiop\r\n- registerSessionForSiop\r\n- removeSessionForSiop\r\n- registerCustomApprovalForSiop\r\n- removeCustomApprovalForSiop\r\n- authenticateWithSiop\r\n- getSiopAuthorizationRequestFromRP\r\n- getSiopAuthorizationRequestDetails\r\n- verifySiopAuthorizationRequestURI\r\n- sendSiopAuthorizationResponse\r\n\r\nThe following functions can also be used on the session object without the need of a session id first.\r\n\r\n- authenticateWithSiop\r\n- getSiopAuthorizationRequestFromRP\r\n- getSiopAuthorizationRequestDetails\r\n- verifySiopAuthorizationRequestURI\r\n- sendSiopAuthorizationResponse\r\n\r\n## Usage\r\n\r\n### Adding the plugin to an agent:\r\n\r\n```typescript\r\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\r\nimport { Resolver } from 'did-resolver'\r\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\r\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\r\nimport { getUniResolver } from '@sphereon/did-uni-client'\r\n\r\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\r\n  plugins: [\r\n    new DidAuthSiopOpAuthenticator(),\r\n    new DIDResolverPlugin({\r\n      resolver: new Resolver({\r\n        ...getDidKeyResolver(),\r\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\r\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\r\n      }),\r\n    }),\r\n  ],\r\n})\r\n```\r\n\r\n### Get an OP session:\r\n\r\n```typescript\r\nconst sessionId = 'example_session_id'\r\nconst opSession = await agent.getSessionForSiop({\r\n  sessionId,\r\n})\r\n```\r\n\r\n### Register an OP session:\r\n\r\n```typescript\r\nconst sessionId = 'example_session_id'\r\nconst identifier = {\r\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\r\n  provider: 'example_provider',\r\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\r\n  keys: [\r\n    {\r\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\r\n      kms: 'example_kms',\r\n      type: 'Ed25519' as const,\r\n      publicKeyHex: '1e21e21e...',\r\n      privateKeyHex: 'elfcvtswdbn...',\r\n    },\r\n  ],\r\n  services: [],\r\n}\r\n\r\nconst opSession = await agent.registerSessionForSiop({\r\n  sessionId,\r\n  identifier,\r\n})\r\n```\r\n\r\n### Remove an OP session:\r\n\r\n```typescript\r\nconst sessionId = 'example_session_id'\r\nconst opSession = await agent.removeSessionForSiop({\r\n  sessionId,\r\n})\r\n```\r\n\r\n### Authenticate with DID auth SIOP:\r\n\r\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\r\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\r\n\r\nThese custom approval functions can also be provided at agent creation.\r\n\r\n```typescript\r\nawait agent.registerCustomApprovalForSiop({\r\n  key: 'example_key',\r\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => Promise.resolve(),\r\n})\r\n```\r\n\r\n```typescript\r\nconst sessionId = 'example_session_id'\r\nconst stateId = 'example_state_id'\r\nconst redirectUrl = 'https://example.com'\r\nconst customApprovalKey = 'example_key'\r\nconst authenticationResponse = await agent.authenticateWithSiop({\r\n  sessionId,\r\n  stateId,\r\n  redirectUrl,\r\n  customApproval: customApprovalKey,\r\n})\r\n```\r\n\r\n```typescript\r\nconst authenticationResponse = await agent.authenticateWithSiop({\r\n  sessionId,\r\n  stateId,\r\n  redirectUrl,\r\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => {\r\n    return Promise.resolve()\r\n  },\r\n})\r\n```\r\n\r\n### Get authorization request from the relying party:\r\n\r\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\r\n\r\n```typescript\r\nconst sessionId = 'example_session_id'\r\nconst stateId = 'example_state_id'\r\nconst redirectUrl = 'https://example.com'\r\nconst authorizationRequest = await agent.getSiopAuthorizationRequestFromRP({\r\n  sessionId,\r\n  stateId,\r\n  redirectUrl,\r\n})\r\n```\r\n\r\n### Get authorization request details:\r\n\r\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\r\n\r\n```typescript\r\nconst sessionId = 'example_session_id'\r\nconst authorizationRequestDetailsResponse = await agent.getSiopAuthorizationRequestDetails({\r\n  sessionId,\r\n  verifiedAuthorizationRequest: createAuthorizationResponse,\r\n})\r\n```\r\n\r\n### Verify authorization request URI:\r\n\r\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\r\n\r\n```typescript\r\nconst sessionId = 'example_session_id'\r\nconst verifiedAuthorizationResponse = await agent.verifySiopAuthorizationRequestURI({\r\n  sessionId,\r\n  requestURI: createAuthorizationResponse,\r\n})\r\n```\r\n\r\n### Send authorization response:\r\n\r\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\r\n\r\n```typescript\r\nconst sessionId = 'example_session_id'\r\nconst authorizationResponse = await agent.sendSiopAuthorizationResponse({\r\n  sessionId,\r\n  verifiedAuthorizationRequest: verifiedAuthorizationResponse,\r\n})\r\n```\r\n\r\n## Installation\r\n\r\n```shell\r\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\r\n```\r\n\r\n## Build\r\n\r\n```shell\r\nyarn build\r\n```\r\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute -->\r <h1 align=\"center\">\r   <br>\r   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\r   <br>DID Auth SIOP OP Authenticator (","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.8.1-unstable.277","_nodeVersion":"18.14.2","_npmVersion":"lerna/4.0.0/node@v18.14.2+x64 (linux)","dist":{"integrity":"sha512-7v0Qg3viarSo6haKAs1fYfbIQRFBCxNg6MrOw9SyLwwiZHGRb3CCwkEgdsln1lmj1pfsaqBbhiWT34EJe7wPVA==","shasum":"c47a380778ba033fd881bf02dfa5eaba9cd642ee","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.8.1-unstable.277.tgz","fileCount":34,"unpackedSize":139732,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCYzWVtBHg4ozCSaev5/rl2sQsj9UhmqaY3rmvZ28awbAIhAPOyz65tiKOvYovP757sCVuFDChVqijtCQHxkq4eFgD4"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkByeCACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpBCQ/+OuGKfT9wHPrMXXNuduP92j1u//7P55Lks7RxcUyPk/Dr32J5\r\n1IShCMAv1S47/MY8HUSA+P9uhE4IaCWyPO/ERmPnHVdvWFGR0UXabWy6wj/k\r\nbWMjlvDsfU3vDPwF4vr9jhlv+rUJaPUiVe2/KDvG4LT/+bBWf3seJwzmRwus\r\naHt0x7ScNQKLDzlLdxd0quJasC5/I42n001eRRkMYLMTEymXoAwIcY1/fLDY\r\n/UteJQBwiULc2/dnwAwNRbi+WzHfRE50oxpJy2paKipYnpopRMwjY5oHOJhd\r\nX2YpXp6DskgvRNO3qQMFhTGlovdPk8ksgeQKECmmkmzSvQ1dOrlyGekPFtTa\r\nYmLc2v5yAAk8GicJiyb5LdeWb1wBrlvXIcg6WK5E++oDhDQ7mdtEsLKqCK9w\r\nIfP4G/pcu7a1Q3tJinVGycJ0s2H3ZSHnO8XD8OWHyMqbATs+fk0ZEuj4Ra1u\r\njZDoY4zcFQmznze99CuoMsDG9Q1+8eE9uWRmqAM6ubVy09vCOi+a/fELzxOH\r\nORMdQN61as1hDfm5FhYLXW/pKWmcgfOJea4Ng7CixEUMmQj2QX8Y7uDrWA2T\r\nSDoliRub6C24bQKdOk0FlxZX6NZRYKsPYxqfFvAxqC/JnAm8d7YILY1J6DSj\r\nWtTITpCqdsZ2RpL8JiMQsg2h5yNbdq2DCXs=\r\n=/Qre\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.8.1-unstable.277_1678190465909_0.838455001699244"},"_hasShrinkwrap":false},"0.8.1-unstable.266":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.8.1-unstable.266","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"^0.3.0-unstable.23","@sphereon/pex":"2.0.0-unstable.10","@sphereon/ssi-sdk-core":"^0.8.1-unstable.266+f089ac1","@sphereon/ssi-sdk-did-utils":"^0.8.1-unstable.266+f089ac1","@sphereon/ssi-types":"^0.8.1-unstable.266+f089ac1","@sphereon/wellknown-dids-client":"^0.1.3-unstable.1","@types/uuid":"^9.0.1","@veramo/core":"4.2.0","@veramo/credential-w3c":"4.2.0","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.5.1-unstable.1","@veramo/cli":"4.2.0","@veramo/did-provider-key":"4.2.0","@veramo/did-resolver":"4.2.0","@veramo/utils":"4.2.0","did-resolver":"^4.0.1","nock":"^13.2.1","typescript":"^4.6.4"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"f089ac18dc470f0b8c581b49e70e7eba64d72bc3","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authorization request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst authorizationRequest = await agent.getSiopAuthorizationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authorization request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationRequestDetailsResponse = await agent.getSiopAuthorizationRequestDetails({\n  sessionId,\n  verifiedAuthorizationRequest: createAuthorizationResponse,\n})\n```\n\n### Verify authorization request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthorizationResponse = await agent.verifySiopAuthorizationRequestURI({\n  sessionId,\n  requestURI: createAuthorizationResponse,\n})\n```\n\n### Send authorization response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationResponse = await agent.sendSiopAuthorizationResponse({\n  sessionId,\n  verifiedAuthorizationRequest: verifiedAuthorizationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.8.1-unstable.266","_nodeVersion":"16.19.1","_npmVersion":"lerna/4.0.0/node@v16.19.1+x64 (linux)","dist":{"integrity":"sha512-vx6nDdIEw95s6XF1LE0VBSadKLp0/0WtIi4Gr2LeIqLDkf+QogujtP/QqZia11iHv/WvT6h049vF1bFEKC3BQA==","shasum":"9a36987ddbb8b9e2cb6332f8b8b6dadf2a5d9993","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.8.1-unstable.266.tgz","fileCount":34,"unpackedSize":140137,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEh4M554OZKctxrxCRH2JZQq4z81gXDrAcExqcqyT2VAAiBzAYjYG2pmtPUN7uXsYSL8VGNvemNQYFiEvnKYbJrt7Q=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkB7jYACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqxnA//QhptX6+uDQvVDqTcTt2YotbVpqrBTSG1FtfkaNNKq2PIDaqE\r\nwU0UcdRB1zQ+zihRmyMt4GR3WifI1dvm57mZEuYYAE4B+h22G+UjmDEVHh8w\r\nRLFsEHsiCzrtpIwyrTQEumEdi8oh1hH7gyhlyOXATRMapxyz69G+IzdZROwP\r\nleSO1/7xcPHDMD8LSl1pR+J2LRmybae7gR/YXjOTKmbpPuxyGE+qdwm/B76w\r\ntrs261CTy/QFj0KC8tPIlEjoYHGcCNOna4B463w/+wAgrP50ixpOlNOVKQ9S\r\nebkDJzixjeyC8VOE1qR5FZDBCqpakR2VJrytF7cAarOIfal5gt2M82V0vUk/\r\na8Hj28TqkkM9kYT/QDaT5osLFMe8fhrKikbFBmIZja2tReSINnoiQQqISwmr\r\nmkucb0RaKCerrcA8MAgBh9llK/2QZ11gwJqfzXOR8d5bxXWen+uZMgMEd49q\r\nxZ8sVz8lUC8RF6riqBJ6qVbf0qPcSWsTxzGvL3kCGu/jgghApnNXuPjYy79h\r\n6NV2OfNApN0mKt7LFJ0SWCCWcInzy3VSEE8CGLjW53M1Nx3biycF3e5EBbc/\r\nsblk4hQvzFU1Z+nBOj2sE2zukLAfBZg08vMibC2iPrY+DwFVQJ4hp0FUOGor\r\nhFnT972w6z2xk4qJQ5jrrJwxcpoWFCaOSZk=\r\n=B0Cj\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.8.1-unstable.266_1678227672605_0.6453714820147047"},"_hasShrinkwrap":false},"0.8.1-unstable.267":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.8.1-unstable.267","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"^0.3.0-unstable.23","@sphereon/pex":"2.0.0-unstable.10","@sphereon/ssi-sdk-core":"^0.8.1-unstable.267+3c2b8ed","@sphereon/ssi-sdk-did-utils":"^0.8.1-unstable.267+3c2b8ed","@sphereon/ssi-types":"^0.8.1-unstable.267+3c2b8ed","@sphereon/wellknown-dids-client":"^0.1.3-unstable.1","@types/uuid":"^9.0.1","@veramo/core":"4.2.0","@veramo/credential-w3c":"4.2.0","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.5.1-unstable.1","@veramo/cli":"4.2.0","@veramo/did-provider-key":"4.2.0","@veramo/did-resolver":"4.2.0","@veramo/utils":"4.2.0","did-resolver":"^4.0.1","nock":"^13.2.1","typescript":"^4.6.4"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"3c2b8ed171aa196473afedb007ba27e4c1c3e71f","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authorization request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst authorizationRequest = await agent.getSiopAuthorizationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authorization request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationRequestDetailsResponse = await agent.getSiopAuthorizationRequestDetails({\n  sessionId,\n  verifiedAuthorizationRequest: createAuthorizationResponse,\n})\n```\n\n### Verify authorization request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthorizationResponse = await agent.verifySiopAuthorizationRequestURI({\n  sessionId,\n  requestURI: createAuthorizationResponse,\n})\n```\n\n### Send authorization response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationResponse = await agent.sendSiopAuthorizationResponse({\n  sessionId,\n  verifiedAuthorizationRequest: verifiedAuthorizationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.8.1-unstable.267","_nodeVersion":"16.19.1","_npmVersion":"lerna/4.0.0/node@v16.19.1+x64 (linux)","dist":{"integrity":"sha512-Z8YPW2kVUgzi5TWFRF5lLkA67A4qx77HEEFz4KK2sBY7QpaJvzpVcewyQgHWQIbKHLi5c2lvRauBJMEVIoDeBA==","shasum":"96e04151f1a1be12e52d949b0d99eed0a1af3b66","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.8.1-unstable.267.tgz","fileCount":34,"unpackedSize":140137,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHIKmSb1l6+XidkLf/8l06i/22Bp3SuNuK/3XBp9o7k4AiEA6lcMqjMvrjsOsdNpxmQ2bfg293dphXOysngQvzIOBBk="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkB8krACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrT5A/9EoOuLPdWP6VRbPtUqfbnYL+oI8BrePU4Yw9orqZpOMRsP3km\r\ni3LpjJVba1kuh2YdRwTJ3m1+DozRvYeAVM/hyOY+IN8EIcW4mFtS5bF6BEHV\r\nBDCLafgSgMwVlyY10Hf/QypWx3BPv8n59rgnBwkCn2u6lu6NaYtb40wuobbI\r\n21MiFhXfVsYW4asQVoHVAAKTRd8Mwf1XUREShpxo3qck9QWvvQC4/8lOqYuY\r\nEsnGVe/i15ugKljOoQYkq2Y7E8N/pAxotU8aJC30ZAijULiDh+b0ujKmvedj\r\n5+/EonKgxf9bUIpX/XEHV5lvivlqduOXay1N5ykGzvfo47pJlMTi/p1l6ENu\r\nJZxX59Vvi70C1Az58JL/dRWOFtn7SEsvX8nEc6B8PSTxW293iEFw2XWgiNJp\r\nvfFwySh0ZZn2YxkVJQr9aLvpbW3Bx7DFDEloucL+pQZyzdbReLKyV9StsI/o\r\nwOcfztULL849+qcOSC07Hfsr5KWGxKAozf6+8iPiIPmWpitYAdGcW0sYD/DM\r\nGxbuxOWn7RDLdH53zcAx+FRCcADi5gDRd7vPjPFhDlFgPmeCD1fAHPFtgV+j\r\n9WHbtZwoLcvGfsBMzl1M/G4bRrOlM6jkDo/UbFgTgrIUlyIsEReVULcBnFRX\r\nCTKipyga0SJaqIP5jmsCeICSRE0x1kDChgI=\r\n=UUGe\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.8.1-unstable.267_1678231851636_0.3044142852413072"},"_hasShrinkwrap":false},"0.8.1-unstable.268":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.8.1-unstable.268","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"^0.3.0-unstable.23","@sphereon/pex":"2.0.0-unstable.10","@sphereon/ssi-sdk-core":"^0.8.1-unstable.268+50a264a","@sphereon/ssi-sdk-did-utils":"^0.8.1-unstable.268+50a264a","@sphereon/ssi-types":"^0.8.1-unstable.268+50a264a","@sphereon/wellknown-dids-client":"^0.1.3-unstable.1","@types/uuid":"^9.0.1","@veramo/core":"4.2.0","@veramo/credential-w3c":"4.2.0","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.5.1-unstable.1","@veramo/cli":"4.2.0","@veramo/did-provider-key":"4.2.0","@veramo/did-resolver":"4.2.0","@veramo/utils":"4.2.0","did-resolver":"^4.0.1","nock":"^13.2.1","typescript":"^4.6.4"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"50a264a366a293a9d9cec9c81aad640ba3391bb1","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authorization request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst authorizationRequest = await agent.getSiopAuthorizationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authorization request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationRequestDetailsResponse = await agent.getSiopAuthorizationRequestDetails({\n  sessionId,\n  verifiedAuthorizationRequest: createAuthorizationResponse,\n})\n```\n\n### Verify authorization request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthorizationResponse = await agent.verifySiopAuthorizationRequestURI({\n  sessionId,\n  requestURI: createAuthorizationResponse,\n})\n```\n\n### Send authorization response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationResponse = await agent.sendSiopAuthorizationResponse({\n  sessionId,\n  verifiedAuthorizationRequest: verifiedAuthorizationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.8.1-unstable.268","_nodeVersion":"16.19.1","_npmVersion":"lerna/4.0.0/node@v16.19.1+x64 (linux)","dist":{"integrity":"sha512-R+bdUvfJURkDu6jQHG5GMFBY9NMIx3EoKchUQZIpuq5mxvDsUDZKDrLVJBHDQucqPTpE3Ze5oEUlzPa2wrkCag==","shasum":"6a3eb364f94be8c236eab28a00dc9d9c50a30bf3","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.8.1-unstable.268.tgz","fileCount":34,"unpackedSize":140137,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDBYKsaXG6kI9vXnCRRwPp+6Y+gwMfKQcs6fQzO68xwjwIgBEA1b1mxmVB0YgxgdCA1n65NdttSOLqFE9+UsLgvyFE="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkB8uxACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp7Kw//cJnyy1B4CZF7hzyK4PS1zBG5V64Bn6JF6FzuWr9THXhuRKcC\r\nhRlZ0VSRP90VXHQiXIalfKc6KCfRhrvaUJZUrdij5oMWgNKqMD0MZcbrWk9t\r\nbNcaqn9UAIOO5aWqUwojpX5BKBqHK8cVYGqt/6C6r9eLyDMvbDCDjGXW4foY\r\nAMIt4qnxOBvONuwGYU6oHx8tlFLYmtkMAXs/IFgpZGgTupYOICU9ipuxJ4/0\r\nQCxxe0feJp4CIDcpfWjoRtfYYtDxw0hN4I38zeNrdrM8BuQDKSX3RE7/6JdO\r\nRk9zgCYzy3i7YwTjyO5XDJaoGAWDwN/XbOKbjCRvzfHADaywdr/jt2M93TIL\r\n/xr9ElRgn83lG4+LootJdUXYvufZS2TEKw7BDnKejw6YOqnZBd2U3Tilt7NU\r\nI7v1ngpWcrbSnflRTwLB288Jr5B6I990QSXgooeVyjChFhVyfJZlPM1eAt5G\r\n89WupCAy3U0ypQM4LMuDzAhyIdz1eN6bkhN3TH656Ri0Ex8NbGNOvfmpMS4n\r\n9YYYCILPJk3+ksrrO8wkFbXlKYPWBPupymm/VSuslN73VZheZhKOI3gIQGAv\r\n2AdfUaSMUR9AybL0Q9TJwa1V7esgQRPIEBkLxNKPTen8pVtp2SbuL1B2VVJr\r\nXCEx7bdYlm+T1jww8+kNWBUIlUM7FxsHJR8=\r\n=4qFg\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.8.1-unstable.268_1678232497764_0.41861705779622693"},"_hasShrinkwrap":false},"0.8.1-unstable.269":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.8.1-unstable.269","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"^0.3.0-unstable.23","@sphereon/pex":"2.0.0-unstable.10","@sphereon/ssi-sdk-core":"^0.8.1-unstable.269+4caadec","@sphereon/ssi-sdk-did-utils":"^0.8.1-unstable.269+4caadec","@sphereon/ssi-types":"^0.8.1-unstable.269+4caadec","@sphereon/wellknown-dids-client":"^0.1.3-unstable.1","@types/uuid":"^9.0.1","@veramo/core":"4.2.0","@veramo/credential-w3c":"4.2.0","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.5.1-unstable.1","@veramo/cli":"4.2.0","@veramo/did-provider-key":"4.2.0","@veramo/did-resolver":"4.2.0","@veramo/utils":"4.2.0","did-resolver":"^4.0.1","nock":"^13.2.1","typescript":"^4.6.4"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"4caadec6fe8afbda53d30a74da7b5c8187aac0ad","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authorization request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst authorizationRequest = await agent.getSiopAuthorizationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authorization request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationRequestDetailsResponse = await agent.getSiopAuthorizationRequestDetails({\n  sessionId,\n  verifiedAuthorizationRequest: createAuthorizationResponse,\n})\n```\n\n### Verify authorization request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthorizationResponse = await agent.verifySiopAuthorizationRequestURI({\n  sessionId,\n  requestURI: createAuthorizationResponse,\n})\n```\n\n### Send authorization response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationResponse = await agent.sendSiopAuthorizationResponse({\n  sessionId,\n  verifiedAuthorizationRequest: verifiedAuthorizationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.8.1-unstable.269","_nodeVersion":"16.19.1","_npmVersion":"lerna/4.0.0/node@v16.19.1+x64 (linux)","dist":{"integrity":"sha512-1BNOP1iWdULxmdVfjcX60s8tzXbAzEWBGjWbecxEyHAfbTiQ8zDtrNbljwDq03Npevdrc5bQtHm1GM0z6Tzfvg==","shasum":"0a5763753f213c1d86f047463822592f028bbf33","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.8.1-unstable.269.tgz","fileCount":34,"unpackedSize":140137,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGT115NOrRQyF5X4TKcMbF9OUZo1ZVBxyojbAlA9d7a8AiEAofli66Wzbwn+aKtZcxDhcRDgJwbRS5IVBlWLjKNDhAA="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkB9IWACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpqpA/5AIyOaJonsKrd17boZHMC5XpvLgJ0WrPcYhhJeLJpxtDRVlgs\r\nO8r/ccIswEnNV0ZjRktxcjFkI+jfw/HlQN8x1yt92bzh6VLxYbFUEqF5zy/v\r\nVxOrnkxp1rGi6XUOvw9nsHT3cVzIx8pDx5rdBPomc3O7ERWlJEbR0kNFkkDN\r\nT2pOWVSC84SmzRVQB53oaMOhDcZT/nh1SAUOmpc3BBP2HusuJM9qY6UBWYr4\r\nPFrkMtxg0pabrvknUKWc6HUXaLCEFWyxAVRIHg0Ukl3ZAYuSKPUgWpPjic97\r\nypUGcbrUCmyZ95/lA0eE2pvyJw57r0sXm5u4Hye7meyJOaGoD6JLWVCA4Xyk\r\n/MBji80TOiKlDDRSwuEtyPX0309Xr9MnRxauuutvkAIZwd5mobcBbgaA/8Uv\r\nIX5ZlhkIvRfVZDyWna6zoJhPPVt0UjC8o6IEKBgqtShceN/O3z4OTU/abL8l\r\nmZ9KwZmL799tpJW4B6mrPTif3XTSoQwyl53fqaURbH6RY5BQCR+C8T/E+XRF\r\npn719VzctHdpMGZ4kuMTPfF3AStvmJgIwE6u7g+x2LGnEyuaPOyZGZdze8zk\r\nDGWmL95bvAf6InEwY3SkJhrSKnX9pSWhuLBS5eiQ69K2CS37Coi29eKAEj8h\r\nb/4qd8VzyFyjECUVSG6mcFYJdlV/S8jv10M=\r\n=4jyt\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.8.1-unstable.269_1678234134637_0.6393244092198991"},"_hasShrinkwrap":false},"0.8.1-unstable.270":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.8.1-unstable.270","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"^0.3.0-unstable.24","@sphereon/pex":"2.0.0-unstable.11","@sphereon/ssi-sdk-core":"^0.8.1-unstable.270+8b6b21e","@sphereon/ssi-sdk-did-utils":"^0.8.1-unstable.270+8b6b21e","@sphereon/ssi-types":"^0.8.1-unstable.270+8b6b21e","@sphereon/wellknown-dids-client":"^0.1.3-unstable.1","@types/uuid":"^9.0.1","@veramo/core":"4.2.0","@veramo/credential-w3c":"4.2.0","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.5.1-unstable.1","@veramo/cli":"4.2.0","@veramo/did-provider-key":"4.2.0","@veramo/did-resolver":"4.2.0","@veramo/utils":"4.2.0","did-resolver":"^4.0.1","nock":"^13.2.1","typescript":"^4.6.4"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"8b6b21e50655c69f0aafe533faab93b47825715f","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authorization request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst authorizationRequest = await agent.getSiopAuthorizationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authorization request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationRequestDetailsResponse = await agent.getSiopAuthorizationRequestDetails({\n  sessionId,\n  verifiedAuthorizationRequest: createAuthorizationResponse,\n})\n```\n\n### Verify authorization request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthorizationResponse = await agent.verifySiopAuthorizationRequestURI({\n  sessionId,\n  requestURI: createAuthorizationResponse,\n})\n```\n\n### Send authorization response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationResponse = await agent.sendSiopAuthorizationResponse({\n  sessionId,\n  verifiedAuthorizationRequest: verifiedAuthorizationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.8.1-unstable.270","_nodeVersion":"16.19.1","_npmVersion":"lerna/4.0.0/node@v16.19.1+x64 (linux)","dist":{"integrity":"sha512-bNgPbOvReCkcGphN5KUihwTNeT0wVq7S2JBSL+kH5DDLmMWuU5pNJD0iZAC/KMmUTDEOsXo5EfSNTAk6E2LKgQ==","shasum":"d812d93a9e6f3bfef7e3ffa17c81e63a801bc3f4","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.8.1-unstable.270.tgz","fileCount":34,"unpackedSize":140137,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDBjbMXosb/zRJeBAzb7lDI1c1xRd9Dwk3OnikxPWC5SgIhAPAtbPLNomlKwcu1OztBdYtMBw+Sa60ddsfuE9uQennI"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkB95xACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmqejw//eREBnGoNeCHZK7UYMNgncE09VvOBKnFmSIcwfgEhfsU8zrmN\r\nwuvMMjH+v2n7ddXFZILE5b5WUb1gP9tzhfgN2r2kDUYSuPlTH7H/9+EukXVR\r\nu+vkwAWoLHziTvPddn9ss167AZdnjFMAV0AtrtT4PGnUxzidncFDuKRHmiR4\r\nYHcAirAIADAzdE4u8T9+Yhzc2tr90NPND/Z3uy4YXqWyJls+1OcLLNb7PYSr\r\nBIsQMESgNyRXZhUgoEpgSyA/Cv742EB6kJYUDCcnbktqFoljTcjtZarBiZ7/\r\nsiHlid1NLo2ugRXZXXLhgrn+X16vq38ookyUBzb/rnwon1q3H91NWNrqPTsq\r\nm4xjyVBe7JFpPNgGCbcU8C421Zw3t4V1bzdZw0lnOFZLvmtDN8rSn3D/NyaY\r\n4aQcOA7z4e1HLm77Sc0kttoHdKtDCiMO+bB2WZiQppYVJriKbt0WhrD3nU6F\r\ncZ1XORUwfuKUwe7EaqXOEyqcDlMywMrtFGfCnK6aMsYkHVM+q6OSCSJzKSvy\r\nDmrR9l0pYbilDALhUw4CFQw9bf+X66TnNq5QfaoLYv9yx8x6SSwgYuBvA3X7\r\nW8qNCua8CgZrrmjbBN1kKMKBOA8OD+qTS9c3TbAgX0eJXUU9uaMJ1hayJA7X\r\nzHTlOuMEztLanVYpnM2QYvdM+qLHseXWOUA=\r\n=kOt2\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.8.1-unstable.270_1678237296813_0.7540656040835001"},"_hasShrinkwrap":false},"0.8.1-unstable.278":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.8.1-unstable.278","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build --clean && tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"^0.3.0-unstable.23","@sphereon/pex":"2.0.0-unstable.10","@sphereon/ssi-sdk-core":"^0.8.1-unstable.278+ced76fd","@sphereon/ssi-sdk-did-utils":"^0.8.1-unstable.278+ced76fd","@sphereon/ssi-types":"^0.8.1-unstable.278+ced76fd","@sphereon/wellknown-dids-client":"^0.1.3-unstable.1","@types/uuid":"^9.0.1","@veramo/core":"4.2.0","@veramo/credential-w3c":"4.2.0","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.5.1-unstable.1","@veramo/cli":"4.2.0","@veramo/did-provider-key":"4.2.0","@veramo/did-resolver":"4.2.0","@veramo/utils":"4.2.0","did-resolver":"^4.0.1","nock":"^13.2.1","typescript":"^4.6.4"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"ced76fd69a1d8235dcccaf77a6a619d9aa7838b7","readme":"<!--suppress HtmlDeprecatedAttribute -->\r\n<h1 align=\"center\">\r\n  <br>\r\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\r\n  <br>DID Auth SIOP OP Authenticator (Typescript) \r\n  <br>\r\n</h1>\r\n\r\n---\r\n\r\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\r\n\r\n---\r\n\r\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\r\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\r\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\r\nas specified in the OpenID Connect working group.\r\n\r\n## Self Issued OpenID Provider v2 (SIOP)\r\n\r\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\r\n\r\n## Requirements\r\n\r\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\r\n\r\n## Available functions\r\n\r\n- getSessionForSiop\r\n- registerSessionForSiop\r\n- removeSessionForSiop\r\n- registerCustomApprovalForSiop\r\n- removeCustomApprovalForSiop\r\n- authenticateWithSiop\r\n- getSiopAuthorizationRequestFromRP\r\n- getSiopAuthorizationRequestDetails\r\n- verifySiopAuthorizationRequestURI\r\n- sendSiopAuthorizationResponse\r\n\r\nThe following functions can also be used on the session object without the need of a session id first.\r\n\r\n- authenticateWithSiop\r\n- getSiopAuthorizationRequestFromRP\r\n- getSiopAuthorizationRequestDetails\r\n- verifySiopAuthorizationRequestURI\r\n- sendSiopAuthorizationResponse\r\n\r\n## Usage\r\n\r\n### Adding the plugin to an agent:\r\n\r\n```typescript\r\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\r\nimport { Resolver } from 'did-resolver'\r\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\r\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\r\nimport { getUniResolver } from '@sphereon/did-uni-client'\r\n\r\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\r\n  plugins: [\r\n    new DidAuthSiopOpAuthenticator(),\r\n    new DIDResolverPlugin({\r\n      resolver: new Resolver({\r\n        ...getDidKeyResolver(),\r\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\r\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\r\n      }),\r\n    }),\r\n  ],\r\n})\r\n```\r\n\r\n### Get an OP session:\r\n\r\n```typescript\r\nconst sessionId = 'example_session_id'\r\nconst opSession = await agent.getSessionForSiop({\r\n  sessionId,\r\n})\r\n```\r\n\r\n### Register an OP session:\r\n\r\n```typescript\r\nconst sessionId = 'example_session_id'\r\nconst identifier = {\r\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\r\n  provider: 'example_provider',\r\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\r\n  keys: [\r\n    {\r\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\r\n      kms: 'example_kms',\r\n      type: 'Ed25519' as const,\r\n      publicKeyHex: '1e21e21e...',\r\n      privateKeyHex: 'elfcvtswdbn...',\r\n    },\r\n  ],\r\n  services: [],\r\n}\r\n\r\nconst opSession = await agent.registerSessionForSiop({\r\n  sessionId,\r\n  identifier,\r\n})\r\n```\r\n\r\n### Remove an OP session:\r\n\r\n```typescript\r\nconst sessionId = 'example_session_id'\r\nconst opSession = await agent.removeSessionForSiop({\r\n  sessionId,\r\n})\r\n```\r\n\r\n### Authenticate with DID auth SIOP:\r\n\r\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\r\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\r\n\r\nThese custom approval functions can also be provided at agent creation.\r\n\r\n```typescript\r\nawait agent.registerCustomApprovalForSiop({\r\n  key: 'example_key',\r\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => Promise.resolve(),\r\n})\r\n```\r\n\r\n```typescript\r\nconst sessionId = 'example_session_id'\r\nconst stateId = 'example_state_id'\r\nconst redirectUrl = 'https://example.com'\r\nconst customApprovalKey = 'example_key'\r\nconst authenticationResponse = await agent.authenticateWithSiop({\r\n  sessionId,\r\n  stateId,\r\n  redirectUrl,\r\n  customApproval: customApprovalKey,\r\n})\r\n```\r\n\r\n```typescript\r\nconst authenticationResponse = await agent.authenticateWithSiop({\r\n  sessionId,\r\n  stateId,\r\n  redirectUrl,\r\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => {\r\n    return Promise.resolve()\r\n  },\r\n})\r\n```\r\n\r\n### Get authorization request from the relying party:\r\n\r\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\r\n\r\n```typescript\r\nconst sessionId = 'example_session_id'\r\nconst stateId = 'example_state_id'\r\nconst redirectUrl = 'https://example.com'\r\nconst authorizationRequest = await agent.getSiopAuthorizationRequestFromRP({\r\n  sessionId,\r\n  stateId,\r\n  redirectUrl,\r\n})\r\n```\r\n\r\n### Get authorization request details:\r\n\r\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\r\n\r\n```typescript\r\nconst sessionId = 'example_session_id'\r\nconst authorizationRequestDetailsResponse = await agent.getSiopAuthorizationRequestDetails({\r\n  sessionId,\r\n  verifiedAuthorizationRequest: createAuthorizationResponse,\r\n})\r\n```\r\n\r\n### Verify authorization request URI:\r\n\r\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\r\n\r\n```typescript\r\nconst sessionId = 'example_session_id'\r\nconst verifiedAuthorizationResponse = await agent.verifySiopAuthorizationRequestURI({\r\n  sessionId,\r\n  requestURI: createAuthorizationResponse,\r\n})\r\n```\r\n\r\n### Send authorization response:\r\n\r\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\r\n\r\n```typescript\r\nconst sessionId = 'example_session_id'\r\nconst authorizationResponse = await agent.sendSiopAuthorizationResponse({\r\n  sessionId,\r\n  verifiedAuthorizationRequest: verifiedAuthorizationResponse,\r\n})\r\n```\r\n\r\n## Installation\r\n\r\n```shell\r\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\r\n```\r\n\r\n## Build\r\n\r\n```shell\r\nyarn build\r\n```\r\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute -->\r <h1 align=\"center\">\r   <br>\r   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\r   <br>DID Auth SIOP OP Authenticator (","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.8.1-unstable.278","_nodeVersion":"16.19.1","_npmVersion":"lerna/4.0.0/node@v16.19.1+x64 (linux)","dist":{"integrity":"sha512-/UOWQ7VBEJrPVu77UevYrU+jjbCfuTT49UHgDu1l4yobIUn9UuWU+iOJ3TBPdQuYlh+Jb0XziVEUfwzs9LnsJw==","shasum":"05c2d6ed112647540671c942e46eae7f6a7ccc45","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.8.1-unstable.278.tgz","fileCount":34,"unpackedSize":139732,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDfDoFYUnihVs05XKFLIJAfevBWk4mBVDFxjNeU/1JyLAiEAvhNpCiMzSQdiSiRVQokP5jKp3bR4JkHo/xwCcHlfsVY="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkCLexACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmoq7Q/9F/75OyFNqmg/orqcrTlIkQSPVe6JjM+9mSd/NW22k4pxQR0Y\r\nXVyV8h4zhiIKIaKnjJpC+6EIt0q5AICEnllYr1Uu6ptdCg5V8F1DtOtV8e60\r\nbvlPgUCirtj7SgGz2FyAaTFtIK0ZlM+sWGeOT95vSOU4m1kb3ThBjjb8AUHt\r\nHfzXPvueBzpj6Xre/4OgQJ/z/NmHwZ44bWK3OK8R3dCw/9wKXyrTzeMMehlq\r\njTCeV1JZq+1m+sVw8C4IeRl2DvR0nUgQ+nPnjGWB4J2sNG7avuoexcqJQ+2j\r\nn3XqgrXigd444qB1l/2A3j8covagwCnbpYI1nfn74312TbG9iolHjzwzwTdW\r\nb3r2eJUq4mIlhBaQZ+ZN+Irll1izSh/nF0vZr0CulJ+2wURWuLO2dDVM88Ta\r\nwIKmiWQNBoFMWtMlwHDLorG7qTZcTTNz3xI+Y4uAzB4ZtwsRFuMRgPfS1fUj\r\nPMN6afWXrFXh+NnNHU3EhdE+TY1Tk2gNPIAQHUsiHb634Qo6FN9gselsEAsa\r\nD+YrufwqTm4V83LH2bz6b/7gbdPQUxD9HhvK1a9FZB8t0Eoil1MtoEALHN03\r\nLXBDkcM+FldVnjCyLF2LdeSRyXJn6Stb2i7uax8eTX4726IWzQ82YCS/d6hU\r\nZw4Kv5kRYObP9E/qdtI5p3XLcdI/NTSLXmo=\r\n=Bcfn\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.8.1-unstable.278_1678292912989_0.13576098072161047"},"_hasShrinkwrap":false},"0.8.1-unstable.279":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.8.1-unstable.279","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build --clean && tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"^0.3.0-unstable.23","@sphereon/pex":"2.0.0-unstable.10","@sphereon/ssi-sdk-core":"^0.8.1-unstable.279+31f0db4","@sphereon/ssi-sdk-did-utils":"^0.8.1-unstable.279+31f0db4","@sphereon/ssi-types":"^0.8.1-unstable.279+31f0db4","@sphereon/wellknown-dids-client":"^0.1.3-unstable.1","@types/uuid":"^9.0.1","@veramo/core":"4.2.0","@veramo/credential-w3c":"4.2.0","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.5.1-unstable.1","@veramo/cli":"4.2.0","@veramo/did-provider-key":"4.2.0","@veramo/did-resolver":"4.2.0","@veramo/utils":"4.2.0","did-resolver":"^4.0.1","nock":"^13.2.1","typescript":"^4.6.4"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"31f0db4b692262cab82cfda3d038589f1987fc69","readme":"<!--suppress HtmlDeprecatedAttribute -->\r\n<h1 align=\"center\">\r\n  <br>\r\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\r\n  <br>DID Auth SIOP OP Authenticator (Typescript) \r\n  <br>\r\n</h1>\r\n\r\n---\r\n\r\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\r\n\r\n---\r\n\r\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\r\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\r\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\r\nas specified in the OpenID Connect working group.\r\n\r\n## Self Issued OpenID Provider v2 (SIOP)\r\n\r\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\r\n\r\n## Requirements\r\n\r\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\r\n\r\n## Available functions\r\n\r\n- getSessionForSiop\r\n- registerSessionForSiop\r\n- removeSessionForSiop\r\n- registerCustomApprovalForSiop\r\n- removeCustomApprovalForSiop\r\n- authenticateWithSiop\r\n- getSiopAuthorizationRequestFromRP\r\n- getSiopAuthorizationRequestDetails\r\n- verifySiopAuthorizationRequestURI\r\n- sendSiopAuthorizationResponse\r\n\r\nThe following functions can also be used on the session object without the need of a session id first.\r\n\r\n- authenticateWithSiop\r\n- getSiopAuthorizationRequestFromRP\r\n- getSiopAuthorizationRequestDetails\r\n- verifySiopAuthorizationRequestURI\r\n- sendSiopAuthorizationResponse\r\n\r\n## Usage\r\n\r\n### Adding the plugin to an agent:\r\n\r\n```typescript\r\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\r\nimport { Resolver } from 'did-resolver'\r\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\r\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\r\nimport { getUniResolver } from '@sphereon/did-uni-client'\r\n\r\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\r\n  plugins: [\r\n    new DidAuthSiopOpAuthenticator(),\r\n    new DIDResolverPlugin({\r\n      resolver: new Resolver({\r\n        ...getDidKeyResolver(),\r\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\r\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\r\n      }),\r\n    }),\r\n  ],\r\n})\r\n```\r\n\r\n### Get an OP session:\r\n\r\n```typescript\r\nconst sessionId = 'example_session_id'\r\nconst opSession = await agent.getSessionForSiop({\r\n  sessionId,\r\n})\r\n```\r\n\r\n### Register an OP session:\r\n\r\n```typescript\r\nconst sessionId = 'example_session_id'\r\nconst identifier = {\r\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\r\n  provider: 'example_provider',\r\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\r\n  keys: [\r\n    {\r\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\r\n      kms: 'example_kms',\r\n      type: 'Ed25519' as const,\r\n      publicKeyHex: '1e21e21e...',\r\n      privateKeyHex: 'elfcvtswdbn...',\r\n    },\r\n  ],\r\n  services: [],\r\n}\r\n\r\nconst opSession = await agent.registerSessionForSiop({\r\n  sessionId,\r\n  identifier,\r\n})\r\n```\r\n\r\n### Remove an OP session:\r\n\r\n```typescript\r\nconst sessionId = 'example_session_id'\r\nconst opSession = await agent.removeSessionForSiop({\r\n  sessionId,\r\n})\r\n```\r\n\r\n### Authenticate with DID auth SIOP:\r\n\r\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\r\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\r\n\r\nThese custom approval functions can also be provided at agent creation.\r\n\r\n```typescript\r\nawait agent.registerCustomApprovalForSiop({\r\n  key: 'example_key',\r\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => Promise.resolve(),\r\n})\r\n```\r\n\r\n```typescript\r\nconst sessionId = 'example_session_id'\r\nconst stateId = 'example_state_id'\r\nconst redirectUrl = 'https://example.com'\r\nconst customApprovalKey = 'example_key'\r\nconst authenticationResponse = await agent.authenticateWithSiop({\r\n  sessionId,\r\n  stateId,\r\n  redirectUrl,\r\n  customApproval: customApprovalKey,\r\n})\r\n```\r\n\r\n```typescript\r\nconst authenticationResponse = await agent.authenticateWithSiop({\r\n  sessionId,\r\n  stateId,\r\n  redirectUrl,\r\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => {\r\n    return Promise.resolve()\r\n  },\r\n})\r\n```\r\n\r\n### Get authorization request from the relying party:\r\n\r\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\r\n\r\n```typescript\r\nconst sessionId = 'example_session_id'\r\nconst stateId = 'example_state_id'\r\nconst redirectUrl = 'https://example.com'\r\nconst authorizationRequest = await agent.getSiopAuthorizationRequestFromRP({\r\n  sessionId,\r\n  stateId,\r\n  redirectUrl,\r\n})\r\n```\r\n\r\n### Get authorization request details:\r\n\r\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\r\n\r\n```typescript\r\nconst sessionId = 'example_session_id'\r\nconst authorizationRequestDetailsResponse = await agent.getSiopAuthorizationRequestDetails({\r\n  sessionId,\r\n  verifiedAuthorizationRequest: createAuthorizationResponse,\r\n})\r\n```\r\n\r\n### Verify authorization request URI:\r\n\r\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\r\n\r\n```typescript\r\nconst sessionId = 'example_session_id'\r\nconst verifiedAuthorizationResponse = await agent.verifySiopAuthorizationRequestURI({\r\n  sessionId,\r\n  requestURI: createAuthorizationResponse,\r\n})\r\n```\r\n\r\n### Send authorization response:\r\n\r\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\r\n\r\n```typescript\r\nconst sessionId = 'example_session_id'\r\nconst authorizationResponse = await agent.sendSiopAuthorizationResponse({\r\n  sessionId,\r\n  verifiedAuthorizationRequest: verifiedAuthorizationResponse,\r\n})\r\n```\r\n\r\n## Installation\r\n\r\n```shell\r\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\r\n```\r\n\r\n## Build\r\n\r\n```shell\r\nyarn build\r\n```\r\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute -->\r <h1 align=\"center\">\r   <br>\r   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\r   <br>DID Auth SIOP OP Authenticator (","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.8.1-unstable.279","_nodeVersion":"16.19.1","_npmVersion":"lerna/4.0.0/node@v16.19.1+x64 (linux)","dist":{"integrity":"sha512-TCI84PXh2pHcuJFU3mZXxE4d03evMedKFW3wfoXezqngPzVRHW4n+w4XCn5JITMMWF6JzU0rGVWsk39cK35ODQ==","shasum":"32f83e2eb0f9b5caa0168f58ec13cebe18c4c0dc","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.8.1-unstable.279.tgz","fileCount":34,"unpackedSize":139732,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDFsURzv8eBS53ZcUzOaZgUgdER5tOLd7JFVUDSHsyN8AIhAIW/4tjJm8biVEEpgqVLM481dj0nKp2BGeR6nVLAHnXo"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkCOXtACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqE9w/+Lhlb65yD9n7zFVtamOZrKa4MPyPIbzRwoOtNmzdoceCcLe9T\r\nviV75H4nlC9t4WNVQ0yowS9PvMtUcnhtTxvaGj+xhSVUz+OonjSumbOgri31\r\nLfXs7JwPWaUJoMD8wqPFgULjEInWDNJEJ8XAQMsY6ZcCUaaUw5FueRmAWrao\r\n5KghMcrAUp5c00o13NEXEqN8gWVQHqhIbh0FwHHq8v4pE9MYvvyfG6COLtGy\r\nmzTt8+L+rTUobYljKX0mH/3CO60oyl7iz012I82fuDlTlvWS+2bfehJ2g4E0\r\naJboVPjbq/9XtNJt63xPM95163V5umx2U17UGH8padIEfBBpNJqJmAtFoRps\r\nHU2WxA9UaZkhnGY+Rj2lK/O1qEGZjtWTIwgTVz2KhyVf41QLl2ibO3Zx6MRf\r\nMaEqALrTf/iQBgFi73UkAX5nSbtN9TdHwVZaS3x8+Z4u4bE+ozvghwhLuwlg\r\nyTYO693N/ETNNxnl4OxRRSG8xq91bDYqHufgRl+ZowFPXZd11A8J+N2SXZCC\r\nCkgz/O8s7rd2Jez6Os+ejMKodyY+e6EE0JoYTN6MR6yWhZHKx2S85AJ8V3J2\r\nzxUEY0X929Mpv5ZyRH1pZ+9rP2f+4P+6FT4EqpM/I+rXR4SMN9mmWf6ubWhG\r\ndnuuTVWC1WtmM6ejBpeK7W44nKx2Pqf1vH8=\r\n=SPuV\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.8.1-unstable.279_1678304748948_0.259266693604312"},"_hasShrinkwrap":false},"0.8.1-unstable.280":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.8.1-unstable.280","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build --clean && tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"^0.3.0-unstable.23","@sphereon/pex":"2.0.0-unstable.10","@sphereon/ssi-sdk-core":"^0.8.1-unstable.280+fb79036","@sphereon/ssi-sdk-did-utils":"^0.8.1-unstable.280+fb79036","@sphereon/ssi-types":"^0.8.1-unstable.280+fb79036","@sphereon/wellknown-dids-client":"^0.1.3-unstable.1","@types/uuid":"^9.0.1","@veramo/core":"4.2.0","@veramo/credential-w3c":"4.2.0","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.5.1-unstable.1","@veramo/cli":"4.2.0","@veramo/did-provider-key":"4.2.0","@veramo/did-resolver":"4.2.0","@veramo/utils":"4.2.0","did-resolver":"^4.0.1","nock":"^13.2.1","typescript":"^4.6.4"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"fb79036acd60a5da2aaab44b49fc942436d3b23e","readme":"<!--suppress HtmlDeprecatedAttribute -->\r\n<h1 align=\"center\">\r\n  <br>\r\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\r\n  <br>DID Auth SIOP OP Authenticator (Typescript) \r\n  <br>\r\n</h1>\r\n\r\n---\r\n\r\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\r\n\r\n---\r\n\r\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\r\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\r\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\r\nas specified in the OpenID Connect working group.\r\n\r\n## Self Issued OpenID Provider v2 (SIOP)\r\n\r\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\r\n\r\n## Requirements\r\n\r\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\r\n\r\n## Available functions\r\n\r\n- getSessionForSiop\r\n- registerSessionForSiop\r\n- removeSessionForSiop\r\n- registerCustomApprovalForSiop\r\n- removeCustomApprovalForSiop\r\n- authenticateWithSiop\r\n- getSiopAuthorizationRequestFromRP\r\n- getSiopAuthorizationRequestDetails\r\n- verifySiopAuthorizationRequestURI\r\n- sendSiopAuthorizationResponse\r\n\r\nThe following functions can also be used on the session object without the need of a session id first.\r\n\r\n- authenticateWithSiop\r\n- getSiopAuthorizationRequestFromRP\r\n- getSiopAuthorizationRequestDetails\r\n- verifySiopAuthorizationRequestURI\r\n- sendSiopAuthorizationResponse\r\n\r\n## Usage\r\n\r\n### Adding the plugin to an agent:\r\n\r\n```typescript\r\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\r\nimport { Resolver } from 'did-resolver'\r\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\r\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\r\nimport { getUniResolver } from '@sphereon/did-uni-client'\r\n\r\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\r\n  plugins: [\r\n    new DidAuthSiopOpAuthenticator(),\r\n    new DIDResolverPlugin({\r\n      resolver: new Resolver({\r\n        ...getDidKeyResolver(),\r\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\r\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\r\n      }),\r\n    }),\r\n  ],\r\n})\r\n```\r\n\r\n### Get an OP session:\r\n\r\n```typescript\r\nconst sessionId = 'example_session_id'\r\nconst opSession = await agent.getSessionForSiop({\r\n  sessionId,\r\n})\r\n```\r\n\r\n### Register an OP session:\r\n\r\n```typescript\r\nconst sessionId = 'example_session_id'\r\nconst identifier = {\r\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\r\n  provider: 'example_provider',\r\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\r\n  keys: [\r\n    {\r\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\r\n      kms: 'example_kms',\r\n      type: 'Ed25519' as const,\r\n      publicKeyHex: '1e21e21e...',\r\n      privateKeyHex: 'elfcvtswdbn...',\r\n    },\r\n  ],\r\n  services: [],\r\n}\r\n\r\nconst opSession = await agent.registerSessionForSiop({\r\n  sessionId,\r\n  identifier,\r\n})\r\n```\r\n\r\n### Remove an OP session:\r\n\r\n```typescript\r\nconst sessionId = 'example_session_id'\r\nconst opSession = await agent.removeSessionForSiop({\r\n  sessionId,\r\n})\r\n```\r\n\r\n### Authenticate with DID auth SIOP:\r\n\r\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\r\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\r\n\r\nThese custom approval functions can also be provided at agent creation.\r\n\r\n```typescript\r\nawait agent.registerCustomApprovalForSiop({\r\n  key: 'example_key',\r\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => Promise.resolve(),\r\n})\r\n```\r\n\r\n```typescript\r\nconst sessionId = 'example_session_id'\r\nconst stateId = 'example_state_id'\r\nconst redirectUrl = 'https://example.com'\r\nconst customApprovalKey = 'example_key'\r\nconst authenticationResponse = await agent.authenticateWithSiop({\r\n  sessionId,\r\n  stateId,\r\n  redirectUrl,\r\n  customApproval: customApprovalKey,\r\n})\r\n```\r\n\r\n```typescript\r\nconst authenticationResponse = await agent.authenticateWithSiop({\r\n  sessionId,\r\n  stateId,\r\n  redirectUrl,\r\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => {\r\n    return Promise.resolve()\r\n  },\r\n})\r\n```\r\n\r\n### Get authorization request from the relying party:\r\n\r\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\r\n\r\n```typescript\r\nconst sessionId = 'example_session_id'\r\nconst stateId = 'example_state_id'\r\nconst redirectUrl = 'https://example.com'\r\nconst authorizationRequest = await agent.getSiopAuthorizationRequestFromRP({\r\n  sessionId,\r\n  stateId,\r\n  redirectUrl,\r\n})\r\n```\r\n\r\n### Get authorization request details:\r\n\r\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\r\n\r\n```typescript\r\nconst sessionId = 'example_session_id'\r\nconst authorizationRequestDetailsResponse = await agent.getSiopAuthorizationRequestDetails({\r\n  sessionId,\r\n  verifiedAuthorizationRequest: createAuthorizationResponse,\r\n})\r\n```\r\n\r\n### Verify authorization request URI:\r\n\r\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\r\n\r\n```typescript\r\nconst sessionId = 'example_session_id'\r\nconst verifiedAuthorizationResponse = await agent.verifySiopAuthorizationRequestURI({\r\n  sessionId,\r\n  requestURI: createAuthorizationResponse,\r\n})\r\n```\r\n\r\n### Send authorization response:\r\n\r\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\r\n\r\n```typescript\r\nconst sessionId = 'example_session_id'\r\nconst authorizationResponse = await agent.sendSiopAuthorizationResponse({\r\n  sessionId,\r\n  verifiedAuthorizationRequest: verifiedAuthorizationResponse,\r\n})\r\n```\r\n\r\n## Installation\r\n\r\n```shell\r\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\r\n```\r\n\r\n## Build\r\n\r\n```shell\r\nyarn build\r\n```\r\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute -->\r <h1 align=\"center\">\r   <br>\r   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\r   <br>DID Auth SIOP OP Authenticator (","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.8.1-unstable.280","_nodeVersion":"16.19.1","_npmVersion":"lerna/4.0.0/node@v16.19.1+x64 (linux)","dist":{"integrity":"sha512-4syvmW42614Q3JeanFJFPeJTsi9MoIg/hCCH/3d/LkgLbtwhKmx1AwL3pa2s1krLnSyaHwBNVMDY8A3rOSoxWg==","shasum":"5048ba28bd3651e07d102136a071d8df99f14b16","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.8.1-unstable.280.tgz","fileCount":34,"unpackedSize":139732,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIALSjXXqZRIHK5ZHY+NTC/jtFT3pguiqSQSpNeBI+hpIAiB8YTP3LKz59oO43SbfPJtT8/nLJO/YxcCtUbinul3ydg=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkCQgzACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmphTA//beS0tNK7MJj/qm1hNlArz4cYy6/f+2+utLWQ1WkxpcnBESNm\r\npHZjyDlpOxGMrL7g3QWh++CaPMuvEPFkyucUcuMYIPcZOo1I0O2fQXgbXafr\r\nzi/CebNYzjRNM6gSvusxxzodRv/hTEPLjlK0G/dUglY8pRYYQEGvmd5/j0SU\r\nuVmo+eNg7yuKt5L2QV2/3L9yCmxI/BOhREUz5GQ4nBRAhTcATWMnVPcuJ5dA\r\njX/C3sNtr8tCFFvQR4Yl2AcXCqb1VLFUNvzW+vwPeDDEkAI7A8ay1l1FpadQ\r\n01y5OhYGziBAlNSU8T3N7UswdWZwtkpuyDNBoudnjPW9746I+ItdvMY/mZzD\r\neYaWOMLNpm+qQxNNbllR6Pi57/+EZFr+VkySb4+xoQp7JKPrN0bLy9mz3xF+\r\nKaqI6YokBtfd5of/4cpDTjT836G85DxYdXhd3f9rTzmvV5XuIc1JPFmzWLfr\r\ndVoY5YE576xdZhxX6al3Gy9lHgr0+yTSTaL2nrGJrCvjyQ90m+4X4xW2qm8V\r\nwOP0RPMiyaw44fNddsOYKcOx60YJxFAB1TImGdk0sXXhY4XRmCT4vdXlLIX1\r\nr1KTwDnGpzIOZwb6/mgiilsfQOKu5QEynNieXCQhMKtwxeOtk3Hagwd4qeD8\r\nY595ym6hG2wVRKAmoz7shhnoJwLKdNmN3+k=\r\n=QHD1\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.8.1-unstable.280_1678313522994_0.6947564167906046"},"_hasShrinkwrap":false},"0.8.1-next.272":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.8.1-next.272","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"^0.3.0-unstable.24","@sphereon/pex":"2.0.0-unstable.11","@sphereon/ssi-sdk-core":"^0.8.1-next.272+a34f653","@sphereon/ssi-sdk-did-utils":"^0.8.1-next.272+a34f653","@sphereon/ssi-types":"^0.8.1-next.272+a34f653","@sphereon/wellknown-dids-client":"^0.1.3-unstable.1","@types/uuid":"^9.0.1","@veramo/core":"4.2.0","@veramo/credential-w3c":"4.2.0","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.6.0","@veramo/cli":"4.2.0","@veramo/did-provider-key":"4.2.0","@veramo/did-resolver":"4.2.0","@veramo/utils":"4.2.0","did-resolver":"^4.0.1","nock":"^13.2.1","typescript":"^4.6.4"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"a34f653b26d26b6d980aa9196b814ad42cfa5e3f","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authorization request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst authorizationRequest = await agent.getSiopAuthorizationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authorization request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationRequestDetailsResponse = await agent.getSiopAuthorizationRequestDetails({\n  sessionId,\n  verifiedAuthorizationRequest: createAuthorizationResponse,\n})\n```\n\n### Verify authorization request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthorizationResponse = await agent.verifySiopAuthorizationRequestURI({\n  sessionId,\n  requestURI: createAuthorizationResponse,\n})\n```\n\n### Send authorization response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationResponse = await agent.sendSiopAuthorizationResponse({\n  sessionId,\n  verifiedAuthorizationRequest: verifiedAuthorizationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.8.1-next.272","_nodeVersion":"16.19.1","_npmVersion":"lerna/4.0.0/node@v16.19.1+x64 (linux)","dist":{"integrity":"sha512-FwFbpSPbsSOgGqCsmjzEL01VBxoMttPVKGnf0/6D+dDv0tat3wQP8gMNsxfuKudEgg9GHvw/vRYplVplRJ9CPg==","shasum":"99e5371affab5e33f9b2694acee1a369800ca68a","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.8.1-next.272.tgz","fileCount":34,"unpackedSize":140110,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCH3+KLDbz7EYHNWCETisgZ6NIavJ/vKfK6Szu+cl7DMgIgaZmBi2LExsxNYLOnmMx9lclfakiTv+Oqtsiomyg8lN4="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkCSo5ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmpkdw//URrOaPrQO3Zq8wt8afM7uE/At62qI6FB5Nv1GYOo42zrbtDv\r\n8Yw9H06QBtmuy31N2KQ1d8h32aYiWVo3aY6nYRQDgw4yy04aD1YZp191E4EC\r\nciQfPkig2j6YoDLI6yvKNIIOt/GHmQU1/RN/1f+ucRFqZLkdXpQGKGwIMQOP\r\n+7M0YEJqRQ7sMMiGWAOAg29XdzAX/Jhp6QtJTL76P9Q6RqaReBN/JTtq5DMN\r\nUqV3yOLgVULN8c0bke+4V1Sz6Ap0n2BrNYO/ecfE+nqLUCBSeKJkQKKfZZj1\r\nsS1GOK5sVW1g2q453Rp7rfJnKfU7MjZeTipQ44GnnV/7FwsGZgfdJqiIT2Fy\r\nBJKxakjT3GkzJkBWfCmSTSd908zEagh7dMO+ATIkHHmwchHUO6WRzrI7uqCx\r\nAZCD7sWrmoCmyDL6Rp7WbVipB6vzL6Tg1Nv6dm8zLZh05jZb4MNpRYIEue9B\r\nd4ht/CeYsPfFKwRR7p3XryjP4KFggQskwjg3HP2njSsK0z9iryksid90pEE6\r\nch170381gjmvCLHWIyMRIHCvd7ojj6uuG+aGivO6i+2DVYd5du9c/NRK/Q5x\r\nE55sZQq7xFU+gDYuX96r3k49qYE+jOpTUGebwtwtBpZXATfdN6sDW8dTIGXV\r\nUMs+nj9P9bfdMb+9Lkio4ij6+nIoMWTt7T8=\r\n=pfZQ\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.8.1-next.272_1678322233035_0.7275370728916406"},"_hasShrinkwrap":false},"0.9.0":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.9.0","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"^0.3.0-unstable.24","@sphereon/pex":"2.0.0-unstable.11","@sphereon/ssi-sdk-core":"^0.9.0","@sphereon/ssi-sdk-did-utils":"^0.9.0","@sphereon/ssi-types":"^0.9.0","@sphereon/wellknown-dids-client":"^0.1.3-unstable.1","@types/uuid":"^9.0.1","@veramo/core":"4.2.0","@veramo/credential-w3c":"4.2.0","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.6.0","@veramo/cli":"4.2.0","@veramo/did-provider-key":"4.2.0","@veramo/did-resolver":"4.2.0","@veramo/utils":"4.2.0","did-resolver":"^4.0.1","nock":"^13.2.1","typescript":"^4.6.4"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"9119280fec93d685824f0baa454163d703431025","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.9.0","_nodeVersion":"16.19.1","_npmVersion":"lerna/4.0.0/node@v16.19.1+x64 (linux)","dist":{"integrity":"sha512-6JXVL3HX/e8mVAyWQSkBtW54FXu/vn3Mhr2Ex2cinK/1tJ9L2hruNGW3Lelu92qTkjRjrn8CR4FltVn67c7Kpg==","shasum":"19c979a06c2b02f07cee9571b63371b8f38ab135","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.9.0.tgz","fileCount":34,"unpackedSize":140042,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCjWYKvzyNp5/prS6RYkQD3MHLl+KJOYzwjUKKTGHW0kwIgLInIdI1DWkigRD9zyeducHRxKOLPLKiPeEq5LWdlYk0="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkCSxKACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoEfxAAmaMcGBqYHR9gRQM1I2VJOA/knHzX+5GSPt7/VBCaUPMqs3e9\r\nfg/dLRbUthx4sa8hqgDAzZCpnZVp5yJNmGLueLSkGtuKXu3OU+MTxRv/Ucjx\r\n8kVO/i0/aMLpHDtLH3nFXaWZ6DLKUex1BYLAIZn4D8F9V0u15dF2FoW6QTtK\r\nWGTsFnJA2BDVJ6BzzXtoKu/fqTtvE9gVcGK63oC2ttCViya4tTMKJDFaikQF\r\nfIQEZTA10y9JMeUyOiaC1bHGgHtq+wasQtJz9u+9swxtd37Az/7OYJDj7+3T\r\n6u+8Alu8DqYqMWE1n/YzlSfXGuAlio6uu+qdocWNrnYA5XxZp8JeIXoJZ6Yu\r\nIh2DlUNxfu2+zGN+cogd9YZdUPIVw4A1uDHoJch1G0Mwv8SeraBMWTDR6DJ/\r\nFmZsjUS0bceIi4wY24mXCZek5ZoB0yTH02fzGo4Od4mEB2UuYSYYev0Hh7df\r\nF2hLHf4y0BRRetLcuAmRMhlcQbJA5/Hkpqqfb46iT8VQJGo8QNzZlxshbI1j\r\nGDInmAn0I9BzjtgmrsxxR251KE1duii9W3bJptHssC6YKcQVrIWRTK4eIthb\r\noYWwpnjYV37SvxINatwMlYEAwlJF/2CWE1Nh4JPh0AINyrpW+lHL8LhumLJz\r\n2Dkc7KyJnjk01EprvwWi+riyCA4v4zDCxHI=\r\n=utyE\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.9.0_1678322761849_0.36057599201027757"},"_hasShrinkwrap":false},"0.9.1-next.9":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.9.1-next.9","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"^0.3.0-unstable.25","@sphereon/pex":"2.0.0-unstable.12","@sphereon/ssi-sdk-core":"^0.9.1-next.9+fc228a2","@sphereon/ssi-sdk-did-utils":"^0.9.1-next.9+fc228a2","@sphereon/ssi-types":"^0.9.1-next.9+fc228a2","@sphereon/wellknown-dids-client":"^0.1.3","@types/uuid":"^9.0.1","@veramo/core":"4.2.0","@veramo/credential-w3c":"4.2.0","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.6.0","@veramo/cli":"4.2.0","@veramo/did-provider-key":"4.2.0","@veramo/did-resolver":"4.2.0","@veramo/utils":"4.2.0","did-resolver":"^4.0.1","nock":"^13.2.1","typescript":"^4.6.4"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"fc228a2e85d72e0e1118d71ed8ce6252f4bc273b","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authorization request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst authorizationRequest = await agent.getSiopAuthorizationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authorization request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationRequestDetailsResponse = await agent.getSiopAuthorizationRequestDetails({\n  sessionId,\n  verifiedAuthorizationRequest: createAuthorizationResponse,\n})\n```\n\n### Verify authorization request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthorizationResponse = await agent.verifySiopAuthorizationRequestURI({\n  sessionId,\n  requestURI: createAuthorizationResponse,\n})\n```\n\n### Send authorization response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationResponse = await agent.sendSiopAuthorizationResponse({\n  sessionId,\n  verifiedAuthorizationRequest: verifiedAuthorizationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.9.1-next.9","_nodeVersion":"16.19.1","_npmVersion":"lerna/6.5.1/node@v16.19.1+x64 (linux)","dist":{"integrity":"sha512-C1SaUuTl2Autp4ji0xGD8Yi/DuLipu6HVUhmXP2YiBR2uI5PJpPE//GChHoqTz6KIQDbg0Ue0afWfIWetKsFgA==","shasum":"1f56682c898f6d7f4716fc409fd892e08f442013","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.9.1-next.9.tgz","fileCount":34,"unpackedSize":140091,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICSwN7gwSLe8r9awcMQqDLwgnl152zO4NMQ8WBUSS6qZAiADEY+R3KE6xwRkFR91K+qjJ3jS/DkYuTuFkZJYhtH3jw=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkCn6aACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrNEA//SH16ABg4LZx/TDsnLbRGSRtZCcjMF0ki5xBXkthCvenADnAP\r\nlhC7iT0wD3NvoX3+xdb6Z5DPOHpdtX8bbzaywCKVQYNp9gSuj7n+Kw6P6pWE\r\ndQ4vNr5zfxb2klfPpmIWfYGeM8OJGKlD6sbwp2d514p1ui4KNiMT9tYNuI/E\r\n1T+3uWmK+o5AtQ/g23AUKIeekBUbbcDpsLuSna84UQKrA6P6ikZd9IrCNXdC\r\nlRckrjhh+2IPpxzgk7/HdE8fcieVyqnsxvHuPapZcWEwDvfns8TE4NYb5whV\r\npYlZ8mFr/aYkJABqZ9uJlfHP5PzC8r7cfWQ3znQMSzh7JRj/u99nx0RS/1IA\r\nFOfb6kwyQXUnkRHPLRmBBfyRGgb7JKv/kDVOW8UQFNULEzgPam4UKv7ROcEe\r\ndFUokdmvwIE1OUWpkYPCj4x5Rr5b8moae7KDv1iE9JZOmOT/O0IaDVMnbI1Z\r\nHYTu6jJr2+lUWXpQhxUUg2PmStK5UNcauiGcCRtoQ/zOLN50bgIn0KATDonw\r\ndGpg8dXm2NZTnWRZoTLfGDe98Uzd5Xe4QOJR9UTKpNnEBM8ar7ZdQgIJfBLK\r\nXiklB2121Z/A+EBp4M1FP5118jxvL2Scwo2LMc9N7hvJ8w3UkWIXHg0CRxWQ\r\n+IaVF0MKBgoK7ZSEv1OB5DCl3mis77gEVfQ=\r\n=k5rd\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.9.1-next.9_1678409369947_0.12308206128808097"},"_hasShrinkwrap":false},"0.9.1-unstable.17":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.9.1-unstable.17","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"^0.3.0-unstable.25","@sphereon/pex":"2.0.0-unstable.12","@sphereon/ssi-sdk-core":"^0.9.1-unstable.17+9f929cb","@sphereon/ssi-sdk-did-utils":"^0.9.1-unstable.17+9f929cb","@sphereon/ssi-types":"^0.9.1-unstable.17+9f929cb","@sphereon/wellknown-dids-client":"^0.1.3","@types/uuid":"^9.0.1","@veramo/core":"4.2.0","@veramo/credential-w3c":"4.2.0","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.6.0","@veramo/cli":"4.2.0","@veramo/did-provider-key":"4.2.0","@veramo/did-resolver":"4.2.0","@veramo/utils":"4.2.0","did-resolver":"^4.0.1","nock":"^13.2.1","typescript":"^4.6.4"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"9f929cb88baf569a1b51d699d1cd2456c5d03255","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authorization request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst authorizationRequest = await agent.getSiopAuthorizationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authorization request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationRequestDetailsResponse = await agent.getSiopAuthorizationRequestDetails({\n  sessionId,\n  verifiedAuthorizationRequest: createAuthorizationResponse,\n})\n```\n\n### Verify authorization request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthorizationResponse = await agent.verifySiopAuthorizationRequestURI({\n  sessionId,\n  requestURI: createAuthorizationResponse,\n})\n```\n\n### Send authorization response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationResponse = await agent.sendSiopAuthorizationResponse({\n  sessionId,\n  verifiedAuthorizationRequest: verifiedAuthorizationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.9.1-unstable.17","_nodeVersion":"16.19.1","_npmVersion":"lerna/6.5.1/node@v16.19.1+x64 (linux)","dist":{"integrity":"sha512-OhgQagWFhkjqgyxMJatzzLnm9xoYOffVQjwRFcL56ygMiWkEZoIx8nsVURBEHjL/DteTb5f8DCghpejuqAYY6Q==","shasum":"09c94f053bc68729df32342544aedb48e9ad8652","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.9.1-unstable.17.tgz","fileCount":34,"unpackedSize":140107,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDq+1nwSdGqEsPizr6Ss0Jk3vSetTAFbTzEa7jBh3A58AIhAPOuDsMfZRp46gFu055hEEfK2sXZ4a800wYVgAkiTGLl"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkCwYHACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoHNBAAnVFLc1TzXs94BRA+5K5RNcU9Q/i15zYkH5qvdc82tTKKKpIn\r\nDH72nbd+KFVIUw6C4O7bJSAaIu+0NsVX74F69axYIEyfPtw0fzdyPyTe3msO\r\nDOXoSajnn9j9NfSPbchn6CfGGxGNqndGt3P0HtT2w6kYJAY4LBac2ZvfXFWy\r\nBPFRu4mn2iJW2ktxDG52jY3RiDgM3mI1bOLhhI0Jo9ckICXCxlVVNgMWbKXr\r\nx9VMmcs3/Q1ZTEmF0kuOLtPYcZthL7lW2qkZk51mm5fpRghkCk2XVtSpqSW4\r\nxv48aaJD9HUIKHfNwdKRyK0t4ggQ7iEvAJbHEm6yZdRvJL3lL4J8+XrJuKJM\r\nJlq+i6M9bU1aHBMZtaUqKd6/uJ0qwc1qTW4qwIO3zAworpZFHXWtckwmQDU7\r\nSFlU1sEE5hJHx9i2c0dQ++a8HxPmG4AdgmlxGoIL9y0aKyolsS1vr44DBjKq\r\nc88W9gWdtEfwPEPMhk5VBsvVlDtc0yYz6waFlNTjL2I399fpsVSSOHyZ0JXt\r\nrSuCl19xjGqwJYEnSwDf1sPHJx2Z05hSDnxCvrImD/0g4ROeBQAD+1jBukQu\r\nArZEqANuPhZ/gxDxlPAAs9IJmtpOVKGP2UuA7fi5JUb1aYsbas6MCqrjurr2\r\nrWjpraeNVcgHX3+fjY3Lg/5Nk0NdKLZPuK0=\r\n=WHRX\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.9.1-unstable.17_1678444039086_0.7072581232592359"},"_hasShrinkwrap":false},"0.9.1-next.10":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.9.1-next.10","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"^0.3.0-unstable.25","@sphereon/pex":"2.0.0-unstable.12","@sphereon/ssi-sdk-core":"^0.9.1-next.10+84c08f1","@sphereon/ssi-sdk-did-utils":"^0.9.1-next.10+84c08f1","@sphereon/ssi-types":"^0.9.1-next.10+84c08f1","@sphereon/wellknown-dids-client":"^0.1.3","@types/uuid":"^9.0.1","@veramo/core":"4.2.0","@veramo/credential-w3c":"4.2.0","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.6.0","@veramo/cli":"4.2.0","@veramo/did-provider-key":"4.2.0","@veramo/did-resolver":"4.2.0","@veramo/utils":"4.2.0","did-resolver":"^4.0.1","nock":"^13.2.1","typescript":"^4.6.4"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"84c08f19f2d40ba7aef0c3b5642c99fe857a2d84","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authorization request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst authorizationRequest = await agent.getSiopAuthorizationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authorization request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationRequestDetailsResponse = await agent.getSiopAuthorizationRequestDetails({\n  sessionId,\n  verifiedAuthorizationRequest: createAuthorizationResponse,\n})\n```\n\n### Verify authorization request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthorizationResponse = await agent.verifySiopAuthorizationRequestURI({\n  sessionId,\n  requestURI: createAuthorizationResponse,\n})\n```\n\n### Send authorization response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationResponse = await agent.sendSiopAuthorizationResponse({\n  sessionId,\n  verifiedAuthorizationRequest: verifiedAuthorizationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.9.1-next.10","_nodeVersion":"16.19.1","_npmVersion":"lerna/6.5.1/node@v16.19.1+x64 (linux)","dist":{"integrity":"sha512-Vmb/jDswjn3zRx+uZFz99sHCCY7SsNZKUsK9fFgl0p83F4/1D9QbpYoVX//DuEZmSA4ETO8J6UDO73CunpKLpg==","shasum":"a3258d7515062f99720f2872c78890fff85c4204","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.9.1-next.10.tgz","fileCount":34,"unpackedSize":140095,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFT37BgLsk10slCqt9Lzanqb8+2Epnqx2DrGqYbxBKI9AiEAyOHWm2FIfExiVBKXNNzJ/w/gjq0jPXvGMlDPsHawX6k="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkC8W7ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqeCA//ciLMtxnZzKruzeZ+KJeRL/RBnqkCS9Bnck7m/NoM1R/r8WDS\r\nxzWF1KHyH9zZ1hKUbGB8HSSl8J18snn3QBOry7SIbMUHYFbdW76VvEZ/7hJg\r\nLUV8qgmZcOT692dW/p77IwPQ9tBQpqm+7trvznzQib6Md1oxUHXzzSfiS725\r\n9y8aJpqGhh9cUKZwkF5ZQYQdejrqFrOK9plzT6QY87yJKkQGhumMcVBzLQgh\r\nqPABYRsWqTqZkMzbTz1fMqxVm8pqCvp6LxTIQ+g+vzl1Fq7kL0LZCZ7vQP8V\r\nPkkh+MhRVxUr8Z+nR40YFs48WRduqWfefAOIexHANkAI2zeBorvgZhQzEnBs\r\nLaKG05pgovLqAA9/5VjR4B6aApTv/UkGTA+SDGCaNPT3lNZekyr18VZLipn+\r\n9JgZBzllTz0R+4piocAls3lM8lBDvLfeuZlL8VzZ/1rYNYO1CGYhznSmU89N\r\nFkLXiwCnxN6Ak0YVC3o2OA2pTnet4AAtho7FLQayYpwt9iEUYg1oJ37175HG\r\nTrLBOC6A4xv/YDYsUNpSFOhoZm8HcjzbmdKq+bOeS2N7zQFMHW7CHPcEJDDa\r\n5R17/Q4NzeI5UnefIxACpWvabjf117Ng0x5GwUcovLOo762MbrGmE2LhdEp/\r\nsUnahQcfjO9UGR5zcNxLkTnS7cPUbZPNb2M=\r\n=mgKn\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.9.1-next.10_1678493115593_0.24222348816196648"},"_hasShrinkwrap":false},"0.9.1-next.11":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.9.1-next.11","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"^0.3.0-unstable.25","@sphereon/pex":"2.0.0-unstable.12","@sphereon/ssi-sdk-core":"^0.9.1-next.11+0cc08b6","@sphereon/ssi-sdk-did-utils":"^0.9.1-next.11+0cc08b6","@sphereon/ssi-types":"^0.9.1-next.11+0cc08b6","@sphereon/wellknown-dids-client":"^0.1.3","@types/uuid":"^9.0.1","@veramo/core":"4.2.0","@veramo/credential-w3c":"4.2.0","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.6.0","@veramo/cli":"4.2.0","@veramo/did-provider-key":"4.2.0","@veramo/did-resolver":"4.2.0","@veramo/utils":"4.2.0","did-resolver":"^4.1.0","nock":"^13.2.1"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"0cc08b6acc168b838bff48b42fdabbdea4cd0899","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authorization request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst authorizationRequest = await agent.getSiopAuthorizationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authorization request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationRequestDetailsResponse = await agent.getSiopAuthorizationRequestDetails({\n  sessionId,\n  verifiedAuthorizationRequest: createAuthorizationResponse,\n})\n```\n\n### Verify authorization request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthorizationResponse = await agent.verifySiopAuthorizationRequestURI({\n  sessionId,\n  requestURI: createAuthorizationResponse,\n})\n```\n\n### Send authorization response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationResponse = await agent.sendSiopAuthorizationResponse({\n  sessionId,\n  verifiedAuthorizationRequest: verifiedAuthorizationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.9.1-next.11","_nodeVersion":"16.19.1","_npmVersion":"lerna/6.5.1/node@v16.19.1+x64 (linux)","dist":{"integrity":"sha512-cL6To+UJZ4VCsiWmUt+mWkoP8UTais9FZ02BV60QkKETKT37Z+p5F/rxhy7EuAM/Naf7Aqzb2QMJWaAO6jkcJQ==","shasum":"f0f0cda85a990bdf13888bc52ae4fa5ad941411a","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.9.1-next.11.tgz","fileCount":34,"unpackedSize":140067,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDQ/i+/xO4Pe71P0SwZnrxCFH/9JvGE8jLR2lzm9IWFnQIhAKws2RZR/DKxFVFnLshYlcMxHqBAcEkDxCU2B4hspGDn"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkC8xfACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmqc2BAAkNEla+Vk4cpHFql1bDSd0Y9DEUzEyPXnaYiGUiNQvKN7G/gW\r\n401yWCPPeLBT7d+f8YvYqW3/tc53gTd7edKX7bQEa4kB/0U43RHhmArNSRYo\r\nmhbSIXjqFUBRybv2iYM+Zf5DmrGAUXdzMd936m16GVMGwSx0f4xck07icCgj\r\nP0ynfSlr6Ktd76G1/jiR+xdpRJDQ77k4sro0s0/FQ+zbh/wlyHCiPRN4bFjV\r\nI8XghCESmpSIVnccmXP3zEVB6qnzBM+WxVP/t+lthd+wpVnJ83m+mccYkv0Q\r\nvew24WyUj3T5u1Uf6zWFroekA8d67TjJSp1JovAeviwxnKhYtjYJU5nV0Nyf\r\nvKVBgfQahALkuherHtBXFG7QP25rH9SF9f/Cxk+PHjA5FvfvqlLu6CqWuKeg\r\nl9Wxq5RNIONdosBwIWMfK//8qkS45qwQ2H875uAFfazu8rrjURCx/psUPLzX\r\nbjpD56f37e3GhyPLZq2NbTqISsEk+XrmvMYByaH0X9m0Gzk/wfJzHABt70ms\r\n9Zxz9VtlsY249+CuLawcmATrTduXEpX1dZrPmUDM290cJW+dyd6imEzQO8wM\r\nm+2o5DSkV8vtXBAXM/P08qV2lRqKmj+B2iKLMPAmu+gdPx4+WDaKlJIRLIGz\r\n5JwLKxjlPm2CbiLzKkdf7gWcS8PLAmlbkig=\r\n=0kFd\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.9.1-next.11_1678494815420_0.25725498380034373"},"_hasShrinkwrap":false},"0.9.1-next.12":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.9.1-next.12","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"^0.3.0-unstable.25","@sphereon/pex":"2.0.0-unstable.12","@sphereon/ssi-sdk-core":"^0.9.1-next.12+aca017b","@sphereon/ssi-sdk-did-utils":"^0.9.1-next.12+aca017b","@sphereon/ssi-types":"^0.9.1-next.12+aca017b","@sphereon/wellknown-dids-client":"^0.1.3","@types/uuid":"^9.0.1","@veramo/core":"4.2.0","@veramo/credential-w3c":"4.2.0","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.6.0","@veramo/cli":"4.2.0","@veramo/did-provider-key":"4.2.0","@veramo/did-resolver":"4.2.0","@veramo/utils":"4.2.0","did-resolver":"^4.1.0","nock":"^13.2.1"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"aca017b322fa302461d7a8482f4814c7fe1b0f9d","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authorization request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst authorizationRequest = await agent.getSiopAuthorizationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authorization request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationRequestDetailsResponse = await agent.getSiopAuthorizationRequestDetails({\n  sessionId,\n  verifiedAuthorizationRequest: createAuthorizationResponse,\n})\n```\n\n### Verify authorization request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthorizationResponse = await agent.verifySiopAuthorizationRequestURI({\n  sessionId,\n  requestURI: createAuthorizationResponse,\n})\n```\n\n### Send authorization response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationResponse = await agent.sendSiopAuthorizationResponse({\n  sessionId,\n  verifiedAuthorizationRequest: verifiedAuthorizationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.9.1-next.12","_nodeVersion":"16.19.1","_npmVersion":"lerna/6.5.1/node@v16.19.1+x64 (linux)","dist":{"integrity":"sha512-v73b+0C1Btq6dgZFHxNNuE3mjrKhdF8AfAS5mQvO5qOlAi7n+/4WyXbKhWwDo2j8XZ815dfx+/+mPOye/IAgDQ==","shasum":"a1e0757ba1652c4d81f1907f568498edbbf4ea8d","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.9.1-next.12.tgz","fileCount":34,"unpackedSize":140067,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDeONY3tttdohEBwjhEK0b62Lm0dWAfSyxUiPAOsLDvVwIgezKOf1GJzhN7Ejp295EzIjBJJqIsh3r8oOjxHLnut0w="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkC9UWACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr9GQ//TTyGvUNSocJBYVd08dHqKG5bRYiROA1w+kF+qVwhamio7LDg\r\noujjd7/0Aei95HzKyCgoeO1wxXSiy6LthSd23S73Gn/91LxVgF6jrvHeHsvu\r\nuXbFABmPwk3aHe5EhKIWYFzM7XQUWGvGDy5CnQwimQLlKDQ1C8z5+GEroVtk\r\nsufYup3UT9qQnLWFh9QoYumAt4mY9tzk7momWy4zqhM2qUNGerKvjAaF+2ug\r\ntCDZdHeXGgAJck2Cs6MaWTibS17Azodf5me6cU3MxkbJRx++w/kZyXrmDB11\r\nYwR5WvJa7UiopMQscReeIZvB5R2R60b4Pow58CQBiS8mCSS2wvOWkbnXiC2A\r\nGnWDFVOYAFZl3NhUOp+OuInuAe/+d9WkJ4cL88xdr8YNQEHPh7VjvVz5RBHd\r\ngjQPJkhcmYNXSRt1SoLytEfb+YtFB5EckGe/sivoo6EQY5+2MpiGUD4N47W7\r\nyW96zLRDpXMM0UFDe2imh7LVVGQnC+/lw7brkd9Tmu9c06i5ngVVr3usRUdZ\r\nIhqInteD001AaszV8x2phZoYSeIxQ6r/Y/PB1FdkTblxPH7svmeMcRBc3WJe\r\nF+3+aR29Nnex4y5izIo4GJGB+FyaReyTxy3ptM8RJTtW49sjGBKMR2R08Ys4\r\n/NC57J9285XiwNdxlbIifG/YRSo3vQDAeCc=\r\n=/nJ5\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.9.1-next.12_1678497046205_0.623705247467029"},"_hasShrinkwrap":false},"0.9.1-next.13":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.9.1-next.13","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"^0.3.0-unstable.25","@sphereon/pex":"2.0.0-unstable.12","@sphereon/ssi-sdk-core":"^0.9.1-next.13+e7dbf55","@sphereon/ssi-sdk-did-utils":"^0.9.1-next.13+e7dbf55","@sphereon/ssi-types":"^0.9.1-next.13+e7dbf55","@sphereon/wellknown-dids-client":"^0.1.3","@types/uuid":"^9.0.1","@veramo/core":"4.2.0","@veramo/credential-w3c":"4.2.0","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.6.0","@veramo/cli":"4.2.0","@veramo/did-provider-key":"4.2.0","@veramo/did-resolver":"4.2.0","@veramo/utils":"4.2.0","did-resolver":"^4.1.0","nock":"^13.2.1"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"e7dbf550b1cabadabb8f1617cec252ea6f692225","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authorization request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst authorizationRequest = await agent.getSiopAuthorizationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authorization request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationRequestDetailsResponse = await agent.getSiopAuthorizationRequestDetails({\n  sessionId,\n  verifiedAuthorizationRequest: createAuthorizationResponse,\n})\n```\n\n### Verify authorization request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthorizationResponse = await agent.verifySiopAuthorizationRequestURI({\n  sessionId,\n  requestURI: createAuthorizationResponse,\n})\n```\n\n### Send authorization response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationResponse = await agent.sendSiopAuthorizationResponse({\n  sessionId,\n  verifiedAuthorizationRequest: verifiedAuthorizationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.9.1-next.13","_nodeVersion":"16.19.1","_npmVersion":"lerna/6.5.1/node@v16.19.1+x64 (linux)","dist":{"integrity":"sha512-I6mlgjwlgnWdDZ7ftY3WKC1AC7AMdS0iSt3XgkjeLKnW9q3cJW6yZWmwfhjz7xBJwitMnTDcu3zFLIDneiImLQ==","shasum":"0c5c79b0198a610615205d84d2b73724fbfa136a","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.9.1-next.13.tgz","fileCount":34,"unpackedSize":140067,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCt5WEpv/cCNd/kXJ643Q1usXZxtN2EIEtyvuHvmwLcNgIgHHSE9JAJUrJZwUcQYFiM52BfZ+pRnX4H8xtAvjMsTck="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkC/sFACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqcMQ//UHT1wCRc3NLptgalZiKRf3i2LJorK8UDbCnTgoSPavcDbE0U\r\ntg3KNgDfPMYgav6qnL5Cp/srB+w3agTUeO27Xd8eATLwRNsAf8ywI9sFWtIP\r\neu3glvfPeuByDA9RSuzkYUrAHgPjwoustjkSPc91eGXT+on5OdepBMYHl7Ig\r\nCb4625mXXCGzZzT+7xK8qUG0H+b9fJmnHRGcbedKEEZc3eMxpG0fjHr/LtmS\r\neKJfd9Nz6UuBGIhIXUgzSiUjFRDCb316EyN7vNXKDNQX9KMVG50xlsZBWPBF\r\nOUSLi+q6lKu0t00wIU9towxiKog5wAZJ4C8p2vxwbb5wTJ4WuLf0bjAF8po7\r\nlD5MzNegKnATzEaM/cDKbsbBkG4pt0LXVNe2DudMdvgjFF+wV8VsYqBQS2Of\r\nuAAxZDkJMdM0SfDDKunjeTVQcad4NIZvruZ8Ch0ZJTHoUVdWanVuZXh5ABz2\r\npJa5QCUsSPA/LFwItmLgsFyzIK/h1luGoZMKa62d8BDImm/vJbE6RAE4FdL5\r\neMplHZL61mfnlqcz7C7gpD9OnbH8uqXUzLU7eVBxf6OmNSyLwFNSn6udiId3\r\nxUqut1MVSpRu83HJ0vr3ACGq9CEWKF4HOWi29HhtOy1BWgA7pwUrrZFEIOnw\r\npo+oVvVPnj4JwycqQiAJP91t5snaggZjjHs=\r\n=rcQK\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.9.1-next.13_1678506756875_0.01639785135500138"},"_hasShrinkwrap":false},"0.9.1-next.15":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.9.1-next.15","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"^0.3.0-unstable.25","@sphereon/pex":"2.0.0-unstable.12","@sphereon/ssi-sdk-core":"^0.9.1-next.15+d2b89c2","@sphereon/ssi-sdk-did-utils":"^0.9.1-next.15+d2b89c2","@sphereon/ssi-types":"^0.9.1-next.15+d2b89c2","@sphereon/wellknown-dids-client":"^0.1.3","@types/uuid":"^9.0.1","@veramo/core":"4.2.0","@veramo/credential-w3c":"4.2.0","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.6.0","@veramo/cli":"4.2.0","@veramo/did-provider-key":"4.2.0","@veramo/did-resolver":"4.2.0","@veramo/utils":"4.2.0","did-resolver":"^4.1.0","nock":"^13.2.1"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"d2b89c2bcec9187b81621dca670b0884031cccc8","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authorization request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst authorizationRequest = await agent.getSiopAuthorizationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authorization request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationRequestDetailsResponse = await agent.getSiopAuthorizationRequestDetails({\n  sessionId,\n  verifiedAuthorizationRequest: createAuthorizationResponse,\n})\n```\n\n### Verify authorization request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthorizationResponse = await agent.verifySiopAuthorizationRequestURI({\n  sessionId,\n  requestURI: createAuthorizationResponse,\n})\n```\n\n### Send authorization response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationResponse = await agent.sendSiopAuthorizationResponse({\n  sessionId,\n  verifiedAuthorizationRequest: verifiedAuthorizationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.9.1-next.15","_nodeVersion":"16.19.1","_npmVersion":"lerna/6.5.1/node@v16.19.1+x64 (linux)","dist":{"integrity":"sha512-9rvx2G0xUgDOq18wumttRpNeNNG6ZVU+F+xPm227NHh9Ja0dGytAODvEqkWmnIMM8/yAoiphIwxs6sGSgBtFNA==","shasum":"775a8f813c274652ff08dfb44c84b20fcc543d9f","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.9.1-next.15.tgz","fileCount":34,"unpackedSize":140067,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEzw6JVEkbwTchXJOKJWeV7gIeOueLwnI6MIUTBzepfJAiEA60DwWPTy6dchtyRBHh4Yfpc5VG9CVvEaLu70sLQds3s="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkDRLzACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpRGg//QtrE97ECv3hfDXFlBcKaqItOo7RF+EjXmpWrm0mXusuLxa1h\r\n1veWdPSnZPld5tKPjUxBli2EwdUfn7DVit7UyOpl7ifEl7WQ05P0H772XwNn\r\nuzFrizjWjocP1v+22DEWOk+BGeQIBVd6mbsV0bE7D0e0/A3bx5V0GBixpuDz\r\nMPJoswfJBkcaAfljXIcVdZhCFBJ0zzVQFwg/EbskVICcJKM0vldbSZ8JVY5I\r\n6ytV0zK8Un8qTouquLA5zzioVzpslk4dmHNpuCUX5EBv+hFo4zuTMdTXhW6G\r\nbxWMJHmWtPMytwHqb52qXeF7i+wd4oHEO6PhpSYZKFv80qsQMBNIqUubaAeU\r\nJL+gHHRTX7PUFkcWxJKGuyB2SPwGUVtvaiwXZOjHhWhByf3HRs8ZSxKVLqWp\r\nb05N14rwzxA2tcv7i4agja9nTlAoOjapL32N4HS+UYYz7IdXL62AYTEzkwUM\r\nFKFX7UwVg14uqgBrLqBuhv088eS/JL8IwhiWKuAX4lwNRFhCxKSNJsjMg8Ic\r\nUXoikmsN0k9PK7k0QWj5tTwjuuNUtkXvXgJlV1Zov8/dWOeyNb4mGHKztzkz\r\n6yNFDgPdymuBxxPv5TU5r2h+V6tzTOv0hO8FC7dmeY8gQAmpL41Q9seEisHC\r\nRPohMoKqSXCNK8QbLfdpWC+WwG1ezOz87Mg=\r\n=36El\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.9.1-next.15_1678578418998_0.10224642064159783"},"_hasShrinkwrap":false},"0.9.1-next.16":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.9.1-next.16","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"^0.3.0-unstable.25","@sphereon/pex":"2.0.0-unstable.12","@sphereon/ssi-sdk-core":"^0.9.1-next.16+1907345","@sphereon/ssi-sdk-did-utils":"^0.9.1-next.16+1907345","@sphereon/ssi-types":"^0.9.1-next.16+1907345","@sphereon/wellknown-dids-client":"^0.1.3","@types/uuid":"^9.0.1","@veramo/core":"4.2.0","@veramo/credential-w3c":"4.2.0","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.6.0","@veramo/cli":"4.2.0","@veramo/did-provider-key":"4.2.0","@veramo/did-resolver":"4.2.0","@veramo/utils":"4.2.0","did-resolver":"^4.1.0","nock":"^13.2.1"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"1907345725090a90ae9b96104114f33bc4ed8250","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authorization request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst authorizationRequest = await agent.getSiopAuthorizationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authorization request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationRequestDetailsResponse = await agent.getSiopAuthorizationRequestDetails({\n  sessionId,\n  verifiedAuthorizationRequest: createAuthorizationResponse,\n})\n```\n\n### Verify authorization request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthorizationResponse = await agent.verifySiopAuthorizationRequestURI({\n  sessionId,\n  requestURI: createAuthorizationResponse,\n})\n```\n\n### Send authorization response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationResponse = await agent.sendSiopAuthorizationResponse({\n  sessionId,\n  verifiedAuthorizationRequest: verifiedAuthorizationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.9.1-next.16","_nodeVersion":"16.19.1","_npmVersion":"lerna/6.5.1/node@v16.19.1+x64 (linux)","dist":{"integrity":"sha512-WJJwVNZ7OZZWX4cFWkLc772LK9nb1brEWaU2xT4/7PwxrVZR1l8wpFivYpA7r98PS851a6qFohPiypYeWxQbYA==","shasum":"1de48745255f274451a540876408348031868734","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.9.1-next.16.tgz","fileCount":34,"unpackedSize":140067,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDCiRtNmJw0OaFpGwuMc9cA3how0qtdOgaU6POLsdJ2RAIhAIzq5I0uH38B3qn9aq9GvqgnLhgImt/WYOrT0yqcWlhF"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkDWHXACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr9lQ/+Nb6F/gJxdaVgRTeI80muk2HvOw6Vi0Jk5xOoB+37tD17IFmQ\r\nyyrs2pv8Qgj/ONs+FIDHYluU8gN3Qo0GSdasru2QUYXMb5mRdut3wen72Xxo\r\nj0sWg4/zNl3wSmPJKh3aPEj6IKbfBed3CjvYVjTEHmZX0mWqVG6mCUnpufIq\r\nEscNphROpvv/0dyaN9Vm27XDqlz/Xy05H5MwLEjynWdd3ul5NkTMn17DovsE\r\nequoObzc0JNfOfTk9HCWKk9StsBroREePCBcn/9SgrvQ0CPp6FE6L4JtdOW6\r\nSi5peih3zrkEOXE/yYgcw1bIF3dPiVpImBCZmXh9zCxeqU+Hoix/iSxRHUTl\r\nyTPvIpLWqnBjqACccW7OaJGz+wDeSncYH5ltRQevgBThV7bV6PK4tS9Z90P0\r\npQ5zv0AzZc+qAtqN230j4VPb7whXKgyHz5muh1Jhb6RCLQAq6Ij01L4gVtiP\r\nVHRO/EKY8IMfWyYHATLO9t0ETx90W4NJSC7EoYeEMT6oZ8S8hpKc8I3cO+yh\r\nGvpL0WGKdDcBzL6AjImtHZAj5233Q5WTeGtwYpLjodfjk3PLLpujBidS6E7M\r\nNTzHuupyt25hJpTy98nWf49mkzIHNaltquMRjVBseGuSQ51ft3f7ddG/Sf87\r\nTeVWBmKRlBaaHjSvUQZn252OjgGtd1JIXSQ=\r\n=UuQx\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.9.1-next.16_1678598615155_0.17869689992335314"},"_hasShrinkwrap":false},"0.9.1-next.17":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.9.1-next.17","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"^0.3.0-unstable.25","@sphereon/pex":"2.0.0-unstable.12","@sphereon/ssi-sdk-core":"^0.9.1-next.17+63e059b","@sphereon/ssi-sdk-did-utils":"^0.9.1-next.17+63e059b","@sphereon/ssi-types":"^0.9.1-next.17+63e059b","@sphereon/wellknown-dids-client":"^0.1.3","@types/uuid":"^9.0.1","@veramo/core":"4.2.0","@veramo/credential-w3c":"4.2.0","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.6.0","@veramo/cli":"4.2.0","@veramo/did-provider-key":"4.2.0","@veramo/did-resolver":"4.2.0","@veramo/utils":"4.2.0","did-resolver":"^4.1.0","nock":"^13.2.1"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"63e059b0460ae40e6d31a5ed0f0707fbd99f75af","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authorization request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst authorizationRequest = await agent.getSiopAuthorizationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authorization request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationRequestDetailsResponse = await agent.getSiopAuthorizationRequestDetails({\n  sessionId,\n  verifiedAuthorizationRequest: createAuthorizationResponse,\n})\n```\n\n### Verify authorization request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthorizationResponse = await agent.verifySiopAuthorizationRequestURI({\n  sessionId,\n  requestURI: createAuthorizationResponse,\n})\n```\n\n### Send authorization response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationResponse = await agent.sendSiopAuthorizationResponse({\n  sessionId,\n  verifiedAuthorizationRequest: verifiedAuthorizationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.9.1-next.17","_nodeVersion":"16.19.1","_npmVersion":"lerna/6.5.1/node@v16.19.1+x64 (linux)","dist":{"integrity":"sha512-2VPfpmPBczC68kSPJM3lqIXd/e65ckwaHIMvpzcofkQrmhD5U91blL5qYWkCTqcCiwDXG/OB23+w6qcPfVSz5w==","shasum":"bb6d8873aff67eef42fb1e29bbd1d2c46a10dbcb","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.9.1-next.17.tgz","fileCount":34,"unpackedSize":140063,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIC0q9ukbs8Wpe6KblVCozF5dvUjqcv3ZQiyldSHWLO7sAiEAnXPLCK1f4LYaCS5Jf6R5wc+ESvTgQKtbl5iYEcvBnHA="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkDWnnACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmrmcg//fblXaO1dJPaTlDAJfTqCZPesAqFRoBQYM6ka7AJ2CIKQK5k7\r\nWy90Lx8I2DGOJ1KZtC9YixFr7xoETAUBRxMjP3znH0N3JDbwq0O8Q20Diysy\r\n1IpT0qT+wbcOQ2tAbs4ISWxpYN6+RFgdZxYUd4OzzVN7udiF4N6M/sQDH93i\r\nehtPKe2vzXPB8M5kz8kbHXVhimi4xeXdTZfL6+eByqSChRcU0OkD/pARfw3m\r\nl2dXbs7ptyfRHZlTQHfLgaHedtt9XRdybfuvAeRVbXJ5CxK2VybWIJ14J0wp\r\n77MLTfPhNzlJ4nIf5JLKgax0yoG7LPuh2qkgUyWISJlId6zzDW9ANeAFYdxw\r\ngFB3fuU+NnCLuQF31Eh6HnOH0Akzdik14pqG7XSfNNV6xJ4sZibIlgq77Vvo\r\nP8rPtPVLlztynbqjRFjF8nM9xyg9+Lcgv6JgMmprKT4BdlZC6iAhvwa64WiQ\r\nZ1do5AQtoSsj0AoA2/ZggSj9j5TCxAWyvYKev2Ba9GkvYY9fId3LXcFAbKsU\r\nkWCTG+/AJbWasY5kF1encYrJLZEj3CHzslRrk4HQvbGRHRQWKQ4aUTbdIut1\r\n0CkUl8tbDKT3wok3aXv4/r0qoTyKV5dGenqPYcXCxGrV3nS5mGqn7YiT1uuV\r\n5OlhB3LJQTxKFmjCAWpCkcmgVYniLVedEdU=\r\n=ok/F\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.9.1-next.17_1678600679538_0.5452291698800436"},"_hasShrinkwrap":false},"0.9.1-unstable.27":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.9.1-unstable.27","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"^0.3.0-unstable.25","@sphereon/pex":"2.0.0-unstable.12","@sphereon/ssi-sdk-core":"^0.9.1-unstable.27+f588994","@sphereon/ssi-sdk-did-utils":"^0.9.1-unstable.27+f588994","@sphereon/ssi-types":"^0.9.1-unstable.27+f588994","@sphereon/wellknown-dids-client":"^0.1.3","@types/uuid":"^9.0.1","@veramo/core":"4.2.0","@veramo/credential-w3c":"4.2.0","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.6.0","@veramo/cli":"4.2.0","@veramo/did-provider-key":"4.2.0","@veramo/did-resolver":"4.2.0","@veramo/utils":"4.2.0","did-resolver":"^4.1.0","nock":"^13.2.1"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"f588994f2aad4f6e7554a3449df78a0816ee063a","readme":"<!--suppress HtmlDeprecatedAttribute -->\r\n<h1 align=\"center\">\r\n  <br>\r\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\r\n  <br>DID Auth SIOP OP Authenticator (Typescript) \r\n  <br>\r\n</h1>\r\n\r\n---\r\n\r\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\r\n\r\n---\r\n\r\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\r\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\r\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\r\nas specified in the OpenID Connect working group.\r\n\r\n## Self Issued OpenID Provider v2 (SIOP)\r\n\r\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\r\n\r\n## Requirements\r\n\r\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\r\n\r\n## Available functions\r\n\r\n- getSessionForSiop\r\n- registerSessionForSiop\r\n- removeSessionForSiop\r\n- registerCustomApprovalForSiop\r\n- removeCustomApprovalForSiop\r\n- authenticateWithSiop\r\n- getSiopAuthorizationRequestFromRP\r\n- getSiopAuthorizationRequestDetails\r\n- verifySiopAuthorizationRequestURI\r\n- sendSiopAuthorizationResponse\r\n\r\nThe following functions can also be used on the session object without the need of a session id first.\r\n\r\n- authenticateWithSiop\r\n- getSiopAuthorizationRequestFromRP\r\n- getSiopAuthorizationRequestDetails\r\n- verifySiopAuthorizationRequestURI\r\n- sendSiopAuthorizationResponse\r\n\r\n## Usage\r\n\r\n### Adding the plugin to an agent:\r\n\r\n```typescript\r\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\r\nimport { Resolver } from 'did-resolver'\r\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\r\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\r\nimport { getUniResolver } from '@sphereon/did-uni-client'\r\n\r\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\r\n  plugins: [\r\n    new DidAuthSiopOpAuthenticator(),\r\n    new DIDResolverPlugin({\r\n      resolver: new Resolver({\r\n        ...getDidKeyResolver(),\r\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\r\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\r\n      }),\r\n    }),\r\n  ],\r\n})\r\n```\r\n\r\n### Get an OP session:\r\n\r\n```typescript\r\nconst sessionId = 'example_session_id'\r\nconst opSession = await agent.getSessionForSiop({\r\n  sessionId,\r\n})\r\n```\r\n\r\n### Register an OP session:\r\n\r\n```typescript\r\nconst sessionId = 'example_session_id'\r\nconst identifier = {\r\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\r\n  provider: 'example_provider',\r\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\r\n  keys: [\r\n    {\r\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\r\n      kms: 'example_kms',\r\n      type: 'Ed25519' as const,\r\n      publicKeyHex: '1e21e21e...',\r\n      privateKeyHex: 'elfcvtswdbn...',\r\n    },\r\n  ],\r\n  services: [],\r\n}\r\n\r\nconst opSession = await agent.registerSessionForSiop({\r\n  sessionId,\r\n  identifier,\r\n})\r\n```\r\n\r\n### Remove an OP session:\r\n\r\n```typescript\r\nconst sessionId = 'example_session_id'\r\nconst opSession = await agent.removeSessionForSiop({\r\n  sessionId,\r\n})\r\n```\r\n\r\n### Authenticate with DID auth SIOP:\r\n\r\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\r\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\r\n\r\nThese custom approval functions can also be provided at agent creation.\r\n\r\n```typescript\r\nawait agent.registerCustomApprovalForSiop({\r\n  key: 'example_key',\r\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => Promise.resolve(),\r\n})\r\n```\r\n\r\n```typescript\r\nconst sessionId = 'example_session_id'\r\nconst stateId = 'example_state_id'\r\nconst redirectUrl = 'https://example.com'\r\nconst customApprovalKey = 'example_key'\r\nconst authenticationResponse = await agent.authenticateWithSiop({\r\n  sessionId,\r\n  stateId,\r\n  redirectUrl,\r\n  customApproval: customApprovalKey,\r\n})\r\n```\r\n\r\n```typescript\r\nconst authenticationResponse = await agent.authenticateWithSiop({\r\n  sessionId,\r\n  stateId,\r\n  redirectUrl,\r\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => {\r\n    return Promise.resolve()\r\n  },\r\n})\r\n```\r\n\r\n### Get authorization request from the relying party:\r\n\r\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\r\n\r\n```typescript\r\nconst sessionId = 'example_session_id'\r\nconst stateId = 'example_state_id'\r\nconst redirectUrl = 'https://example.com'\r\nconst authorizationRequest = await agent.getSiopAuthorizationRequestFromRP({\r\n  sessionId,\r\n  stateId,\r\n  redirectUrl,\r\n})\r\n```\r\n\r\n### Get authorization request details:\r\n\r\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\r\n\r\n```typescript\r\nconst sessionId = 'example_session_id'\r\nconst authorizationRequestDetailsResponse = await agent.getSiopAuthorizationRequestDetails({\r\n  sessionId,\r\n  verifiedAuthorizationRequest: createAuthorizationResponse,\r\n})\r\n```\r\n\r\n### Verify authorization request URI:\r\n\r\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\r\n\r\n```typescript\r\nconst sessionId = 'example_session_id'\r\nconst verifiedAuthorizationResponse = await agent.verifySiopAuthorizationRequestURI({\r\n  sessionId,\r\n  requestURI: createAuthorizationResponse,\r\n})\r\n```\r\n\r\n### Send authorization response:\r\n\r\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\r\n\r\n```typescript\r\nconst sessionId = 'example_session_id'\r\nconst authorizationResponse = await agent.sendSiopAuthorizationResponse({\r\n  sessionId,\r\n  verifiedAuthorizationRequest: verifiedAuthorizationResponse,\r\n})\r\n```\r\n\r\n## Installation\r\n\r\n```shell\r\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\r\n```\r\n\r\n## Build\r\n\r\n```shell\r\nyarn build\r\n```\r\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute -->\r <h1 align=\"center\">\r   <br>\r   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\r   <br>DID Auth SIOP OP Authenticator (","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.9.1-unstable.27","_nodeVersion":"16.19.1","_npmVersion":"lerna/6.5.1/node@v16.19.1+x64 (linux)","dist":{"integrity":"sha512-P2MZLziF3h6CXp02FW+txct3P2kWkXS5s87cozMYyeBWdS6AQuL9Ld6sDDohH+VRHmZ5k9Vt47oqTpNBew46Rg==","shasum":"f9659defae5f580690ef395f658daa26499654ff","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.9.1-unstable.27.tgz","fileCount":34,"unpackedSize":139540,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDJqC2Hn2GFiVmeYv7eweKqeuUO0gLW7hpOy53SYOXbewIgC8BgzkG3klAfb0ZrLtDiBUyWmey/EdYpDAhbRhtzoCw="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkEc9wACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp8cBAAig6mgTn0w4cO79vAdaXK2D6PK3aaGchONQ4aIdy50tvhx1Yo\r\nPu00cOz/243HEMkfw9+QxCk3U2yr5r+QYOwt9lbENg2YZ43/TzFCzh2Vja1c\r\nEl1GnjpBEusE32tqNF7naiMfbtMx4hFDrUHck1zBV70kNohqtHGlHn4OHJtz\r\nPMcwA2Pu+n4CB9rsttm5G5AndLWngTBslWeRfDl6YXupm7DpQ1v4BSLhKi+Y\r\njLgXMIElnFB8lDfmBswM0u0S2tvmQdcPkRMdK/neSeSAV6dbc+MDFWJkh47y\r\np+3QGEOPVfPmbP1U3n7ltUDxntc++K/DNg0VzN3qELRp9h/BjpEABqB7EVAp\r\n7uif5iQfw3GUrafvI2NWYz8e4i8wtUYejNQWvFAE7+eC/CJ1+jdOpQ+D0Q7L\r\n+usw5kZtuB86LGlMI+ZUPi+AQpIK4aTGAY1NcddvLk1pC8lWbHcsqC7CXnI8\r\nlrIwfoV0t64v6IXEfr/tRWFb1iY153n0H0OdVOFGmyD8AHIh+MXx9GoNBzvq\r\no92IMHYOEIXs6bsO4UqTD+jKsn553f/+dpCyJzts+e+E3mKWEvGd5oyjJqHm\r\n65dJId6VhDWLLG9rMmINOD4NgekLyICI73l1qCWvkUZRueak1t8vkqZdcYcH\r\nyq5cVfUyWKC3NmR6B+FBqFWGU/j29x1s3/U=\r\n=vuji\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.9.1-unstable.27_1678888815830_0.6138102098515481"},"_hasShrinkwrap":false},"0.9.1-unstable.28":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.9.1-unstable.28","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"^0.3.0-unstable.25","@sphereon/pex":"2.0.0-unstable.12","@sphereon/ssi-sdk-core":"^0.9.1-unstable.28+9ec78ec","@sphereon/ssi-sdk-did-utils":"^0.9.1-unstable.28+9ec78ec","@sphereon/ssi-types":"^0.9.1-unstable.28+9ec78ec","@sphereon/wellknown-dids-client":"^0.1.3","@types/uuid":"^9.0.1","@veramo/core":"4.2.0","@veramo/credential-w3c":"4.2.0","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.6.0","@veramo/cli":"4.2.0","@veramo/did-provider-key":"4.2.0","@veramo/did-resolver":"4.2.0","@veramo/utils":"4.2.0","did-resolver":"^4.1.0","nock":"^13.2.1"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"9ec78ec4fba4ce80a35d1e9577aceb8adc10d726","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authorization request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst authorizationRequest = await agent.getSiopAuthorizationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authorization request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationRequestDetailsResponse = await agent.getSiopAuthorizationRequestDetails({\n  sessionId,\n  verifiedAuthorizationRequest: createAuthorizationResponse,\n})\n```\n\n### Verify authorization request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthorizationResponse = await agent.verifySiopAuthorizationRequestURI({\n  sessionId,\n  requestURI: createAuthorizationResponse,\n})\n```\n\n### Send authorization response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationResponse = await agent.sendSiopAuthorizationResponse({\n  sessionId,\n  verifiedAuthorizationRequest: verifiedAuthorizationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.9.1-unstable.28","_nodeVersion":"16.19.1","_npmVersion":"lerna/6.5.1/node@v16.19.1+x64 (linux)","dist":{"integrity":"sha512-IuDjE/Jj61nlzmHtF2QTl76u671oGXqJV7YUwjbXHgR2ams4G4w98AVuYUrba/4ZVtMJQrKx8XxdnLjmnxLDJw==","shasum":"61a94e06e41cc387ca1f19d9db82bc6b75b7e76c","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.9.1-unstable.28.tgz","fileCount":34,"unpackedSize":140079,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCjUJB/ktuIgwVp8q3WnXJps7rDNZpPFYDGORZWMVQd8gIhANJw2J73yLj7qYBGGHSEXrST5sikYg4J+kdf7SCuh4fO"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkEdVtACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoLdhAAoJ3lBpLHIQJJOTDK1Kg9nfVPzxG/QkeQKFM0BPqvQdwMwZzd\r\nbuPUjkWvTj0y8jGBwXdNTxRkritxyPCZBYtApgKAYuVylKUPo6RWsk+w7BW1\r\ndg09eQHyOA/xm4SKXJcfriN1RSAq5UMhctrHCCrzqCW1ALwd0/W2GzumcP5l\r\ne9aL+zf0fervFsSoZqiu3k3cH0AtrecvN6kOjidiSlZSqiUNRqHcdH7/wBBi\r\nfoRq/z20KqrJTL6Qo9A9vc2hYmLBnWIB1AuKbtgozhQTSMGzYBe+DOvAwnwA\r\nw6ZDxG5zi4FNbkgjMUx9le5Dza/PnzvfqehLkUCkBHsXVARc0SzkagAtSB2m\r\np2i2HbL7wJpB6C/jafmpjpsITBDq0sML8DpwfBZaDSnLvDKAeQ+5wvuGgPHf\r\nTElPPgjkvBIi+zfSRM88YdCBeqC3sbg15lcDK+CZzSIYHACEcbF2mGzHsCRY\r\nyb/ExIGO9xaN1Wc6w6itW6qDhYrn20oLLbN42RliOG4OX+BlkoJ2WKsHGPeM\r\nHzKfEuvdG89U3AA3OMOluYktI4U2HK+dIwEsihTKNSQf6pxZrkioDz3HtPNb\r\nAfo8k6bdDbXBmDuAEjo7OjvhT7xWo7BmtDK0JE0sYDwbpzOQ3JPBZ5CjPkWD\r\njMBkOi/+ExCPLzR6XpC+GoX+U/i12va7NTY=\r\n=0U9T\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.9.1-unstable.28_1678890349638_0.7291642771766842"},"_hasShrinkwrap":false},"0.9.1-unstable.30":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.9.1-unstable.30","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build --clean && tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"^0.3.0-unstable.25","@sphereon/pex":"2.0.0-unstable.12","@sphereon/ssi-sdk-core":"^0.9.1-unstable.30+f9e10f1","@sphereon/ssi-sdk-did-utils":"^0.9.1-unstable.30+f9e10f1","@sphereon/ssi-types":"^0.9.1-unstable.30+f9e10f1","@sphereon/wellknown-dids-client":"^0.1.3","@types/uuid":"^9.0.1","@veramo/core":"4.2.0","@veramo/credential-w3c":"4.2.0","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.6.0","@veramo/cli":"4.2.0","@veramo/did-provider-key":"4.2.0","@veramo/did-resolver":"4.2.0","@veramo/utils":"4.2.0","did-resolver":"^4.1.0","nock":"^13.2.1"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"f9e10f18b07a49ec535f88e87c93cd69f216d121","readme":"<!--suppress HtmlDeprecatedAttribute -->\r\n<h1 align=\"center\">\r\n  <br>\r\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\r\n  <br>DID Auth SIOP OP Authenticator (Typescript) \r\n  <br>\r\n</h1>\r\n\r\n---\r\n\r\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\r\n\r\n---\r\n\r\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\r\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\r\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\r\nas specified in the OpenID Connect working group.\r\n\r\n## Self Issued OpenID Provider v2 (SIOP)\r\n\r\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\r\n\r\n## Requirements\r\n\r\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\r\n\r\n## Available functions\r\n\r\n- getSessionForSiop\r\n- registerSessionForSiop\r\n- removeSessionForSiop\r\n- registerCustomApprovalForSiop\r\n- removeCustomApprovalForSiop\r\n- authenticateWithSiop\r\n- getSiopAuthorizationRequestFromRP\r\n- getSiopAuthorizationRequestDetails\r\n- verifySiopAuthorizationRequestURI\r\n- sendSiopAuthorizationResponse\r\n\r\nThe following functions can also be used on the session object without the need of a session id first.\r\n\r\n- authenticateWithSiop\r\n- getSiopAuthorizationRequestFromRP\r\n- getSiopAuthorizationRequestDetails\r\n- verifySiopAuthorizationRequestURI\r\n- sendSiopAuthorizationResponse\r\n\r\n## Usage\r\n\r\n### Adding the plugin to an agent:\r\n\r\n```typescript\r\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\r\nimport { Resolver } from 'did-resolver'\r\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\r\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\r\nimport { getUniResolver } from '@sphereon/did-uni-client'\r\n\r\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\r\n  plugins: [\r\n    new DidAuthSiopOpAuthenticator(),\r\n    new DIDResolverPlugin({\r\n      resolver: new Resolver({\r\n        ...getDidKeyResolver(),\r\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\r\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\r\n      }),\r\n    }),\r\n  ],\r\n})\r\n```\r\n\r\n### Get an OP session:\r\n\r\n```typescript\r\nconst sessionId = 'example_session_id'\r\nconst opSession = await agent.getSessionForSiop({\r\n  sessionId,\r\n})\r\n```\r\n\r\n### Register an OP session:\r\n\r\n```typescript\r\nconst sessionId = 'example_session_id'\r\nconst identifier = {\r\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\r\n  provider: 'example_provider',\r\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\r\n  keys: [\r\n    {\r\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\r\n      kms: 'example_kms',\r\n      type: 'Ed25519' as const,\r\n      publicKeyHex: '1e21e21e...',\r\n      privateKeyHex: 'elfcvtswdbn...',\r\n    },\r\n  ],\r\n  services: [],\r\n}\r\n\r\nconst opSession = await agent.registerSessionForSiop({\r\n  sessionId,\r\n  identifier,\r\n})\r\n```\r\n\r\n### Remove an OP session:\r\n\r\n```typescript\r\nconst sessionId = 'example_session_id'\r\nconst opSession = await agent.removeSessionForSiop({\r\n  sessionId,\r\n})\r\n```\r\n\r\n### Authenticate with DID auth SIOP:\r\n\r\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\r\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\r\n\r\nThese custom approval functions can also be provided at agent creation.\r\n\r\n```typescript\r\nawait agent.registerCustomApprovalForSiop({\r\n  key: 'example_key',\r\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => Promise.resolve(),\r\n})\r\n```\r\n\r\n```typescript\r\nconst sessionId = 'example_session_id'\r\nconst stateId = 'example_state_id'\r\nconst redirectUrl = 'https://example.com'\r\nconst customApprovalKey = 'example_key'\r\nconst authenticationResponse = await agent.authenticateWithSiop({\r\n  sessionId,\r\n  stateId,\r\n  redirectUrl,\r\n  customApproval: customApprovalKey,\r\n})\r\n```\r\n\r\n```typescript\r\nconst authenticationResponse = await agent.authenticateWithSiop({\r\n  sessionId,\r\n  stateId,\r\n  redirectUrl,\r\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => {\r\n    return Promise.resolve()\r\n  },\r\n})\r\n```\r\n\r\n### Get authorization request from the relying party:\r\n\r\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\r\n\r\n```typescript\r\nconst sessionId = 'example_session_id'\r\nconst stateId = 'example_state_id'\r\nconst redirectUrl = 'https://example.com'\r\nconst authorizationRequest = await agent.getSiopAuthorizationRequestFromRP({\r\n  sessionId,\r\n  stateId,\r\n  redirectUrl,\r\n})\r\n```\r\n\r\n### Get authorization request details:\r\n\r\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\r\n\r\n```typescript\r\nconst sessionId = 'example_session_id'\r\nconst authorizationRequestDetailsResponse = await agent.getSiopAuthorizationRequestDetails({\r\n  sessionId,\r\n  verifiedAuthorizationRequest: createAuthorizationResponse,\r\n})\r\n```\r\n\r\n### Verify authorization request URI:\r\n\r\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\r\n\r\n```typescript\r\nconst sessionId = 'example_session_id'\r\nconst verifiedAuthorizationResponse = await agent.verifySiopAuthorizationRequestURI({\r\n  sessionId,\r\n  requestURI: createAuthorizationResponse,\r\n})\r\n```\r\n\r\n### Send authorization response:\r\n\r\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\r\n\r\n```typescript\r\nconst sessionId = 'example_session_id'\r\nconst authorizationResponse = await agent.sendSiopAuthorizationResponse({\r\n  sessionId,\r\n  verifiedAuthorizationRequest: verifiedAuthorizationResponse,\r\n})\r\n```\r\n\r\n## Installation\r\n\r\n```shell\r\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\r\n```\r\n\r\n## Build\r\n\r\n```shell\r\nyarn build\r\n```\r\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute -->\r <h1 align=\"center\">\r   <br>\r   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\r   <br>DID Auth SIOP OP Authenticator (","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.9.1-unstable.30","_nodeVersion":"16.19.1","_npmVersion":"lerna/6.5.1/node@v16.19.1+x64 (linux)","dist":{"integrity":"sha512-4t+qpxOylIE1wBl1vMqx8eRWzGprWKEMFwjdVnZXWgfenNy1uTIgHGvXOILTuqCnuMgCF8dLCtfy8Lo8rqk52g==","shasum":"206ebfe82e13504ddc1900f8c44c84b44cdd0327","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.9.1-unstable.30.tgz","fileCount":34,"unpackedSize":140520,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIB/zT3bLRUJ3Q1qHWHNOM3fIJ9xMkRMXZ2X89sVEXjLCAiBJhjcMcXBXBrNn5Rhqck7mAEyESUi6X8/I64wIzeotMQ=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkEd2+ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrW6g/9HPjKTx7M0ulOHGsjJ0AqSSe9ZoXDH2FLJgzEjW7r02W7wm7c\r\n6PIZR8xopIjfZkUp7MG276kQjTCavbaN5DHAvMPt6ukL6RslzJ7ARKtUSQho\r\nr7OZfQhxVVrpgpMnvSfLGE2+kCkzvATd9iq22fkxQ4TKYHdkJoiQ6z80Yk+D\r\napLhJhHT8gz9c655C3DGUosW1B4I4OCEyrM1swXyOD1InRpWDZmZoN8q2VSd\r\nMwNqu9MCDePsb5pnn/Uj+ccIydFTpjrROYp07rqbYmg6E4AAGgdkLMK/NRPN\r\ncfE643aBjF88PkbqEi/Tu9LknYsQwPXDVusJnnK0LztG67ee7IOhvigDUql9\r\nPqlYsvZXeYtkQeMSlon+/yM0fHYc9h2v+UjBhOndXBXMl0oKL1sT7BRHelX6\r\nqJc5ODrkUB/YKAlIhKXlOnykiCM9TDXNuesjkEfQH8MF0A17YB4SKb/2LVNo\r\nFdxf8SLXfWlRgntNqh8cy/ywslu9nIRUs1y2h5bSr5oXdFcf3oj8DH7FJUiJ\r\nGi5dsDkrpmQcgJpq4IJ5BZDeSKVPK6D+fDA4aTBRIQGgx/BQBLRfifE1ammy\r\nOLmQgMQ22/T+bF2zAvOQs6cxI/QgO+Yo5wH2oaIJhItmThShVczZlmf7P/y9\r\nyGIQy5tyRJmTUGu4LqUdiJ/nVfYEZbLkO/k=\r\n=1uWq\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.9.1-unstable.30_1678892478728_0.10754240122819936"},"_hasShrinkwrap":false},"0.9.1-unstable.34":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.9.1-unstable.34","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build --clean && tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"^0.3.0-unstable.25","@sphereon/pex":"2.0.0-unstable.12","@sphereon/ssi-sdk-core":"^0.9.1-unstable.34+0a44ee7","@sphereon/ssi-sdk-did-utils":"^0.9.1-unstable.34+0a44ee7","@sphereon/ssi-types":"^0.9.1-unstable.34+0a44ee7","@sphereon/wellknown-dids-client":"^0.1.3","@types/uuid":"^9.0.1","@veramo/core":"4.2.0","@veramo/credential-w3c":"4.2.0","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.6.0","@veramo/cli":"4.2.0","@veramo/did-provider-key":"4.2.0","@veramo/did-resolver":"4.2.0","@veramo/utils":"4.2.0","did-resolver":"^4.1.0","nock":"^13.2.1"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"0a44ee76d7df4f0a1bd0a7aa092ab1f417269f97","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authorization request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst authorizationRequest = await agent.getSiopAuthorizationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authorization request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationRequestDetailsResponse = await agent.getSiopAuthorizationRequestDetails({\n  sessionId,\n  verifiedAuthorizationRequest: createAuthorizationResponse,\n})\n```\n\n### Verify authorization request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthorizationResponse = await agent.verifySiopAuthorizationRequestURI({\n  sessionId,\n  requestURI: createAuthorizationResponse,\n})\n```\n\n### Send authorization response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationResponse = await agent.sendSiopAuthorizationResponse({\n  sessionId,\n  verifiedAuthorizationRequest: verifiedAuthorizationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.9.1-unstable.34","_nodeVersion":"16.19.1","_npmVersion":"lerna/6.5.1/node@v16.19.1+x64 (linux)","dist":{"integrity":"sha512-BSK87SYDXwLdSPUR+SW/r8TvccAPO+VVBCqXlelKhm6sNR1ttm7Q0hNYwQ1mUwSzsO2rCx1Zee6fTQKHg3NnPw==","shasum":"3c4322e373e33d01b703c7138ea8596a19e201c2","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.9.1-unstable.34.tgz","fileCount":34,"unpackedSize":140102,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBOycmNUj9b7uA+lPDhgRD0Lg11omeQYvITXzlNnhy2jAiAJdynmc4AkJ9Q+JYHIgychybXg6++TZQoaI2viuL/4+w=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkEfMXACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpIYg//aMtYZMMNiTJBdGkGMG3QCJY6/szkYy29exL4Cq9BjFI4OmYm\r\nGNX9Mq4uYt/99AM4o9u4OSXD98V65rdbTVf/TKRqOARsM36fZ8A8v+TWFAr7\r\nIy6VvNXP/XhwXMPgiJDCV2GGLgt8BkPkcBX3Aol8zT/pkpuJyoU9mdSuPr2v\r\nogRslUlO8hOtfRQ6JJyHXwyoRk3MWcuCRDh0KmtyJDzLxQYRbhAaSJXXUKvs\r\nLO/tVIXx6gpICBkV9amOA3e4gOq40bBF+GTxKKA2jNpZssMpyyQADs23d/xb\r\n6yIPjaA1HqlKW0dgHQf2myB1wYpOM4A1zc7RQFFyTCE2vy3MBIVNA4m0Pmyx\r\n9Xpvw5Cpedf08He/HDJ8HctLc+FA/f2/uXOEfTp3W7n2O9OXQZ+cIJVXf1yx\r\nWKV/74pWvc1cqc77AKKAUiipoN7HSlYxyyimSbHegCkrGu2jTDMTIM+7SCiR\r\nL++0YNHX0U9h9ccnxafedf5PDLJXKgoqa84g299iq399QYaUVbYP565gSO24\r\ncywGsEJnmVtKCNemGmWgdjZbVEqvdJo+mv1UrpG3JhWxCZvypEWExM7TiISU\r\nQtWbl/ZiQp09oAnATVEWsYrBEQ2j8axchQ5SnafKg6/o9ILVQRSeeWYtEOws\r\nxAGSHYH+SEkTv3dWCeL9WrxMxMZY+BzXQJM=\r\n=tmXi\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.9.1-unstable.34_1678897943709_0.21065514854065448"},"_hasShrinkwrap":false},"0.9.1-unstable.18":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.9.1-unstable.18","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build","build:clean":"tsc --build --clean && tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"^0.3.0-unstable.25","@sphereon/pex":"2.0.0-unstable.12","@sphereon/ssi-sdk-core":"^0.9.1-unstable.18+a4e1114","@sphereon/ssi-sdk-did-utils":"^0.9.1-unstable.18+a4e1114","@sphereon/ssi-types":"^0.9.1-unstable.18+a4e1114","@sphereon/wellknown-dids-client":"^0.1.3","@types/uuid":"^9.0.1","@veramo/core":"4.2.0","@veramo/credential-w3c":"4.2.0","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.6.0","@veramo/cli":"4.2.0","@veramo/did-provider-key":"4.2.0","@veramo/did-resolver":"4.2.0","@veramo/utils":"4.2.0","did-resolver":"^4.1.0","nock":"^13.2.1"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"a4e11143915eb1638d999fffdcd92b8578227b2b","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authorization request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst authorizationRequest = await agent.getSiopAuthorizationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authorization request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationRequestDetailsResponse = await agent.getSiopAuthorizationRequestDetails({\n  sessionId,\n  verifiedAuthorizationRequest: createAuthorizationResponse,\n})\n```\n\n### Verify authorization request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthorizationResponse = await agent.verifySiopAuthorizationRequestURI({\n  sessionId,\n  requestURI: createAuthorizationResponse,\n})\n```\n\n### Send authorization response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationResponse = await agent.sendSiopAuthorizationResponse({\n  sessionId,\n  verifiedAuthorizationRequest: verifiedAuthorizationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.9.1-unstable.18","_nodeVersion":"16.19.1","_npmVersion":"lerna/6.5.1/node@v16.19.1+x64 (linux)","dist":{"integrity":"sha512-6tlo8U5tulxbqodNrHFmDYA+KucdY1wYyM6jvowa6yzmUwhB5S/yQcxClqryHIduLTjPcX6UpR5D5yFJuFUnmQ==","shasum":"8ddc08e1a5bd3c636ab8feaf41cc7c150310079d","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.9.1-unstable.18.tgz","fileCount":34,"unpackedSize":140136,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCFJMaY6f+qyODXqYMm0QV21mgxnJ4HOqsfbg1aSTn7RgIhAKXDB6AMh/UVOekapnoZOvs7wtMBLZmzkpSTbA5bSe7B"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkEuvCACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmotLg/+L8+SmmbOsGWtVK/yvObfJZGK9mhCxLnTHxsIp7wz+STlTXk/\r\nwbmgWIflYygzn6fqm8j9Q/DwpNVKlbkwd9+7a/A5DZ8GM8bBFoPfBjuVVxKL\r\nY8twwxDqgy9Dfr0bHede+oK1FnWeKz8FYp/EPumriWdrLaefG48GFQooULSy\r\nw0T8sup2peseelazeyOCX4nKEsyyZfkvJ7omtn9zeexEAursbYJujxCgwIZ9\r\nhKkBY22uVfdkv1CsnDSALOuSR0XL4TTe2C3fm/n0HBrRW/Gv1t8X7bACFDfh\r\nEdEMw0e1wzE0ZeqggDUX/8eoic8mCfRFLTAmX2arPO/nzIdDMStuAwDf2N9s\r\nSXIvsU93OyvKWUDO0wk5SvxvMIsswH/AQxs+75CRVwBwmEGrIK6qZctgXFHB\r\nrd2iV9cFazsjFtJujS/SBrc0uIqy2+H8hHuiPxs7TETU6DxB46bIup6iluI4\r\n2ELhIVbpz+j3sD5V8EJ3xjSLlb37E5LNdZt5OgMthOC/rbA3UTkHCdaWH4dn\r\n9OB21TbVTbxoQ5xL4AgoHhvYOPb2V6lc67Xvd9OOA+ydWI4YYFbbfs2gZ7bp\r\nMT1CvyPKa1z8Wkh4tsnsmAHxOQqgA+kvcHN2RhpD5S3SgYMfHx8pf8y1TgMo\r\n9AowtAG9Rjj9GZ+pqifES3ID6erbMS/ADlE=\r\n=b/jY\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.9.1-unstable.18_1678961602610_0.7249632897406828"},"_hasShrinkwrap":false},"0.9.1-unstable.19":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.9.1-unstable.19","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build","build:clean":"tsc --build --clean && tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"^0.3.0-unstable.25","@sphereon/pex":"2.0.0-unstable.12","@sphereon/ssi-sdk-core":"^0.9.1-unstable.19+728fc16","@sphereon/ssi-sdk-did-utils":"^0.9.1-unstable.19+728fc16","@sphereon/ssi-types":"^0.9.1-unstable.19+728fc16","@sphereon/wellknown-dids-client":"^0.1.3","@types/uuid":"^9.0.1","@veramo/core":"4.2.0","@veramo/credential-w3c":"4.2.0","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.6.0","@veramo/cli":"4.2.0","@veramo/did-provider-key":"4.2.0","@veramo/did-resolver":"4.2.0","@veramo/utils":"4.2.0","did-resolver":"^4.1.0","nock":"^13.2.1"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"728fc1657d956e66ee8e0a65680b8f9dd6ee701e","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authorization request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst authorizationRequest = await agent.getSiopAuthorizationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authorization request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationRequestDetailsResponse = await agent.getSiopAuthorizationRequestDetails({\n  sessionId,\n  verifiedAuthorizationRequest: createAuthorizationResponse,\n})\n```\n\n### Verify authorization request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthorizationResponse = await agent.verifySiopAuthorizationRequestURI({\n  sessionId,\n  requestURI: createAuthorizationResponse,\n})\n```\n\n### Send authorization response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationResponse = await agent.sendSiopAuthorizationResponse({\n  sessionId,\n  verifiedAuthorizationRequest: verifiedAuthorizationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.9.1-unstable.19","_nodeVersion":"16.19.1","_npmVersion":"lerna/6.5.1/node@v16.19.1+x64 (linux)","dist":{"integrity":"sha512-5EkGefIM5UXxPCMHgrOde2bnUcw69jOsoCtHPxOvBQnchdC9qakGssMzzVkenMSdzk62C3wEXVjZ8MMj77RaQQ==","shasum":"d5a8eefb66c7de86fa79e65356e79e6ab9515764","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.9.1-unstable.19.tgz","fileCount":34,"unpackedSize":140136,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDsXDwTrhDgQcmC1BEiVUhJo/G24b7L2/uIfAEMgKeIogIgahCQyaWX7qbzmCIQRPWg3fpdqOgsQhT7CvSK2Rbs4as="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkEu0GACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrPBBAAlh9h0YnLyY9BjhXYSX5Q6P6F/P80MZlLiZkfgSnxHlfHpMJm\r\nV1NAbW6QnpvgM8IUMoXsXLQ/+NdNo6hpDx7xH8/q+wGi/m+6dwz93Tcw0rAf\r\nYBWAxYUWkEUdo/AkhChXI2SLCfpTdn5FnM47z6fqFJLLhhKkwhKeWgyn3MGQ\r\nI/GYb6gHzluWptq2ffrKPuf00Aqhs2iGA4uUFJcvgViKEXAyc6DbkFddVkIf\r\nwHsoGGcHMG6y8G4Ri5NLNEtWU+H2NFscM+XREpd1tsiTDC/ORVq+tMbURCNs\r\nxKlpDvGa9ZVL+8bvYDy4Ottui2Kot8rxWNOu+fRv/anuq1nFJLZH1feGAKzJ\r\nJA3bbld95p+g6fo4cFIKvddN3X2iVhbJeyPh0bwuVSXjXWHeCLuv4P79VN93\r\nI5TXaJgUJLaRidTk9z/4myaaI7CVpLEitkZVUjJ8Nf/hrcCJjI1gupA9LRQ3\r\nHzDRdl/pJCPab6VmFRsAwiHaQEVshQxCYGA8HTTtyU/TD6E9XeVpeUxp6j76\r\nS0K/lRQb9myM4UutfYP/eKxdfXKFTE5g5Z007u3ePDg3tFim1AUBLF310EAA\r\nSuzFjkXmOY7HriK3izqbTNIUB/+At44I6jrpgTn9VUnVB+VcojHPPY1erUGm\r\nhsknZn9o1AJAUglBx1qr252w18HpSk/aABs=\r\n=atEc\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.9.1-unstable.19_1678961926187_0.9779360507951076"},"_hasShrinkwrap":false},"0.9.1-unstable.20":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.9.1-unstable.20","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build","build:clean":"tsc --build --clean && tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"^0.3.0-unstable.25","@sphereon/pex":"2.0.0-unstable.12","@sphereon/ssi-sdk-core":"^0.9.1-unstable.20+a9192f4","@sphereon/ssi-sdk-did-utils":"^0.9.1-unstable.20+a9192f4","@sphereon/ssi-types":"^0.9.1-unstable.20+a9192f4","@sphereon/wellknown-dids-client":"^0.1.3","@types/uuid":"^9.0.1","@veramo/core":"4.2.0","@veramo/credential-w3c":"4.2.0","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.6.0","@veramo/cli":"4.2.0","@veramo/did-provider-key":"4.2.0","@veramo/did-resolver":"4.2.0","@veramo/utils":"4.2.0","did-resolver":"^4.1.0","nock":"^13.2.1"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"a9192f4b8922f5ec3a82e588081adc49f564b9b4","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authorization request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst authorizationRequest = await agent.getSiopAuthorizationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authorization request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationRequestDetailsResponse = await agent.getSiopAuthorizationRequestDetails({\n  sessionId,\n  verifiedAuthorizationRequest: createAuthorizationResponse,\n})\n```\n\n### Verify authorization request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthorizationResponse = await agent.verifySiopAuthorizationRequestURI({\n  sessionId,\n  requestURI: createAuthorizationResponse,\n})\n```\n\n### Send authorization response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationResponse = await agent.sendSiopAuthorizationResponse({\n  sessionId,\n  verifiedAuthorizationRequest: verifiedAuthorizationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.9.1-unstable.20","_nodeVersion":"16.19.1","_npmVersion":"lerna/6.5.1/node@v16.19.1+x64 (linux)","dist":{"integrity":"sha512-eNjEJYPXoHkiSkL5s61NIjGVfl7/nyopCKrDyzTcjb53Nq6J33cJAsCsiq3HkJp7c3klWlIuiBkS3V7tqoDKlw==","shasum":"8c9e98146082d20471b310a101058e6746dfc436","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.9.1-unstable.20.tgz","fileCount":34,"unpackedSize":140136,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCaqF2+ho4VBH4H7CHKTcBnXeolz2ZNu+R72OMiG28SNwIgQ/L5VxxRVnP3PtdhdPIaBhmKaiUDX6DAXj5p8av1PeM="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkEu17ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmokhg/9FliS72w09c5PXXFVLgP+DNsNFTPnxmgnCCD0ly2w+X/39SYG\r\nGgdQzSRMUIrkzDlWXHde1+b8UKRGxZpYnMYlKfZWtXz7xYCJYR0ETre67DzR\r\nkMYoQRjEsMksF2AtO38Ldce7SQmKqb7KFZDyv7YAr0212sbD9dCM/B8S9uGM\r\nU6ZhugWz/M6ayVDzUSvRWixfVVdmmDCgj7ZF3Ymn9jyfuXemvyM5/T/uAR5X\r\nCsW1ZTrTRY+TQdhFSxWa/JN7KKmk55umXuqwXLRYnkSCqhg3Hz2Ab+McPyox\r\neHY4NqW2rkfPppFYz7aZhLNcDdNCF8I/mmfnCr/NRTtzxLxvCYbOx9XwPMAX\r\nPm4hmhIIE28txE7T7rp+QRmRJNP9dHilH0s/3woQwvmTfzEeCkJ3hxncVEO+\r\nn1/hJCXwO3HRDmLTDW+lqyie5jbfXGQIa6ahRaE+D79cQ+xOHdEdFVpOEAfI\r\n7qVZcnkB06DrO+ER7LKHJszvJXudW/Ll3rgTmqvfQdyHa6Hmcxk3bv+EQIVk\r\nQSo7SW5hLD6YEGIdSCpwvvMY1zw586vnZYy1wH+x8G4yKPKX7raRdLsO7R5F\r\nEc56HVO/0qVM8MkqbhWkvmAfM4tOOqZazRnIrk9MXgb0mSogQ4kffQaNkB9/\r\n1AFVrAtWBjKrdsSEIJUKawEgUlURto8M2rM=\r\n=CiAB\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.9.1-unstable.20_1678962042873_0.010134012556605398"},"_hasShrinkwrap":false},"0.9.1-next.21":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.9.1-next.21","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build","build:clean":"tsc --build --clean && tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"^0.3.0-unstable.25","@sphereon/pex":"2.0.0-unstable.12","@sphereon/ssi-sdk-core":"^0.9.1-next.21+b824d21","@sphereon/ssi-sdk-did-utils":"^0.9.1-next.21+b824d21","@sphereon/ssi-types":"^0.9.1-next.21+b824d21","@sphereon/wellknown-dids-client":"^0.1.3","@types/uuid":"^9.0.1","@veramo/core":"4.2.0","@veramo/credential-w3c":"4.2.0","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.6.0","@veramo/cli":"4.2.0","@veramo/did-provider-key":"4.2.0","@veramo/did-resolver":"4.2.0","@veramo/utils":"4.2.0","did-resolver":"^4.1.0","nock":"^13.2.1"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"b824d21a986787d0989ecd164941a4d74996c9f5","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authorization request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst authorizationRequest = await agent.getSiopAuthorizationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authorization request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationRequestDetailsResponse = await agent.getSiopAuthorizationRequestDetails({\n  sessionId,\n  verifiedAuthorizationRequest: createAuthorizationResponse,\n})\n```\n\n### Verify authorization request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthorizationResponse = await agent.verifySiopAuthorizationRequestURI({\n  sessionId,\n  requestURI: createAuthorizationResponse,\n})\n```\n\n### Send authorization response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationResponse = await agent.sendSiopAuthorizationResponse({\n  sessionId,\n  verifiedAuthorizationRequest: verifiedAuthorizationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.9.1-next.21","_nodeVersion":"16.19.1","_npmVersion":"lerna/6.5.1/node@v16.19.1+x64 (linux)","dist":{"integrity":"sha512-MY+0aobglTSWGqtcjd8gV2EBkNRDR1iuUrqD8a2TWY5kY+j0agjqWK1pG/WxCoeKg/JbEZHjEfCcfnr6TpVvrg==","shasum":"0ba7c0e9e77c717e8a0fb017a51544c4791f9847","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.9.1-next.21.tgz","fileCount":34,"unpackedSize":140120,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDY9Y41yIzoRxT0MIn32ae+Hg1SRSHFcJlpPjl8y8GglwIgSvkaXPFWKF857s0pD53lmfFxlx6DeAJADFMVpJXMN6s="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkFDB0ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqHUA//evvDnhlnRZq7N8YyG+GldGcwlGTJK0DL4DTgsIrK0u5Vn3Kv\r\n2ZaRzzlSXVIz9JSvEBJqVOQmmd9/tjNSbm5uZP796nYjJ4tRVL8tHc/Ov2xR\r\neduT0EbLoB40VhF9pdxY4VgdMUGIdmXTjVA4AEnT2nDaCzsTjS7eUAMXkW+G\r\nHSw4cc6Z+GypYkqpUZAZOAkrgaPiF9gMuGAzcbenk6twA8UZ9H71WJNEGNk+\r\no4ENqHnQvBex4cvsLOJdkkaDyWOZ7696VOlf8BHOBGz+b9SXZrT4is9/E6aH\r\nwSCLdxuvuWNL6GkYB6iqK5zeMdVGdj+waEEkurPcvXz77kQbO91r/QIF4Vt4\r\nEW6J0GXZqkQuXXo+8rNrD8PpQldGqaq5PmB+8tLNvJljBWWqduJjc0wkqJ1p\r\nJPej9g1smMAeXsgahuCUSvKwgQ56pQn3YyzuesCUGW+a4k7OywMnN7Ty9F5v\r\ncO/ZZX29m6F5KwX+t3LPBSZqWa/5G9qa5ZvqnVVa3+i4zFpchoDtygOFo1fj\r\n4HLHPJAdt4BctXWsrx0xtRyZPrhjOrM0/pxznlJBjFo2+9IAkEEMOMBTuXfa\r\nh2FWTJw4crqbW8hlIHRFYBXv5TuGsnRYAEkaiiiEekI+YmRceu5uL2owELCh\r\n5oK2caaGJeH4dL0zrVLCyUtzTAnWdcV1BQI=\r\n=wMf4\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.9.1-next.21_1679044724289_0.6292935806211011"},"_hasShrinkwrap":false},"0.9.1-next.42":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.9.1-next.42","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build","build:clean":"tsc --build --clean && tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"^0.3.0-unstable.25","@sphereon/pex":"2.0.0-unstable.12","@sphereon/ssi-sdk-core":"^0.9.1-next.42+13ad882","@sphereon/ssi-sdk-did-utils":"^0.9.1-next.42+13ad882","@sphereon/ssi-types":"^0.9.1-next.42+13ad882","@sphereon/wellknown-dids-client":"^0.1.3","@types/uuid":"^9.0.1","@veramo/core":"4.2.0","@veramo/credential-w3c":"4.2.0","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.6.0","@veramo/cli":"4.2.0","@veramo/did-provider-key":"4.2.0","@veramo/did-resolver":"4.2.0","@veramo/utils":"4.2.0","did-resolver":"^4.1.0","nock":"^13.2.1"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"13ad8825d5bc1148a429c7ff927021891b14b828","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authorization request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst authorizationRequest = await agent.getSiopAuthorizationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authorization request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationRequestDetailsResponse = await agent.getSiopAuthorizationRequestDetails({\n  sessionId,\n  verifiedAuthorizationRequest: createAuthorizationResponse,\n})\n```\n\n### Verify authorization request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthorizationResponse = await agent.verifySiopAuthorizationRequestURI({\n  sessionId,\n  requestURI: createAuthorizationResponse,\n})\n```\n\n### Send authorization response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationResponse = await agent.sendSiopAuthorizationResponse({\n  sessionId,\n  verifiedAuthorizationRequest: verifiedAuthorizationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.9.1-next.42","_nodeVersion":"16.19.1","_npmVersion":"lerna/6.5.1/node@v16.19.1+x64 (linux)","dist":{"integrity":"sha512-nuIJ6ToINLGDkNLj+DKOGTiuaW/67yVl52gnS/U1roBMJHP6C96radiQDMuAsy7OCcsOMhyCJ52BmfUw/sZ3ZA==","shasum":"4f31e8cb955103bef759cc4f4d5156b22ad29566","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.9.1-next.42.tgz","fileCount":34,"unpackedSize":140120,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDF366JZ9si74SoG/al+tq70EzSKYmYsH/yiblTKh/frAiAFbTrQ63zeGlnF99XV2hq+mE2lfOVDc1PZjHOCQtadKw=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkFDl9ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqHuQ/+M07Z+KUcLG8e+q3up1b0GvoBpuywdG7U2DFay9WAhqwuKZW0\r\nKoi1l2LFRZuratq2/ghDgeBSyCY7KlheYA20v7ynTHqx8529QhnhHQ5AJh7S\r\n2V4XgFs8+tUJ1GGmWoLlbZQw5dDV7BvoXjU7GbxFs+gKmYAXE3icaBmk8Zm3\r\nZEx2bRFwVtSa7sKk5cAdFoVzXXJWmQmifqUpzUoy1P2RW3Q7b1LWlDdjMcIN\r\nre9K0vZw4RlL5Lqee+ZMemffDcdMCTS6/3pm3PeBd9d9SkLRrGnAc25DGheu\r\nw+zRkjzV55OA/9+tMP1n9BwRWSfNq4hSk4kh2cUVjCJSYEZ3mF93+cO2jQfx\r\njBwelo6wclAe9L8aeUl2kNbvXqzyujt6Y7nktmKFjVlDKvuTzOrubmhXC7Lr\r\nue3WaBElwczxaXg1uR7ean7CsUY6I/QMtlwXxFRkhWor4Lafq/spLG3WjA/R\r\nn33kmVBPeeXwTnHajyj9DTb+1pu9lc9DFPXYRK98q0tLBRBioWcgtwg3pr3I\r\nWiMA0jSyElon6t7CicaQEoflwn52Hmrw5V8f0yw7wpJr7mLeM7HC9HqwDpiC\r\ne6ZOWRUc/1ecPNMY/f9ni0uyDPgbHg0xDO0u29BFMyqa+FxGFscPcsQ92eko\r\nlYqFBsUQ2eh4gjtUOzFnNYwDyGHdAFvfCjg=\r\n=viV9\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.9.1-next.42_1679047037684_0.022240818061064038"},"_hasShrinkwrap":false},"0.9.1-next.55":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.9.1-next.55","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build","build:clean":"tsc --build --clean && tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"^0.3.0-unstable.25","@sphereon/pex":"2.0.0-unstable.12","@sphereon/ssi-sdk-core":"^0.9.1-next.55+6a7ec2e","@sphereon/ssi-sdk-did-utils":"^0.9.1-next.55+6a7ec2e","@sphereon/ssi-types":"^0.9.1-next.55+6a7ec2e","@sphereon/wellknown-dids-client":"^0.1.3","@types/uuid":"^9.0.1","@veramo/core":"4.2.0","@veramo/credential-w3c":"4.2.0","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.6.0","@veramo/cli":"4.2.0","@veramo/did-provider-key":"4.2.0","@veramo/did-resolver":"4.2.0","@veramo/utils":"4.2.0","did-resolver":"^4.1.0","nock":"^13.2.1"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"6a7ec2ee42281456394a8135cc973a33ba3ea82b","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authorization request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst authorizationRequest = await agent.getSiopAuthorizationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authorization request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationRequestDetailsResponse = await agent.getSiopAuthorizationRequestDetails({\n  sessionId,\n  verifiedAuthorizationRequest: createAuthorizationResponse,\n})\n```\n\n### Verify authorization request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthorizationResponse = await agent.verifySiopAuthorizationRequestURI({\n  sessionId,\n  requestURI: createAuthorizationResponse,\n})\n```\n\n### Send authorization response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationResponse = await agent.sendSiopAuthorizationResponse({\n  sessionId,\n  verifiedAuthorizationRequest: verifiedAuthorizationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.9.1-next.55","_nodeVersion":"16.19.1","_npmVersion":"lerna/6.5.1/node@v16.19.1+x64 (linux)","dist":{"integrity":"sha512-Ox94eQzutXhsSQRHw7hmgegs/ZPCT2b2LouXROnzi6ZTEGKnrBCQpoY6idV2EKfb/gAVWF8Rdwnb5oO9vurxPg==","shasum":"a06912643474896d4c2a8c57737859633cc5c1d3","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.9.1-next.55.tgz","fileCount":34,"unpackedSize":140120,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFypGJygu8pyc/3FiHXUE3Y9WarbcT7gd6GsfOrLpoN7AiA5lw9W3hui5k+m550btYTvoTyv2GwD1vFlun9m/ryE+Q=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkFFSAACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoLXw//X79d+M53eyKfE4RehNvulyGOBYPRioPymMohVjsfLZEkpkhk\r\n7NKSwvEmvSe1wOFa5OrvLY+bNHIhqZeMvomtcf0OgpdpOh/o42u73qgzHrIW\r\n+ebQA6HY2eUHTwoVe4Fozgox62FBmZzTbQGpXX52Od5H2TQ4pH8P6suUOYTp\r\n6aZJVvjrb+oJrzU88x6/TC/u5j30DguN9/6Qsosm9koPP+PtQEosZgF6j6yf\r\nsy+5O1dH+Fn6DdJXeorc4wCX7WszCuEHkTlH7BInOpdiCoJ97vhJ1Y0nLf+e\r\n8xT++c/P4xDiZ41DqiwDnEEjF5G0h30WFzHVRERvvQQDcHPQ53KtttBRtnd+\r\nNMbQQAdvUv01A1HD2lBeZ+CwrJRRs4piYiwB1TH5z0y4d2nGeth8lJ/N1eaC\r\nvPodQXWNrqp41Jox6rmb10NP0t1Rg0A/oAni94qQOS+axIHL4M3D2q4s0m5t\r\nPmAZoiJqDMrwnr0hGXVzjc1qwaRjyrtr/CwqnreQ6fPNRmhVeup/KJg+SQUP\r\n72jxRN1bDCHOiYJ7Zi5SEi6MSMT5eiqkXsMKt3ipNS/c12lNTDcqTmM7QkAr\r\nRSfFOW8WE2jUkEmCfYuyjqwgpuxGANZ9meq3OHoWxo3GTLHq1FCDoCLFGU1/\r\noKT377QdjFySvR3gqStdpJH9AsMjKuN5Hds=\r\n=hnE0\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.9.1-next.55_1679053952133_0.10860861464306915"},"_hasShrinkwrap":false},"0.9.1-next.56":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.9.1-next.56","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build","build:clean":"tsc --build --clean && tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"^0.3.0-unstable.25","@sphereon/pex":"2.0.0-unstable.12","@sphereon/ssi-sdk-core":"^0.9.1-next.56+22d9f1a","@sphereon/ssi-sdk-did-utils":"^0.9.1-next.56+22d9f1a","@sphereon/ssi-types":"^0.9.1-next.56+22d9f1a","@sphereon/wellknown-dids-client":"^0.1.3","@types/uuid":"^9.0.1","@veramo/core":"4.2.0","@veramo/credential-w3c":"4.2.0","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.6.0","@veramo/cli":"4.2.0","@veramo/did-provider-key":"4.2.0","@veramo/did-resolver":"4.2.0","@veramo/utils":"4.2.0","did-resolver":"^4.1.0","nock":"^13.2.1"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"22d9f1a3c4e8b3cd58de013ca244898d7e3e91af","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authorization request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst authorizationRequest = await agent.getSiopAuthorizationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authorization request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationRequestDetailsResponse = await agent.getSiopAuthorizationRequestDetails({\n  sessionId,\n  verifiedAuthorizationRequest: createAuthorizationResponse,\n})\n```\n\n### Verify authorization request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthorizationResponse = await agent.verifySiopAuthorizationRequestURI({\n  sessionId,\n  requestURI: createAuthorizationResponse,\n})\n```\n\n### Send authorization response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationResponse = await agent.sendSiopAuthorizationResponse({\n  sessionId,\n  verifiedAuthorizationRequest: verifiedAuthorizationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.9.1-next.56","_nodeVersion":"16.19.1","_npmVersion":"lerna/6.5.1/node@v16.19.1+x64 (linux)","dist":{"integrity":"sha512-kv+coOZQaMwsLVdtBCTC8Eoi8qWUXj9pkQHFwgq8AYBm+JjfdDXb4xoowLOdwqmsHiHJd3RjBKM75prd+AatQA==","shasum":"8e8059982faf21229cfca37d2701eb4d6a779cbc","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.9.1-next.56.tgz","fileCount":34,"unpackedSize":140120,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIC0MDUez6NRDphGd5bhbykilBg7crTtnBIVUn1KbQxm3AiBmG1Thcu3sShZWjtD8lfP9PXHcWgwUzGVuAzf/KClC5w=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkFlGhACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmojgQ/+IYOpaClaQh8wlFs6rybp9kRvuVnib14NuJ/kuvF2Ykdjoy0E\r\ntnIiJrGoPYJJ9WZScnx3augFuVqh/W4ymo40kY36BbhEG5haJ3VIRQqsf1gC\r\n1xSX/9vf5rnhwmE1iAH/rE9UCRWQctYJNOttWNIuhs2yKAIx4kZ1H0pmCBz9\r\nvTlS7n6kymIi7Cn3egGHmrKMYcwccbe94d7q8J26tm1jivUNCr6G+L/dXW42\r\nCqfFdO/v64y2cuPwFuCjBhnEgQb0DfGR1RFqm12e1PLQC17KKO/7oyDX2hbP\r\n9NT1ug94U6QGniDwutvedZbHzwHKg/aItAWaqxsbGYDl0aiBXicYeQ8JqQaC\r\nhA87XlgDh4U+kmd+2KTjJzoJTq6TJaMW8MxhfUHIIOqRvtyuwNI7Ia1O+B96\r\nY4/cmB+4nFwbnq2aVEt2Zcn9bwgO0ddo78NRns65xrRW6CVmKKMUCohYAd+B\r\nB8qadjCTme1HcSOmjzVD8qT1rhQ5UmLM4VP2opN1sJBupwy9SGHxIlJr4gCZ\r\nht8NqR+xRZezqdK5S9vTPPLQSV2kS+lUcvumwzJOriBmjcZMMrjsUkrQ47LN\r\nQlj/4PNzv2nJGZPPULIwR0LfixPqLB++gVjAH3mczDnXC4vYJGbrxgqAxZPn\r\nB54wQebywEhrluc+n2BAIt+k5VbZlddf84g=\r\n=qNBR\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.9.1-next.56_1679184289283_0.0989881417206373"},"_hasShrinkwrap":false},"0.9.1-next.62":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.9.1-next.62","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build","build:clean":"tsc --build --clean && tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"^0.3.0-unstable.25","@sphereon/pex":"2.0.0-unstable.12","@sphereon/ssi-sdk-core":"^0.9.1-next.62+867d15c","@sphereon/ssi-sdk-did-utils":"^0.9.1-next.62+867d15c","@sphereon/ssi-types":"^0.9.1-next.62+867d15c","@sphereon/wellknown-dids-client":"^0.1.3","@types/uuid":"^9.0.1","@veramo/core":"4.2.0","@veramo/credential-w3c":"4.2.0","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.6.0","@veramo/cli":"4.2.0","@veramo/did-provider-key":"4.2.0","@veramo/did-resolver":"4.2.0","@veramo/utils":"4.2.0","did-resolver":"^4.1.0","nock":"^13.2.1"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"867d15c0b2f2f7647eea939e8344c69a462466fe","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authorization request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst authorizationRequest = await agent.getSiopAuthorizationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authorization request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationRequestDetailsResponse = await agent.getSiopAuthorizationRequestDetails({\n  sessionId,\n  verifiedAuthorizationRequest: createAuthorizationResponse,\n})\n```\n\n### Verify authorization request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthorizationResponse = await agent.verifySiopAuthorizationRequestURI({\n  sessionId,\n  requestURI: createAuthorizationResponse,\n})\n```\n\n### Send authorization response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationResponse = await agent.sendSiopAuthorizationResponse({\n  sessionId,\n  verifiedAuthorizationRequest: verifiedAuthorizationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.9.1-next.62","_nodeVersion":"16.19.1","_npmVersion":"lerna/6.5.1/node@v16.19.1+x64 (linux)","dist":{"integrity":"sha512-X0yQ7jzU64rkWENrdc6vAmWUzB7wqdVdtnbiyUwOZ2FCUrpWRO3HMpNnQ8cVVKM6QqJlJDUYpkLS3wg4k8B38Q==","shasum":"a19948e865f4c79053c3ecf58e4ee2513d4dc702","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.9.1-next.62.tgz","fileCount":34,"unpackedSize":140120,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDuA+ia68GPkr4mjgVKZVCantf+d4SmzDAFitXyIwXr8wIgU9F+CDN0Nc2DjzIERb8F+vrhfsWx5zfSfJ/gyuABkfk="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkGk2+ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqO0g//SS8MpJcrqi/w85bbZUmAfg7kza5ueO87YXbPsAdyJQngq0Z7\r\neE9Hz/lNOzaP5M4YCwtA/g7Z++7D4ve8S95tz2+iOGPxyex6KnZ1BZwrUl6d\r\ntaMPMVk0npGUzqCin+6t7SoyrmSUMYwfTBjewr2HF+6LPGQsu6Pm/cmGaoxn\r\neEnu4bWzczCVfz2X8nyd1oaxurNPVYnMKgyz3KdnYFZ86FMSQnKLv1EjYQGr\r\nA9b+XQqI6Ud/0m1IeYzp7wL5iYtOE7STMNpm445WDToIiNnZtbnGpa3zc7qD\r\ntLoc3tlI3LyF4wn80zmbcuwReDuuA5XEqJ8oXk0ZIutwJNDxp7uge564Kb3H\r\n5TBzBN1K6O/8drCBI0LoRZBCYS2I2n3vOCWHwedB7B5pFyFYWs3O55SpBH3e\r\nlKv1hw4LU6YnUSz7ddX+DoB+f8H8GxKsvlxdhbElMtqIcffd5vmYnQe909o/\r\nfP+kAVItfGo/HrmiULnXGLXB3hRhsKtpLGCOrB1YfbNNQe1LZ/qEczwSKTwA\r\n8dwWuuemPQFg4cngNN98kw7u2ONG46G0if8iFdDPMwzQNi5ABm1F2eE064bs\r\n+xNWRsPqjIXgbtYwyJNflaDKh0AHjfM+x/KhUkntnKe8/9cRzdULiEtzAQ0w\r\njwxnYwsdewICcikNkxQRsj5wzLGp4fK3VxU=\r\n=XBn/\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.9.1-next.62_1679445438502_0.5367631200080993"},"_hasShrinkwrap":false},"0.9.1-unstable.66":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.9.1-unstable.66","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build","build:clean":"tsc --build --clean && tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"^0.3.0-unstable.25","@sphereon/pex":"2.0.0-unstable.12","@sphereon/ssi-sdk-core":"^0.9.1-unstable.66+61cb806","@sphereon/ssi-sdk-did-utils":"^0.9.1-unstable.66+61cb806","@sphereon/ssi-types":"^0.9.1-unstable.66+61cb806","@sphereon/wellknown-dids-client":"^0.1.3","@types/uuid":"^9.0.1","@veramo/core":"4.2.0","@veramo/credential-w3c":"4.2.0","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.6.0","@veramo/cli":"4.2.0","@veramo/did-provider-key":"4.2.0","@veramo/did-resolver":"4.2.0","@veramo/utils":"4.2.0","did-resolver":"^4.1.0","nock":"^13.2.1"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"61cb806b4909d593791158fee36260b12301d2bc","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authorization request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst authorizationRequest = await agent.getSiopAuthorizationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authorization request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationRequestDetailsResponse = await agent.getSiopAuthorizationRequestDetails({\n  sessionId,\n  verifiedAuthorizationRequest: createAuthorizationResponse,\n})\n```\n\n### Verify authorization request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthorizationResponse = await agent.verifySiopAuthorizationRequestURI({\n  sessionId,\n  requestURI: createAuthorizationResponse,\n})\n```\n\n### Send authorization response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationResponse = await agent.sendSiopAuthorizationResponse({\n  sessionId,\n  verifiedAuthorizationRequest: verifiedAuthorizationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.9.1-unstable.66","_nodeVersion":"16.19.1","_npmVersion":"lerna/6.5.1/node@v16.19.1+x64 (linux)","dist":{"integrity":"sha512-l/IwAlyggDVUXGr0ppYqEOi7XKX35jT9L9ioOOW+oCInetpk1Scok25E9NVbAH8evRykonE3/noPQMo+x8NJsg==","shasum":"403dc4b4278097584fb1dc0b643c96a2df5d8567","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.9.1-unstable.66.tgz","fileCount":34,"unpackedSize":140136,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBkIqO9Ed0KTOSDFjsMfMVp44fcyxN8sjzxg7yUGv6JDAiBGC/q5HnmMpnwK5+3faV6yc6bsrzNkIQOFHA9OTOZcjw=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkGu8aACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmphkQ//ZFnn9LJl0DGGWlUCvpy4vrmoeec8TGvV+FmLsM/92MZxOCsc\r\n7dsyMSEvMVf7Rdib67pfxMm88S7oNyYp17YXbhHKrIPAcDbn18JqXlMgkGL/\r\nIbWrOG9ZfznBQjcTB0Cn68MaxZ6amYDa4CwFCjIlSuZkTh7kZRytrbSEYbBq\r\nMZHDQlKvGxS+amjQe7MGAf2aoQDPOBkteMOjQBPwLKb3MF6OHJZ3CPF6INv7\r\nnaT0bOvoDM2PC0Yt/KaeKgF1XLUXGJZ9kbN+8jkjhmJ/WrM9EFxO3aQOFzai\r\n369arBg3LShMchPR79uWKS83wYmjOajKUMnExRBFZTkBAYbxvQ2aI8TC1/tr\r\nyAp3nCLo4+31nMbNOEcBNVcipCeko7WApVLLHDFMwxOf7DEI9tQ3dURhMQRV\r\ns67FraFZcyZJcxwrKs6f4Xt7Jq7ZJn2iSIY0WgDJY86xek1/CFR5oBxJXfHt\r\nQ0530MOLnNhnxSbkbbzBt15ix/BBgNemr07AJHyKpvPtKdYJxDugl0Gv7CHp\r\n2wQDhBDr1oXgHJXjS8IAM7Aw4GC++ZsIvlRpxZxez2E5cg87tDfQuUpWBM8y\r\nzmlDNDNkTYjatoIDWmfcmPc3/l1NhjsZNde0oE61/oS2y2bQkGTFif+jTPdL\r\nDKm53f6qGeOraDvDWhSnyeX7DDoNmTxQjPU=\r\n=glE/\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.9.1-unstable.66_1679486746728_0.5166460293668123"},"_hasShrinkwrap":false},"0.9.1-unstable.67":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.9.1-unstable.67","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build","build:clean":"tsc --build --clean && tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"^0.3.0-unstable.25","@sphereon/pex":"2.0.0-unstable.12","@sphereon/ssi-sdk-core":"^0.9.1-unstable.67+789c507","@sphereon/ssi-sdk-did-utils":"^0.9.1-unstable.67+789c507","@sphereon/ssi-types":"^0.9.1-unstable.67+789c507","@sphereon/wellknown-dids-client":"^0.1.3","@types/uuid":"^9.0.1","@veramo/core":"4.2.0","@veramo/credential-w3c":"4.2.0","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.6.0","@veramo/cli":"4.2.0","@veramo/did-provider-key":"4.2.0","@veramo/did-resolver":"4.2.0","@veramo/utils":"4.2.0","did-resolver":"^4.1.0","nock":"^13.2.1"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"789c5070d6a1d4d0176243219ce4f2642e8d74cb","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authorization request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst authorizationRequest = await agent.getSiopAuthorizationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authorization request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationRequestDetailsResponse = await agent.getSiopAuthorizationRequestDetails({\n  sessionId,\n  verifiedAuthorizationRequest: createAuthorizationResponse,\n})\n```\n\n### Verify authorization request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthorizationResponse = await agent.verifySiopAuthorizationRequestURI({\n  sessionId,\n  requestURI: createAuthorizationResponse,\n})\n```\n\n### Send authorization response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationResponse = await agent.sendSiopAuthorizationResponse({\n  sessionId,\n  verifiedAuthorizationRequest: verifiedAuthorizationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.9.1-unstable.67","_nodeVersion":"16.19.1","_npmVersion":"lerna/6.5.1/node@v16.19.1+x64 (linux)","dist":{"integrity":"sha512-pGL/Y8UJmG+1wstkgKdlkmQuz2G7f/bxefVkV97Eh0RRk9RIPjEHS8OXo7U9WKWurgYzb1HRnHblof/bsarhSA==","shasum":"477fd24403aa415a33074ed35ab38a5e262b6d8f","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.9.1-unstable.67.tgz","fileCount":34,"unpackedSize":140136,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDjRHRx6ePawPjkfLvbjJKebjuV+wMnockj3czMl0di+AIhAPYxroV7ffFmFdc8gmOSXlhKOf/cPbWbQ0sKPGIZx1Tc"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkHBf8ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpImA//Z0SPQRqj2amrL/VbAKwnZMD06Dj5d75EIHISb6mJkVwmK2ov\r\nDYUKjj2zEjxxcOk47cXDz7aMundMIAEdFb2gsuM0SEQB4CW4x92s4DndF1yz\r\nfHgIjX7rlde41C+hnSiXyPgvwIGW9acCCrV3E3RcP6/0IwesRRKr4KZn/1cS\r\nA6SPrdHliiRe0DfdpJ9xRnzbP5LVLTIGBSxtdq0dAZcGQo5/NJDPXOPha4KV\r\n/RPBhEdEEXQuwTDoTuuIUUEuZ3FVdF0cWr+FQlFYyG8x1Dr93aIPUSYRa3yR\r\nJ4IqcOMFN+o7ok3SflD1ZoIDROEzr7RC7SUcNHtBL1zk2K6ZRxA2BnXm4meH\r\nvKpUsMAMX0XucBaQ0ex/sbv3eY2Kvz9JzY3vsUZFg8Wwp594iL0pNUgESSZ7\r\nd+LLDW1lFKypI8BUbK94ZDznEBaM8QpMlVgOhUuGY5irQuYIY2UMgTvGAxRZ\r\nT0Wi8GZW/+oz9bP4kI8fJEqRSwRYko12swgzp4uSmjDoYB8+EIFopblo7csl\r\nL6Z4Hipx4yeiSZNUS3paKwkB1BzVpB0xcCHQO0aEJ6wniNO0oo1lxXBXyR3a\r\n297TEd3FLHRNQACzIC21t/y4d/vQdtlFxApDsneYoZVX7eChK/F6JviTCge+\r\nw8juB9NSSJSk+aM5p3q1Of6CgaSVmwC4DH4=\r\n=8caO\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.9.1-unstable.67_1679562747875_0.5620484115618531"},"_hasShrinkwrap":false},"0.9.1-unstable.65":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.9.1-unstable.65","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build","build:clean":"tsc --build --clean && tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"^0.3.0-unstable.25","@sphereon/pex":"2.0.0-unstable.12","@sphereon/ssi-sdk-core":"^0.9.1-unstable.65+9f05c76","@sphereon/ssi-sdk-did-utils":"^0.9.1-unstable.65+9f05c76","@sphereon/ssi-types":"^0.9.1-unstable.65+9f05c76","@sphereon/wellknown-dids-client":"^0.1.3","@types/uuid":"^9.0.1","@veramo/core":"4.2.0","@veramo/credential-w3c":"4.2.0","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.6.0","@veramo/cli":"4.2.0","@veramo/did-provider-key":"4.2.0","@veramo/did-resolver":"4.2.0","@veramo/utils":"4.2.0","did-resolver":"^4.1.0","nock":"^13.2.1"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"9f05c76e0ad11f5d2229b3ebb612e921a1dfd590","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authorization request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst authorizationRequest = await agent.getSiopAuthorizationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authorization request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationRequestDetailsResponse = await agent.getSiopAuthorizationRequestDetails({\n  sessionId,\n  verifiedAuthorizationRequest: createAuthorizationResponse,\n})\n```\n\n### Verify authorization request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthorizationResponse = await agent.verifySiopAuthorizationRequestURI({\n  sessionId,\n  requestURI: createAuthorizationResponse,\n})\n```\n\n### Send authorization response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationResponse = await agent.sendSiopAuthorizationResponse({\n  sessionId,\n  verifiedAuthorizationRequest: verifiedAuthorizationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.9.1-unstable.65","_nodeVersion":"16.19.1","_npmVersion":"lerna/6.5.1/node@v16.19.1+x64 (linux)","dist":{"integrity":"sha512-juhB4fStVG1ak6VPsigSpaOnVOIsxUfnD9Jjm3tbTHCNoZDvDGK0RfQPtkwTjdrPZyIYKZD6BPFOHcEKp94JtQ==","shasum":"d74fb173d692fa6ffc7d1ba7cc6c64a482c0afea","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.9.1-unstable.65.tgz","fileCount":34,"unpackedSize":140136,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIANb8Yu0mi5WjDMzvt8dLdDKbg6bDfksmoiDzr/LQeMvAiB8KAd1eebAzrcxv6wyOwiLrmO0bC6BLfMd9/S7Qu0M8Q=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkHD6/ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqZ/xAAl7UtAnjFdTwskl4Vrdu0aT0SYHOLByhdidvzUtmXnV/wLVak\r\nSkOjTb2+XghhRed0Kw+NiV36oV6d7ONvIEWIGcprMj7MoH5d/9n1Yq6QtTRd\r\nakPXOmrAVVVlOKTPETbrrlb1ZnipqEjJC2Bkk97G7e9+5hpu8DgUygNVxVY0\r\nP1HfMloSDAUsg5bImg71CT8cWiWhpErkH5voypXN43qClPqrQ9xZzFHy8N83\r\nkWWk/v17Fwx7DMFfh1Fq62S8LgM9nMGXq9dFvV9I7lKmITRfFayvOKBJEeaz\r\nByR4KxHtjnT9WAdh0t70PddzZveOKrnjDbxcNxSpoFvIDQdd0tBdkFiGr99s\r\n95c8wnrDRIAbCBH7ymZiKWbrcpwKcE77fCAJJw4XpCIi+X/Mtcvnx7jsRdQI\r\nizJwzzLKrrgd1+9/1x4CI5WxSMz7acf2iCrmjlCsf5revPX0HqGDLCCWEPHD\r\ntY7LrU+xrnL3ZrUIC31SEQoi9kut2bBnMDJwS1wGqEAYhJn+LyEgIgCU8c2A\r\n3wF/lWqN/jUtXzgQ+AVCVQc/dj04ioydRYNPUDJtw/28WyIWwTYIXuguxUnp\r\nUBT1AET4RZjrw3ow4G0lwYEHtPVm7KVzx1dzkTtEp4qy6Nt7CVeZBxLTnHkT\r\ndQgPq41lzIvLJyDUxeg+LNLvYKz+EAHK63o=\r\n=uZHN\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.9.1-unstable.65_1679572671356_0.8915450023662428"},"_hasShrinkwrap":false},"0.9.1-unstable.68":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.9.1-unstable.68","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build","build:clean":"tsc --build --clean && tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"^0.3.0-unstable.25","@sphereon/pex":"2.0.0-unstable.12","@sphereon/ssi-sdk-core":"^0.9.1-unstable.68+5363668","@sphereon/ssi-sdk-did-utils":"^0.9.1-unstable.68+5363668","@sphereon/ssi-types":"^0.9.1-unstable.68+5363668","@sphereon/wellknown-dids-client":"^0.1.3","@types/uuid":"^9.0.1","@veramo/core":"4.2.0","@veramo/credential-w3c":"4.2.0","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.6.0","@veramo/cli":"4.2.0","@veramo/did-provider-key":"4.2.0","@veramo/did-resolver":"4.2.0","@veramo/utils":"4.2.0","did-resolver":"^4.1.0","nock":"^13.2.1"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"536366823b09bdb6aae23ff5d4f87098eac68ea1","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authorization request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst authorizationRequest = await agent.getSiopAuthorizationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authorization request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationRequestDetailsResponse = await agent.getSiopAuthorizationRequestDetails({\n  sessionId,\n  verifiedAuthorizationRequest: createAuthorizationResponse,\n})\n```\n\n### Verify authorization request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthorizationResponse = await agent.verifySiopAuthorizationRequestURI({\n  sessionId,\n  requestURI: createAuthorizationResponse,\n})\n```\n\n### Send authorization response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationResponse = await agent.sendSiopAuthorizationResponse({\n  sessionId,\n  verifiedAuthorizationRequest: verifiedAuthorizationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.9.1-unstable.68","_nodeVersion":"16.19.1","_npmVersion":"lerna/6.5.1/node@v16.19.1+x64 (linux)","dist":{"integrity":"sha512-wlg4ATGOAC2OH9q5zfYHwXm9c4N9dmLPcawaHxUnXbyQDlfJBt0TiVMG9nk5lxiJtF1M4YOiuNq4K8KhZ9Zofg==","shasum":"0396d06a0d0e245caee5e102a7660a0838940384","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.9.1-unstable.68.tgz","fileCount":34,"unpackedSize":140136,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCgw0bcg4Qjmsr2FLzoHD9I48qsp7rQgY0+l9FJSn8F9gIhAJ+usqaZ27EkIbAshXZkKiJhJ3KoWaeFz6R+YuePaieu"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkHGylACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrFGw/8CemRri+JLVVvrfTrUOTO9L5xNEtVYba2r+5JCXNPQGiEYZNZ\r\nj3GFTUCyYNuY5SP0cbKAVfGOd3cM8Ew7zAK1wd5IBnrHo/y/iybdS9j82Tnh\r\nT2AD/va5RxR6uiDHo8O4iB2CFsmB6ydS8CdKfsZkNf4E3ftTTV+UWK8REsi/\r\n8+6ZFwY18lzXxoUQke1/L76JJ+SCW5lM3wzKIRSYUyi26Rv9Oi21LayBM46/\r\njMwFME15owXq41kMySXCIMfVZlI872DXGATmV3iEk9RFgNcUHKWD7LnTEc0W\r\nk0GD35pI7+lqeOkAuwC2ZwP7Kt5KTBMRw8F89Ux6J1D5lc8B0/1e/li6Ymeg\r\nP4+1vf4mhiNQsKC4idO0BfbKliaaL4VXrpWLo7VLJad0EfHDsoOf2+dkYUPQ\r\naETEhp4iR73+eoHVkVpHs7q19Mm2ePws/QOWmNfIv+F28q005AyTuKiCF7p/\r\n4OHLletPTS2GgJy5CwYjebt1/UtWxu+LB5CrfsK+bkbnw3on7pBDrue89r2k\r\ntq+1NQSd+PZdwLBkzmJtkdXdej5Z+FDGHe3nYPCEqgiXy8K5OQwpWDG53N0f\r\nAz2Uw3XwdDUtgIRhcRdvPd8P2PeTslT7hHm82QHvGygpZSCmJSM2eKS06vBz\r\n5tBz0DAo6D+xgO6JbpaOsMQY84AN5+lHpRk=\r\n=X+bb\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.9.1-unstable.68_1679584421166_0.7636186442762372"},"_hasShrinkwrap":false},"0.9.1-next.69":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.9.1-next.69","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build","build:clean":"tsc --build --clean && tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"^0.3.0-unstable.25","@sphereon/pex":"2.0.0-unstable.12","@sphereon/ssi-sdk-core":"^0.9.1-next.69+d229f07","@sphereon/ssi-sdk-did-utils":"^0.9.1-next.69+d229f07","@sphereon/ssi-types":"^0.9.1-next.69+d229f07","@sphereon/wellknown-dids-client":"^0.1.3","@types/uuid":"^9.0.1","@veramo/core":"4.2.0","@veramo/credential-w3c":"4.2.0","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.6.0","@veramo/cli":"4.2.0","@veramo/did-provider-key":"4.2.0","@veramo/did-resolver":"4.2.0","@veramo/utils":"4.2.0","did-resolver":"^4.1.0","nock":"^13.2.1"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"d229f07072144fc691a1e2dff575a7113373495c","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authorization request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst authorizationRequest = await agent.getSiopAuthorizationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authorization request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationRequestDetailsResponse = await agent.getSiopAuthorizationRequestDetails({\n  sessionId,\n  verifiedAuthorizationRequest: createAuthorizationResponse,\n})\n```\n\n### Verify authorization request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthorizationResponse = await agent.verifySiopAuthorizationRequestURI({\n  sessionId,\n  requestURI: createAuthorizationResponse,\n})\n```\n\n### Send authorization response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationResponse = await agent.sendSiopAuthorizationResponse({\n  sessionId,\n  verifiedAuthorizationRequest: verifiedAuthorizationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.9.1-next.69","_nodeVersion":"16.19.1","_npmVersion":"lerna/6.5.1/node@v16.19.1+x64 (linux)","dist":{"integrity":"sha512-0Q6FWTvQORwjt2aypkxB4LAubxtYu0h054C2tP8tN8o9idZ6LlmUTvwIKkyYN/hIwTj6v6i3OOT/2194dFJojg==","shasum":"2da7c04275ec4533626df1ecbaed6aad6d7ae3ab","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.9.1-next.69.tgz","fileCount":34,"unpackedSize":140120,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBbXuIejMbkdhPEfQl9eHgzTOYPqUrP9sGj/pSOnYve+AiEAgcgNxZIorr5V2YmjTvaopM/vESOMfsqszxHtIDjxUQ4="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkHZCXACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpMUg//WgsVTHhS+/OsLU1v7dtjVf/NtydsrE+xCaFcPeBvwNFWAWlF\r\nCRwjt3uFHP/aKD8kB+rf5j9ftl9VHiLea+OvXOwXjI0J8gq6wTgW1xWwtZSO\r\ndv5b/1vgVI4JIuqZCNVO3RB7sIfa9w4EYx+2ArI+GfwX9NVwiWVmFX4yi2wm\r\n360khilHa2VKWRsRgmpZ2VCRtSacA0HiXD+tg1nBsh85uW734psahFfCOcEC\r\nVoNz+T9OlOVEdl41FXJmd0wNzvOpPm9h/sDx0QFs3UldHI6xsP47MJWchbNL\r\n3pBASHZ2fZulmfVU1wU548uuqlOLwM0aADv8BAg4e23hkSN+RJBXaUXCwrUj\r\npn7ER7Qz7rPIWByNzCrsOYHZcWL8N5uHk7zPQzTxybOa5GNe9B4IfVEd8IuF\r\nCmKKfr/sMZ7bFpUF69c3QoMM/Ii2ivgDgVSfZemiKJ3y1rrCkjOqIwv62WcM\r\nLYptc+MAPJD8XKeuPZJyGIDFYtODH6V1rcOHO49oYjc3ZsplMoisfDcaoxYl\r\n7j+jZGf0L4iJTdQnfbC640Px8KrhCKWGwhx1wqf0TnvB3n7cr000YW8k9XWv\r\nhdExwnGFryWQ58Zl4/Qd03wZ4IdRL/zcpZumydTMd28uugT3U8NdI6LfXakP\r\n1Vap1SheGgkKXt9rf5Z4unSlILWglLTYVcs=\r\n=OiM+\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.9.1-next.69_1679659158845_0.47019773627627903"},"_hasShrinkwrap":false},"0.9.1-unstable.85":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.9.1-unstable.85","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build","build:clean":"tsc --build --clean && tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"^0.3.0-unstable.25","@sphereon/pex":"2.0.0-unstable.12","@sphereon/ssi-sdk-core":"^0.9.1-unstable.85+2a31791","@sphereon/ssi-sdk-did-utils":"^0.9.1-unstable.85+2a31791","@sphereon/ssi-types":"^0.9.1-unstable.85+2a31791","@sphereon/wellknown-dids-client":"^0.1.3","@types/uuid":"^9.0.1","@veramo/core":"4.2.0","@veramo/credential-w3c":"4.2.0","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.6.0","@veramo/cli":"4.2.0","@veramo/did-provider-key":"4.2.0","@veramo/did-resolver":"4.2.0","@veramo/utils":"4.2.0","did-resolver":"^4.1.0","nock":"^13.2.1"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"2a31791523e2053c51f99bd5f3bf66304d8e7268","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authorization request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst authorizationRequest = await agent.getSiopAuthorizationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authorization request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationRequestDetailsResponse = await agent.getSiopAuthorizationRequestDetails({\n  sessionId,\n  verifiedAuthorizationRequest: createAuthorizationResponse,\n})\n```\n\n### Verify authorization request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthorizationResponse = await agent.verifySiopAuthorizationRequestURI({\n  sessionId,\n  requestURI: createAuthorizationResponse,\n})\n```\n\n### Send authorization response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationResponse = await agent.sendSiopAuthorizationResponse({\n  sessionId,\n  verifiedAuthorizationRequest: verifiedAuthorizationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.9.1-unstable.85","_nodeVersion":"16.19.1","_npmVersion":"lerna/6.5.1/node@v16.19.1+x64 (linux)","dist":{"integrity":"sha512-ncFwIHYPLIYfLCBADg61nTjpBdq2Qqu6vBRk+2llerrMRhjBC4thhsBt5ekseErUuw43mSiSXcxN36rBZyWMBQ==","shasum":"2fff445edb6e97ccb86824dbf5189ae5e7e21ad4","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.9.1-unstable.85.tgz","fileCount":34,"unpackedSize":140136,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBUrjpwkL0IJ3fLVkEQ8iyKS66cQcowAaURjpNIknmkWAiEA5MXre/hbyvRWdUpOe4OXkb7vqUH+kyJML4QLOc0WP5w="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkIXTLACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp1Qw/+NsZLzdDKNLACFZAqR/lV2Jg8HRhA+/y/Ln5QODFZbHyxu0Xl\r\nHiWvcNOkVzNn25YZiTKiAvLTP1SCw/PjeetW0+z3t4cMzTKWbm9faXjlXqz3\r\n0nqwo85uuJmuyPciY40QiGzQDZveO+ArIpxLWBnI7wvdYS5rgvfG+aZhutiQ\r\n8X7Ms3x8BoWJ/xDntyhGMsu1RLtsApmkEzhVT4Tj+a8CVZywhp22blE1nGxz\r\nxMiUHzOqGT+v7JttwaVyo/Elrt8z0i+FBCEAKJW+Z4Nsc8D0+b6WVpaDNpeg\r\nyEEQ9Cb11bWl20qDWHTdshuwNBODMeQzznmw+p6EuwpthfbvlxGkEGRFkUlI\r\nWBxBmC1feNq5i0AK6S7C9T00bEOiCjjDFx6/94oJYWyImNgM8ljulf78iOHl\r\ngJUFVUnV0onNcGvm1SxZTv8zQkMbrZlzOoSosG20moKYSMKWiLB7iYiMktxs\r\nutmw5EM7b0VmySgdu6WM/9TrzdCOzkgjU/25OJZ0LMqKnvgckH/LJBCVmvtp\r\nS7pA6fqwx/psBED1XvFAUgvUd2Xom8gOXvQk9FfzwOTuFzTsN7uFxEat3qq6\r\nE1+NuUCGySqMrpW7qXbMRalw3ECBrc3ArsMBA7OCjlSh47n/MB5l6hForcDL\r\nLmn0QGzKmlkUKPriIlBt/qs01Slsin2aXuo=\r\n=fErK\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.9.1-unstable.85_1679914186829_0.9069517379718726"},"_hasShrinkwrap":false},"0.9.1-unstable.87":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.9.1-unstable.87","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build","build:clean":"tsc --build --clean && tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"^0.3.0-unstable.25","@sphereon/pex":"2.0.0-unstable.12","@sphereon/ssi-sdk-core":"^0.9.1-unstable.87+fcacce8","@sphereon/ssi-sdk-did-utils":"^0.9.1-unstable.87+fcacce8","@sphereon/ssi-types":"^0.9.1-unstable.87+fcacce8","@sphereon/wellknown-dids-client":"^0.1.3","@types/uuid":"^9.0.1","@veramo/core":"4.2.0","@veramo/credential-w3c":"4.2.0","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.6.0","@veramo/cli":"4.2.0","@veramo/did-provider-key":"4.2.0","@veramo/did-resolver":"4.2.0","@veramo/utils":"4.2.0","did-resolver":"^4.1.0","nock":"^13.2.1"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"fcacce8a15dc0d1555c57afa143c25116bda8224","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authorization request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst authorizationRequest = await agent.getSiopAuthorizationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authorization request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationRequestDetailsResponse = await agent.getSiopAuthorizationRequestDetails({\n  sessionId,\n  verifiedAuthorizationRequest: createAuthorizationResponse,\n})\n```\n\n### Verify authorization request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthorizationResponse = await agent.verifySiopAuthorizationRequestURI({\n  sessionId,\n  requestURI: createAuthorizationResponse,\n})\n```\n\n### Send authorization response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationResponse = await agent.sendSiopAuthorizationResponse({\n  sessionId,\n  verifiedAuthorizationRequest: verifiedAuthorizationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.9.1-unstable.87","_nodeVersion":"16.19.1","_npmVersion":"lerna/6.5.1/node@v16.19.1+x64 (linux)","dist":{"integrity":"sha512-BcvC7XDDGQ7s6XYEPV0Jo6o3hhNTQdHUXi0b5cMz1KTRhaJrXDmjZboK/qzGVLACPYdDrrcahTSknn7M0njvwg==","shasum":"d125af48e917fd9ae4fc0c4a50de78a2a5932f77","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.9.1-unstable.87.tgz","fileCount":34,"unpackedSize":140136,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEJcPiyGV6MpnVsbbU4arb3utuyL0Gq48Ee9nPIGwIj9AiAt0eS+y+nqlkAXVFOx+pOTafTuVpz28gOKQP5xsK3T8Q=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkIYeBACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrEdA//dqXJP5f7x5ce6DBrNrHghlxd1CnqfWs4tRmf0FcIMvilqHI/\r\n9yIM/HE3UectNlrqh8UFNVJitHipBBsbG9FDDUFelp8HPMT9wvSCArnaiUz7\r\nePX7w7xt/Ty8s8zBKnDkQ8kwU/FFmmmBTD8IadMyfa+o7kWrNmojo9bRroKW\r\nQn8/3sk2syTz+hSlGZDZXJ3YFtR74l4vJeTU6a7LhmeYq+e8n/CBmThgcjqO\r\nTEIURTkTDau0KdCthrmmU8BLvyp2CpXmNimU3lISfzO7B4nXMI1wJ+O3cUAb\r\n/MlNmxmcClcBhLOlH1U7IbxPuzz75W7W9lquU8WDENO0d2tuAvqojInFYNnN\r\nwvxny+QPCCxgW/LU9SJ5EtreEhbebODWjvMV+ms9Dc9eHpw5eIjaasrH89Y/\r\nK7LVhrIKGiK7+0p1UNz6oReC7Z+LHk10ZIzNJJ5T1MLvEQyp1qzoMoxvjni1\r\nIOxmS4a+TqrO/6UFhaaWI3JZo6c+K9hb7n2+8JehJctv+xGtxxjTmBtwMbVt\r\nN+lfXPWCt27tcDZKBfE4PS3kLVMhELzKP1Up9D5qGTG9UpliZ3Lg6eDyORYX\r\ncbu4XS0J1EfXkI7SNdK8zOSySfBb6OYTlzspP8yyuBzCMrVnu06bx4+9fQ2S\r\nyHj1QsccnFQ9TU4GH/93HW+00scW5yxz9ME=\r\n=usdi\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.9.1-unstable.87_1679918977730_0.6562186395160887"},"_hasShrinkwrap":false},"0.9.1-unstable.88":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.9.1-unstable.88","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build","build:clean":"tsc --build --clean && tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"^0.3.0-unstable.25","@sphereon/pex":"2.0.0-unstable.12","@sphereon/ssi-sdk-core":"^0.9.1-unstable.88+bc20d25","@sphereon/ssi-sdk-did-utils":"^0.9.1-unstable.88+bc20d25","@sphereon/ssi-types":"^0.9.1-unstable.88+bc20d25","@sphereon/wellknown-dids-client":"^0.1.3","@types/uuid":"^9.0.1","@veramo/core":"4.2.0","@veramo/credential-w3c":"4.2.0","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.6.0","@veramo/cli":"4.2.0","@veramo/did-provider-key":"4.2.0","@veramo/did-resolver":"4.2.0","@veramo/utils":"4.2.0","did-resolver":"^4.1.0","nock":"^13.2.1"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"bc20d25d9b58688fa745e6e1020979ad936025c0","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authorization request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst authorizationRequest = await agent.getSiopAuthorizationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authorization request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationRequestDetailsResponse = await agent.getSiopAuthorizationRequestDetails({\n  sessionId,\n  verifiedAuthorizationRequest: createAuthorizationResponse,\n})\n```\n\n### Verify authorization request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthorizationResponse = await agent.verifySiopAuthorizationRequestURI({\n  sessionId,\n  requestURI: createAuthorizationResponse,\n})\n```\n\n### Send authorization response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationResponse = await agent.sendSiopAuthorizationResponse({\n  sessionId,\n  verifiedAuthorizationRequest: verifiedAuthorizationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.9.1-unstable.88","_nodeVersion":"16.19.1","_npmVersion":"lerna/6.5.1/node@v16.19.1+x64 (linux)","dist":{"integrity":"sha512-fcEv2B3GjKiC6LwbAm4jTQvagApKw1sGmmdiEU4H8N2c9XVnbw5zsDAMKDZbQoczK0kAhCI9QsGGk0eRkLbJxg==","shasum":"eed5a0b3ee18ad36370e025d58c7e957fa64ee07","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.9.1-unstable.88.tgz","fileCount":34,"unpackedSize":140136,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHVME9bHrC9HIH3vYm22cTKNUZ7HEZsovmzU/wqZZv1xAiApYIR46Rc4JozHsnnDE4efz5lCSUeJzesWCz0fPEnykA=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkIYgZACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrCChAApNFa3UJr9m9fcPUlPIxjs+ycnQpzDvsDdF2N1yU2YIy7gWCz\r\nWoD4T2S9MuV/Zu65NsagwGBr+reyFhG5UfN3Lv8S5ZqwYNk7ZW4kKlOmzKN+\r\nveOwCjB6aNoMWm2Bc262IT4To2bTLhhSO0zvBOm1199ya+ySn/uoxwRyQiTX\r\nFSq9z37ofShvPtVER+FLXiPNyqdEAzeSBxGzGVFtgHzC7DTQY1O43ht/K8xe\r\n7OOQN9WOSFruGy6EJ46lGtasgypTmRQKcaGvSN/1iHwN+jGRLunCldhLn9b+\r\nyItquY2tSEgFuy97o1wknKDRcOjnsdIohvIHkhMlcWJePlK01wICqDfP97eP\r\nNuhTj85ZOqiTcmHT8asb20jwrlJLUbkZXQK9XUspgoscjNexVAE3o7+RGJdl\r\nfCs1B9BBausvxjBokMVWkgUsdXqPDP0RNGfgaWvMg1fM5vqBNB5X8mh200fv\r\nSPHz2ooN/zlFfFTiD5gEF0SmuWDfJ0jAa1mwamMR6n65cRdFVQYXgYOWOzJN\r\nwo1PlzrDYwg0Akie21BerjqgtCD2CSCqxqmtTjLbvDaIGt0BemvlFPGppXDH\r\nw6hlvbX0nhH+6MUX8z5zFgqZWNdvgdnfplzAHXDRTrTGcS39/DK2T5MoeHoN\r\ngV1uLZRxDRpdNBi6hQ6YW/pTIb1IdDQ9mc8=\r\n=KVFn\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.9.1-unstable.88_1679919129140_0.019543351891502025"},"_hasShrinkwrap":false},"0.9.1-next.89":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.9.1-next.89","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build","build:clean":"tsc --build --clean && tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"^0.3.0-unstable.25","@sphereon/pex":"2.0.0-unstable.12","@sphereon/ssi-sdk-core":"^0.9.1-next.89+163fa09","@sphereon/ssi-sdk-did-utils":"^0.9.1-next.89+163fa09","@sphereon/ssi-types":"^0.9.1-next.89+163fa09","@sphereon/wellknown-dids-client":"^0.1.3","@types/uuid":"^9.0.1","@veramo/core":"4.2.0","@veramo/credential-w3c":"4.2.0","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.6.0","@veramo/cli":"4.2.0","@veramo/did-provider-key":"4.2.0","@veramo/did-resolver":"4.2.0","@veramo/utils":"4.2.0","did-resolver":"^4.1.0","nock":"^13.2.1"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"163fa09b8b1dab08dd59e07ddd28d4d0802fda5d","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authorization request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst authorizationRequest = await agent.getSiopAuthorizationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authorization request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationRequestDetailsResponse = await agent.getSiopAuthorizationRequestDetails({\n  sessionId,\n  verifiedAuthorizationRequest: createAuthorizationResponse,\n})\n```\n\n### Verify authorization request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthorizationResponse = await agent.verifySiopAuthorizationRequestURI({\n  sessionId,\n  requestURI: createAuthorizationResponse,\n})\n```\n\n### Send authorization response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationResponse = await agent.sendSiopAuthorizationResponse({\n  sessionId,\n  verifiedAuthorizationRequest: verifiedAuthorizationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.9.1-next.89","_nodeVersion":"16.19.1","_npmVersion":"lerna/6.5.1/node@v16.19.1+x64 (linux)","dist":{"integrity":"sha512-tcLLlc9Vy8u8zEQBWhR8JidaTx8Mbzcc+m2LcPgZ92sHH0M3vnQ90ZhhWSfKN13yl17VGsL3LZRfxja3UnZL7A==","shasum":"fa6e6c8feba90ae369b3aaed244d6933afcb3222","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.9.1-next.89.tgz","fileCount":34,"unpackedSize":140120,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDAkU2e7WKfYrm0sJ4juI4lgX8FcAkdiRiXPnoutQvnjAiA/rGJq/d9B3qSI9N1CtrMIQ/4b7YE+Kt0N0d8+S8c61g=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkIgviACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrrqQ/9GTcacgz971UJ7F9u+BDfAd7z0dvwqFdWsTLgUkx9RTdbH0NV\r\nx6KtC5Jht5TDkEN4xsOCMOwKGjpWzerAaQLJlAaonJdcWJzH8j7UGlcyNQP6\r\nmEyF+CCL4VfEo3snwm4CZM0mF5uIdHEyaid1NbJfkwf2F4djyBxuU8m3w4lS\r\nowULOHMRFhbOzX167txqiPykioPmxXS6KREGjCZQ8+Mt1YvetGXu5wGDLT7/\r\nF3OQufo3TBmhehKzTthPQ5g+Mf3hG0TWH+/dD0BlrdyxY80QUA7UnhhFbCQ+\r\nt5kmI3vPeyMEsH5Pld8pDS/AgHJbYTyQiWOlY3lvKZaUuAU0lmrh6AnIoUvw\r\n8DZcCLo1OPefXq2J0J3TQeBnJ6JfjI/LOE2SJdcN6PjXWPiIG7ovNERUiS0w\r\nd0paozMEsNXgRAuze3UVIlT7nKD+XBb2Q9ocOzRxDCHo5XBE8a22cshhS+8T\r\nfNNDBhoPTw0wtikDHsdr825wzN34zjsz8LUHI6AEY2I1JcxC7hawY+9fmt7w\r\nEEw9/tTNQ2y8j9x0NWfonPYFHTFk2vhpuj6qGRCp1v9hPG820Q+Fu3OSsNG8\r\nd+6U8FB5qXv4G3bqv9y5iH8du4O5yEOPR1YCUNV7BmecAfCPw2R2SodXogZC\r\nF9MlibRohiT2FY+QZfjoeiUBuJvjWN0avPc=\r\n=4jOl\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.9.1-next.89_1679952865735_0.42802225104141756"},"_hasShrinkwrap":false},"0.9.1-next.96":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.9.1-next.96","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build","build:clean":"tsc --build --clean && tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"^0.3.0-unstable.25","@sphereon/pex":"2.0.0-unstable.12","@sphereon/ssi-sdk-core":"^0.9.1-next.96+2aadaaa","@sphereon/ssi-sdk-did-utils":"^0.9.1-next.96+2aadaaa","@sphereon/ssi-types":"^0.9.1-next.96+2aadaaa","@sphereon/wellknown-dids-client":"^0.1.3","@types/uuid":"^9.0.1","@veramo/core":"4.2.0","@veramo/credential-w3c":"4.2.0","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.6.0","@veramo/cli":"4.2.0","@veramo/did-provider-key":"4.2.0","@veramo/did-resolver":"4.2.0","@veramo/utils":"4.2.0","did-resolver":"^4.1.0","nock":"^13.2.1"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"2aadaaac883e78141d67ebb8e8a9dc3574a0da78","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authorization request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst authorizationRequest = await agent.getSiopAuthorizationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authorization request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationRequestDetailsResponse = await agent.getSiopAuthorizationRequestDetails({\n  sessionId,\n  verifiedAuthorizationRequest: createAuthorizationResponse,\n})\n```\n\n### Verify authorization request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthorizationResponse = await agent.verifySiopAuthorizationRequestURI({\n  sessionId,\n  requestURI: createAuthorizationResponse,\n})\n```\n\n### Send authorization response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationResponse = await agent.sendSiopAuthorizationResponse({\n  sessionId,\n  verifiedAuthorizationRequest: verifiedAuthorizationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.9.1-next.96","_nodeVersion":"16.19.1","_npmVersion":"lerna/6.5.1/node@v16.19.1+x64 (linux)","dist":{"integrity":"sha512-R2qF0pDor0Z/oVYdwjDOS5VdXIJGzNQi4tH313mz9gaBIuTKvLXzGcBaYikwKvkWpQRGzldXOqbIjN+XD2720w==","shasum":"d5a0614d2d00f1f3b07cd96a716e94ba8dfa1d3f","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.9.1-next.96.tgz","fileCount":34,"unpackedSize":140120,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC/TicERcN8oSQJabYi+KVsCHPN8JqGLyEGvtKWvNF6JAIhAMTPVqpR1kJqANIm4RaAOuuoWKY3XrFJL68HxX6t+Zyc"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkI/+8ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrBMxAAmpNLKumXnUPb6TvZYlSlZXBSWsZ+CbMjUPYczNsEVvaNYOH+\r\nIvlMXQVG86hobsP8OmaR134XW+pkepVkkTCK2ZoIYqbgPUJ6VuLWCIUYLrdR\r\nq1UlSYzcMcD94JUf3GK2+AGQWHDSEnVD4wvZDlZl9SU/TErWu5KYL7s9eCis\r\nD4XJHJ9xDxMl+UqQuC4nuIVfjobi4NbCyY/LE7I6iytFceHBq4buFurF6Kho\r\nqs6/rCPa10pM6euQa5sBLc5qA85I3fBFp7t/aC4LTQixph821ZDwEU6ZERvK\r\nynP9KefldaA4WhUWbOx/bAoG5D2WQ9XM38U0rALH3m+X3MYhh+1gjy4i79SW\r\nIbDeK+TuPurfBUfeCz9Q607yhRhqnoTp17jhzP04+gJ++JPXnhO11eAsFbCL\r\nA+m/WRurJsg9FDgIT1wH16Mm0K2gmfz/daHoyhiIP/BhD7iMyDy5eypDGHLY\r\nkFZMcR0iAmBVb9h+5IEC+lOobxK8zL02l9yzNd8lzL9Uep15pgRmcQapFN+c\r\n6u5uGWlbyMqR9x9vvHufzZzq05W/9arPZY6K9deO/JAC2+2c2Q5n6CArZ4MM\r\ne0GNeZRnoAbxBTzPVIuOf7S6U5pTPsTR3+bVFaejjCCaA/3J9uea5cY75btD\r\nhWJljR/82Mtuu0YK7XrGfG4wdWdmJbPjyvA=\r\n=nOaA\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.9.1-next.96_1680080828655_0.9060502123091203"},"_hasShrinkwrap":false},"0.9.1-next.97":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.9.1-next.97","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build","build:clean":"tsc --build --clean && tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"^0.3.0-unstable.25","@sphereon/pex":"2.0.0-unstable.12","@sphereon/ssi-sdk-core":"^0.9.1-next.97+c75ff12","@sphereon/ssi-sdk-did-utils":"^0.9.1-next.97+c75ff12","@sphereon/ssi-types":"^0.9.1-next.97+c75ff12","@sphereon/wellknown-dids-client":"^0.1.3","@types/uuid":"^9.0.1","@veramo/core":"4.2.0","@veramo/credential-w3c":"4.2.0","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.6.0","@veramo/cli":"4.2.0","@veramo/did-provider-key":"4.2.0","@veramo/did-resolver":"4.2.0","@veramo/utils":"4.2.0","did-resolver":"^4.1.0","nock":"^13.2.1"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"c75ff124dd85cd4e19e536324fb5a8c8dae4910e","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authorization request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst authorizationRequest = await agent.getSiopAuthorizationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authorization request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationRequestDetailsResponse = await agent.getSiopAuthorizationRequestDetails({\n  sessionId,\n  verifiedAuthorizationRequest: createAuthorizationResponse,\n})\n```\n\n### Verify authorization request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthorizationResponse = await agent.verifySiopAuthorizationRequestURI({\n  sessionId,\n  requestURI: createAuthorizationResponse,\n})\n```\n\n### Send authorization response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationResponse = await agent.sendSiopAuthorizationResponse({\n  sessionId,\n  verifiedAuthorizationRequest: verifiedAuthorizationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.9.1-next.97","_nodeVersion":"16.19.1","_npmVersion":"lerna/6.5.1/node@v16.19.1+x64 (linux)","dist":{"integrity":"sha512-m9zX9XjwB5xJuVWFAU9XxiL67ZySjpgcfAcgD5U0P7hgctiArajXqdG6eyPSa4SiQJ457rEZAduhue8OIky75g==","shasum":"d8410315dc226cff97ebcb8e32514ef234c38541","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.9.1-next.97.tgz","fileCount":34,"unpackedSize":140120,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD8CETdM/Fh/NiCRHvEy45BDzTPilABYXn/JjQuZbR0dgIgPL+xdMr4jr/m4gTAqZMk5xfqxZcDKjQdzy7nd7Wy9uE="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkJJA2ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmpplw//e9plTjJMX0eqBbGZj/en5UOz3njxBId7G/Nr2SwdYFh4qI7o\r\nm/ZEX7AUQxu7RJLSD6A/VsiuGvy98RopKY6P1IYfi+MweD/u5YyLq2fsSSm3\r\nOAF/889lJgXUDcvoUwSMNPELhIM/q83pUBUQyb+ZTqWXBGtD4AIomUhMTPj/\r\nG4RTkWZKBJ37uN3QduGYbR0Lp10OefWVmp81VcBqVKxLYQWIrw6NoLMOlPtd\r\n23Gq6xmFgpsd0j3Hg1ocJCRbksrrtt0TJF3hGD42HD19Nk5WvhLykaCxwZ6G\r\nClZ5Z+g2yjiGp+CDPcCxpqXAN8G3T3MTkU0PSlZg3O7+XpnKG55Jzt2WhPtP\r\nj2lFP0NypkgX3XsHkuVRDasLeVHi56gGyzTsUPwql6DGx/i8A3SfPyyLtkGf\r\n7+f3SdpQA31sSpD2ksxvR3Yv2aq6MDQoIX8n1SHFrzrD/aMngek6XGPzGefh\r\nhiemd6mnHRHVgsYXOQ3j1mdb3mIqr5WDwUMcI3Vwqjp/h8qSEL+yJe2ZnatR\r\n6yYLC/qZci4Ax3rQ7LXWXuWp6KfOC5c50vCuJcIQYMOEsLd/mk57HxwqPF6h\r\nvd+2WcvoB+J0RcWHmhE1wS21fThJvuHZaLEczXG9ykHjRkoGrfLm1SsqAAEM\r\nk/JVPDtmFr9kqLY17aHA2jLper+qlSBYhzI=\r\n=KVuD\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.9.1-next.97_1680117813828_0.76579274410294"},"_hasShrinkwrap":false},"0.9.1-next.99":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.9.1-next.99","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build","build:clean":"tsc --build --clean && tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"^0.3.0-unstable.25","@sphereon/pex":"2.0.0-unstable.12","@sphereon/ssi-sdk-core":"^0.9.1-next.99+7c555dc","@sphereon/ssi-sdk-did-utils":"^0.9.1-next.99+7c555dc","@sphereon/ssi-types":"^0.9.1-next.99+7c555dc","@sphereon/wellknown-dids-client":"^0.1.3","@types/uuid":"^9.0.1","@veramo/core":"4.2.0","@veramo/credential-w3c":"4.2.0","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.6.0","@veramo/cli":"4.2.0","@veramo/did-provider-key":"4.2.0","@veramo/did-resolver":"4.2.0","@veramo/utils":"4.2.0","did-resolver":"^4.1.0","nock":"^13.2.1"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"7c555dccaa9c361efc4516f7cd5e8583ca07a146","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authorization request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst authorizationRequest = await agent.getSiopAuthorizationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authorization request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationRequestDetailsResponse = await agent.getSiopAuthorizationRequestDetails({\n  sessionId,\n  verifiedAuthorizationRequest: createAuthorizationResponse,\n})\n```\n\n### Verify authorization request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthorizationResponse = await agent.verifySiopAuthorizationRequestURI({\n  sessionId,\n  requestURI: createAuthorizationResponse,\n})\n```\n\n### Send authorization response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationResponse = await agent.sendSiopAuthorizationResponse({\n  sessionId,\n  verifiedAuthorizationRequest: verifiedAuthorizationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.9.1-next.99","_nodeVersion":"16.19.1","_npmVersion":"lerna/6.5.1/node@v16.19.1+x64 (linux)","dist":{"integrity":"sha512-11Q1Ili/h7bPz8OoIBrd5iPe5w+mg2HhMzfLyurDJMcq5MjtkH/xjFLFXju1PAQTQC6NsihCzUz/4md0Nzlw3A==","shasum":"636485530169395bde1218ca740f43942061b06e","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.9.1-next.99.tgz","fileCount":34,"unpackedSize":140120,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIATigNir17il/xv3lqqy/8fW9s2zCc9+t8d+KAetkMv/AiBMSPrJiyrIZXYCgmhvLj/aZalHlCZJHB0oZELAAdimVg=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkJJDbACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrCxRAAiopDVC82WeutSfNJwp5IBTW3V6dYOfZXdDyX7ecnxXEMgeKE\r\n1grZIT/Kq/wfYxWYpTAQc9sKiYM0uC6X1f5LaTCQaP6T0Jmzlu2VoH+9kx/T\r\nKsPAocS/MqGs6EH+2s8S9vZC/3xV2+2BSwOtDj0nvYc3wPZWVlB+Bq3v33Qr\r\nWyboIrZKv2hQdJRbY0BWzMTorOByoMVPco+x88kOFpNtsAv39UNgjbodhcJ/\r\neykpdShT95T2rejpuuHngBMjSMFP98LgqLCLHkexd8fTPa6vJSZZSFIpMd1p\r\nghpMQriCN4Bb7gFr80soHJB/HNIQ9bppakcJSdisD6y27SEYiPysZ1zeGZRF\r\nrnmEW6gNmZL2loE8BFzA5CS30WKwJwcR3al4xeUmaapL40AzRAcycIb5fWJG\r\nOCldRMEaSygnLQPgQXXA9itmX8bHLs2CBaTI3OcYPH4IIfdclqS0bfyMuYqo\r\nTq0x7DCFWMDtlmCRyUbvlhw7CyDM6FG1FB3G5vgTsdCioBM+Ke7qVUW2vti1\r\n4WD78Zy4KrEBNEs9AmDEdMvbJ+EshwiqzMGCGDGCwwj+EsL7+cSLHXZlM5gf\r\niNHI/D98ub3y9a/X5YUIt8nebhFs7a50AHfO/vzJiBHtsVExdYIVjXJezgMg\r\nQkDqY1t+bi4S9vJAPUzCHZ7SMc1upA0HvVU=\r\n=vjPb\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.9.1-next.99_1680117979209_0.8459168434584377"},"_hasShrinkwrap":false},"0.9.1-next.100":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.9.1-next.100","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build","build:clean":"tsc --build --clean && tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"^0.3.0-unstable.25","@sphereon/pex":"2.0.0-unstable.12","@sphereon/ssi-sdk-core":"^0.9.1-next.100+d77ff41","@sphereon/ssi-sdk-did-utils":"^0.9.1-next.100+d77ff41","@sphereon/ssi-types":"^0.9.1-next.100+d77ff41","@sphereon/wellknown-dids-client":"^0.1.3","@types/uuid":"^9.0.1","@veramo/core":"4.2.0","@veramo/credential-w3c":"4.2.0","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.6.0","@veramo/cli":"4.2.0","@veramo/did-provider-key":"4.2.0","@veramo/did-resolver":"4.2.0","@veramo/utils":"4.2.0","did-resolver":"^4.1.0","nock":"^13.2.1"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"d77ff412cb9da4de9e5932c82e1eae142a083172","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authorization request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst authorizationRequest = await agent.getSiopAuthorizationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authorization request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationRequestDetailsResponse = await agent.getSiopAuthorizationRequestDetails({\n  sessionId,\n  verifiedAuthorizationRequest: createAuthorizationResponse,\n})\n```\n\n### Verify authorization request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthorizationResponse = await agent.verifySiopAuthorizationRequestURI({\n  sessionId,\n  requestURI: createAuthorizationResponse,\n})\n```\n\n### Send authorization response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationResponse = await agent.sendSiopAuthorizationResponse({\n  sessionId,\n  verifiedAuthorizationRequest: verifiedAuthorizationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.9.1-next.100","_nodeVersion":"16.19.1","_npmVersion":"lerna/6.5.1/node@v16.19.1+x64 (linux)","dist":{"integrity":"sha512-5tE5K/W5xNkCbl7CGbNJvqeiHjTotVb9BvKHTLkevPYm/cs+GE6nOJJJhMZFKAYG2+N7WIw0c30gD301z6ZJZw==","shasum":"195fb98e15716df8275ced246d362514df181442","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.9.1-next.100.tgz","fileCount":34,"unpackedSize":140124,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCicc/HDgyDXMz/KjnSxNxEIW0YyXV6TaY8mu1fMxcNqgIhAIOH8uM7Wp/VvOG/kXJGR0qd43VmrHW0gmpmGapyAyGf"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkJJMIACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmr65xAAjdUi58UcfRc4RHVkPLtulknz8eNJtsLvfsZKPnHrqZNCmEtw\r\nGegQJ41vtXqW4VH2uxWDAJHpe5BKzKyNk7G4SvMm0KlihEBIYQKmRSatRLqq\r\nJD6b8G8Yaeg6Tanms21KA2GzuqgjJRIs5j1oI4DKw7ETzq0R1EIlIG4Kbwp4\r\nI5YNBY2Nr4gZpP7gHOzRXLoWEOUTJD3gbnZap3Nn1JLuidzYLyVqfJTsKpGK\r\nD+StYB/jJVPRGcwsdLS7Thk5//WI/aLTVpkJuHHq6QpLNNcV1gXmEsy0lgtq\r\npgnzsLB0GHdHRbZwiF0n00KoNVGmNS0x/PSMbXlDCbXmwzOuau3rjt16K2g/\r\nWMEff46KRIq6s5wtY4UDeW6ZrO7rzqjETqznNyqZHvJp/BcM94swFUF4uZP3\r\nfcdFQXgY2PuayHPD09QsYaaLN/75zloZiudxWUhqK9+RBKa62/ZpHPko00AJ\r\nolzyyXsi8f5QJaqfsPyOZc2cB9e5QMtXhb4ZPDqemyV2jJZiMYz4VRzN+zoB\r\nznDDM9xTNe6E7NaRm8fC+j3y7oqrAuENr6NVS8ngsLsygYnvKEzMSVEfyJtQ\r\naIv2eOvxhYa6w0bCPWDovyeapfr9ANmDbnwgichzkJrdDytMxB9SmvybUNvD\r\nfRutAoxjQ/rBwMlaa3SJcS95A93NwW9b2Mo=\r\n=ElEF\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.9.1-next.100_1680118536620_0.02366144071561682"},"_hasShrinkwrap":false},"0.9.1-unstable.101":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.9.1-unstable.101","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build","build:clean":"tsc --build --clean && tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"^0.3.0-unstable.25","@sphereon/pex":"2.0.0-unstable.12","@sphereon/ssi-sdk-core":"^0.9.1-unstable.101+fafa982","@sphereon/ssi-sdk-did-utils":"^0.9.1-unstable.101+fafa982","@sphereon/ssi-types":"^0.9.1-unstable.101+fafa982","@sphereon/wellknown-dids-client":"^0.1.3","@types/uuid":"^9.0.1","@veramo/core":"4.2.0","@veramo/credential-w3c":"4.2.0","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.6.0","@veramo/cli":"4.2.0","@veramo/did-provider-key":"4.2.0","@veramo/did-resolver":"4.2.0","@veramo/utils":"4.2.0","did-resolver":"^4.1.0","nock":"^13.2.1"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"fafa982bef719986aacce61ac59d2cba1685744c","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authorization request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst authorizationRequest = await agent.getSiopAuthorizationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authorization request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationRequestDetailsResponse = await agent.getSiopAuthorizationRequestDetails({\n  sessionId,\n  verifiedAuthorizationRequest: createAuthorizationResponse,\n})\n```\n\n### Verify authorization request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthorizationResponse = await agent.verifySiopAuthorizationRequestURI({\n  sessionId,\n  requestURI: createAuthorizationResponse,\n})\n```\n\n### Send authorization response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationResponse = await agent.sendSiopAuthorizationResponse({\n  sessionId,\n  verifiedAuthorizationRequest: verifiedAuthorizationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.9.1-unstable.101","_nodeVersion":"16.20.0","_npmVersion":"lerna/6.5.1/node@v16.20.0+x64 (linux)","dist":{"integrity":"sha512-E7qR9jN8K3tFIqxQEiRspZnY++3nOdVUXV14ODM4eEb2lQZEFxNmM67QVQF4LpbUWz3+qwYoMR3bHYB0kjOV+w==","shasum":"85b4f6adfbb347b0d934fe7056f8ade87cf6fb51","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.9.1-unstable.101.tgz","fileCount":34,"unpackedSize":140140,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDcpYX0Pk4YtxoiQr6s4hd+N0gfIuLf9o+t8/ofYHQuVQIgCJmYK6i2M9986Tzp4kkQFagzzPE8s+CjSJ8tkTZ0QIs="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkN899ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmq3oA//X7a+ux27/Yj4wq/zHDP+I29j7l4AjjC9URWHvo8taE6XtSAW\r\nQTZoj20AIFf/7VNtJjq+vrr9AKlGk/hb04T6IEm+HuWirggyXYpEiYkPKxlh\r\nI5I1hCoETbiwO1fcOv0eUHnTgs0arnEEiE5l+ZNuEQdelVyxhTnA+zAEYSMz\r\nBsEDtQz78Cw3N96mkEnufNcQoUvhhhESm/SR79PLa0kGW2yazQuzLtr+Ikn1\r\nxEbjojX/OQ89KPYuxygahEuyjf9O2562rHhZsXNAvIpJSR4yNsQHfyQO7jfa\r\nsbvuhcFceKKejVX/Ru9ecWBHTUs0LWOJVDQYXa0OWZbs+i8quoS/Yu/LbRv3\r\nxih3ZbqvEeHCGR/l//K9izP/jaImxwM7M9S+lZbLscLdYR+sDXiIc3EGkZA6\r\n6WLTf9u9dUV/uzsvWiGDLtG62rWmADqa/6mJRzr5IzLCBma/gjQXDwT8Wiks\r\nSTnaYR3+D8lkd+bHHb+DCRhzTsfM9mPF9KaJD7GL5vYiBkruNgWqbb8+JrG3\r\n7DSrhXKW+cAwu5FY3ZjvZRPmZh1edwgpGeEZVs8/ARn0gCaG/7Xp0rpQUFaB\r\nmutQcHXid0hLB6ZZi85dPlcYxWH8S6d5hhMhmSy53j50AhooxuEDsGzwYTuF\r\nDum+arPy0dNa85YXTIy5/ECFXRsWNsx3/qA=\r\n=vhh9\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.9.1-unstable.101_1681379197483_0.7370179410280335"},"_hasShrinkwrap":false},"0.9.1-unstable.102":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.9.1-unstable.102","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build","build:clean":"tsc --build --clean && tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"^0.3.0-unstable.25","@sphereon/pex":"2.0.0-unstable.12","@sphereon/ssi-sdk-core":"^0.9.1-unstable.102+21fe47b","@sphereon/ssi-sdk-did-utils":"^0.9.1-unstable.102+21fe47b","@sphereon/ssi-types":"^0.9.1-unstable.102+21fe47b","@sphereon/wellknown-dids-client":"^0.1.3","@types/uuid":"^9.0.1","@veramo/core":"4.2.0","@veramo/credential-w3c":"4.2.0","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.6.0","@veramo/cli":"4.2.0","@veramo/did-provider-key":"4.2.0","@veramo/did-resolver":"4.2.0","@veramo/utils":"4.2.0","did-resolver":"^4.1.0","nock":"^13.2.1"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"21fe47b972573ef0d1bd27ba112bde191716895d","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authorization request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst authorizationRequest = await agent.getSiopAuthorizationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authorization request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationRequestDetailsResponse = await agent.getSiopAuthorizationRequestDetails({\n  sessionId,\n  verifiedAuthorizationRequest: createAuthorizationResponse,\n})\n```\n\n### Verify authorization request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthorizationResponse = await agent.verifySiopAuthorizationRequestURI({\n  sessionId,\n  requestURI: createAuthorizationResponse,\n})\n```\n\n### Send authorization response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationResponse = await agent.sendSiopAuthorizationResponse({\n  sessionId,\n  verifiedAuthorizationRequest: verifiedAuthorizationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.9.1-unstable.102","_nodeVersion":"16.20.0","_npmVersion":"lerna/6.5.1/node@v16.20.0+x64 (linux)","dist":{"integrity":"sha512-Dn6W+qVpBkc4jwWdAIUJ1XiBYw9m7CupKLAFCbsreP+RG+yWMFjF+v4uDvLS7W80ZUtTRLs/FFZcYWpi5ueTcg==","shasum":"8234e7dc1560426a67cb664ae0203aafdb76bb15","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.9.1-unstable.102.tgz","fileCount":34,"unpackedSize":140140,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICYCDj+Wbvwvui0hQS+MFOoBEthorKh4aTd2vquDzzy3AiEAmb9Wu0cEJfEpRi1u+MpCse0Y7fEi+rYKG8Uy+yJBes4="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkOVIBACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqYkxAAo5YZ5iXghuFQlLOaW3t8D5kZ7AL1GFKgwBVSSAjM6hB8cnxA\r\nUU/AnlOkcPUUplI/I/uKQJ/IsEJldLV1TOoIvMMVzj10poWkL5CtSlOlZAtq\r\nmc6mStZtDWZbl5JT7pegi3zICNzr47MibdQsBadEiGxl19sKovnovFuuEh7r\r\ntC/uyFwX297Ukq8TVOV++yTH4skFcsM0p5A6/tgh3y/YKpYLH+/yHE6Vz0Yk\r\nsnH0XgJt2Fm4WOPLz5IQ03rVO07+cqCevHiyrjeBWGpova6vKSZ3HBtcBSFC\r\n/DztAG6oQpSl9mh1MpTTcYZMmxUopDEPp1NGZp2b0F+bUbwiF21dmYz+gvdu\r\nXsfh7YTG++o/ZChuaWQ4A1JWTSPXk6UZ8uhMgUtG1jPWKQVYPraAspfyrAnX\r\nSvMSKcsxyCF6daWvKkOun2WCPZ9Ke2SSZL56QuRm0xwO/cC2Nysg0Q43Oie1\r\n9Hqr+5hJqnzdgzgaPXliRqv96ZtZ7SoACvmC9wWZXQK8RZkStEzuTqtNkA1i\r\nUgts9GWkM3al+pZv8xMn2sWTO1uD0ef1HfCGaYNmNVB2IQD5G4B/WoeYjq7W\r\n0pc0F6bXDjNuhH91q8xdrEig305IHE/PyNstbByVMqJgHQpyjI+pyFVh1r+9\r\nxkzykN8lneyr2V9KtViimIhvCDRcDfIP0Qk=\r\n=y3v9\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.9.1-unstable.102_1681478145691_0.17839074729406446"},"_hasShrinkwrap":false},"0.9.1-next.103":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.9.1-next.103","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build","build:clean":"tsc --build --clean && tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"^0.3.0-unstable.25","@sphereon/pex":"2.0.0-unstable.12","@sphereon/ssi-sdk-core":"^0.9.1-next.103+61d5c12","@sphereon/ssi-sdk-did-utils":"^0.9.1-next.103+61d5c12","@sphereon/ssi-types":"^0.9.1-next.103+61d5c12","@sphereon/wellknown-dids-client":"^0.1.3","@types/uuid":"^9.0.1","@veramo/core":"4.2.0","@veramo/credential-w3c":"4.2.0","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.6.0","@veramo/cli":"4.2.0","@veramo/did-provider-key":"4.2.0","@veramo/did-resolver":"4.2.0","@veramo/utils":"4.2.0","did-resolver":"^4.1.0","nock":"^13.2.1"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"61d5c12378a1c8214bb321a2c87050e61739f242","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authorization request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst authorizationRequest = await agent.getSiopAuthorizationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authorization request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationRequestDetailsResponse = await agent.getSiopAuthorizationRequestDetails({\n  sessionId,\n  verifiedAuthorizationRequest: createAuthorizationResponse,\n})\n```\n\n### Verify authorization request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthorizationResponse = await agent.verifySiopAuthorizationRequestURI({\n  sessionId,\n  requestURI: createAuthorizationResponse,\n})\n```\n\n### Send authorization response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationResponse = await agent.sendSiopAuthorizationResponse({\n  sessionId,\n  verifiedAuthorizationRequest: verifiedAuthorizationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.9.1-next.103","_nodeVersion":"16.20.0","_npmVersion":"lerna/6.5.1/node@v16.20.0+x64 (linux)","dist":{"integrity":"sha512-/+/5g/Jp9vspvi4kclc4ri96EpTIRQJI8076pe6kKVT0fxwDXbeUNE84IdWmqUQwvseVqZCm7vO2r07b2jV6nQ==","shasum":"282915e77160c45baec0cb781940cbb1a24c776d","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.9.1-next.103.tgz","fileCount":34,"unpackedSize":140124,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDfL2nVdpMbGt9ow6pNB3AoonaB7IcPc/nS8aeemXWXWQIgOKLbZrpECm2zJjpoYQm92gejWEINMIJ7rb3ar4YN9Rc="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkPQ1TACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpvGA/8CgTuEDzgtvlGKwhdX+j/tnl9QBm0rKeOnnSCGh9eAdUpFJlv\r\nO7HeBsbOCmRT8rhg1DHUkE7M/PuKXI7s39hvG+HnyExOhdgBm+yHF4qQnW71\r\nJIPK/eQRWMDNwboA8g48hb8DDgvM2SLI0Jh1caK+BhplExEnMaA3NyG+s/Qa\r\nBHVkLBICECgRM7HE/cYv2juMznyo+YMhAtgzb/NzmVLqsRajO6AQ/xhqcCnm\r\ntS7qEn1SosGdsDynV6f/og+Q4+5siW+RSJ8mlmu3MPPTH9v3lcv673kbMF+A\r\nIYLEJixS8/InB2Kk0S2DpkigAK0hwdQt54fpTNR2kmosEcbBQnIjJmA49IHR\r\ni8iRT6lYgr8936TYvsz09EzyWB81u7tGedH4uSDubFCBUctLNRiXKSnXIL+p\r\nfsDcmVjakgJouK9pLh6tH9C/MNVRh55jYakRLZs2eL/qrKa3gJzJhTUxSZ0N\r\nyYKin3+vejbz9AgXt/orb+ixWmtIP07WoIuA++Q0K3Ax0ptS1wGfVMWkLgv7\r\nxklfe3uVNxPvGdNPkpj2Cd5mI2xuydaou8p0LKEff7zjWw/1rKEsiyM3rx4V\r\nCqxIjh3dW4JpDJofveptZqoCZuwiXl9/fmqepvbrMBRX3p1kM+YUcAwqvZV3\r\n8C7LscXSNKzU97c6JODVJqSfrOluNmC2UwE=\r\n=1f1Z\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.9.1-next.103_1681722707190_0.7585848934042929"},"_hasShrinkwrap":false},"0.9.1-unstable.104":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.9.1-unstable.104","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build","build:clean":"tsc --build --clean && tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"^0.3.0-unstable.25","@sphereon/pex":"2.0.0-unstable.12","@sphereon/ssi-sdk-core":"^0.9.1-unstable.104+728c8e1","@sphereon/ssi-sdk-did-utils":"^0.9.1-unstable.104+728c8e1","@sphereon/ssi-types":"^0.9.1-unstable.104+728c8e1","@sphereon/wellknown-dids-client":"^0.1.3","@types/uuid":"^9.0.1","@veramo/core":"4.2.0","@veramo/credential-w3c":"4.2.0","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.6.0","@veramo/cli":"4.2.0","@veramo/did-provider-key":"4.2.0","@veramo/did-resolver":"4.2.0","@veramo/utils":"4.2.0","did-resolver":"^4.1.0","nock":"^13.2.1"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"728c8e10be5ca3f5491c3f31870bbf57975c597b","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authorization request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst authorizationRequest = await agent.getSiopAuthorizationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authorization request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationRequestDetailsResponse = await agent.getSiopAuthorizationRequestDetails({\n  sessionId,\n  verifiedAuthorizationRequest: createAuthorizationResponse,\n})\n```\n\n### Verify authorization request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthorizationResponse = await agent.verifySiopAuthorizationRequestURI({\n  sessionId,\n  requestURI: createAuthorizationResponse,\n})\n```\n\n### Send authorization response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationResponse = await agent.sendSiopAuthorizationResponse({\n  sessionId,\n  verifiedAuthorizationRequest: verifiedAuthorizationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.9.1-unstable.104","_nodeVersion":"16.20.0","_npmVersion":"lerna/6.5.1/node@v16.20.0+x64 (linux)","dist":{"integrity":"sha512-KMsT880LREA45zbeLgK71OrUisNVfWWKVzw+IhJVOm5ohN4BgZU3gz+a3QU+Gkqk927HfxtUSlTUceevuWtnLA==","shasum":"630c4e3acf6ed9537c25d8fb3caf873678971198","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.9.1-unstable.104.tgz","fileCount":34,"unpackedSize":140140,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDOm01KxuIX7rddsp5TLPi1cbk+P8tPFNJ1xJaexleTdgIhALuWXpiafLergkCp2mxy7I55QW8T2WlZKU+rBm3Kf6C4"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkRpzzACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqyKQ/+JX4dualOXbNapWaDVzluvoc9K6PnW/UiJHIFIHVwZwW+5Lbu\r\n3jH5cED/uSs1BEGHe9b8NRauSz/11dJqegp7QsCKKgZ4ytOyJEqo6ZdtXOyy\r\nVgpg4o/MOxCPEtWvFwn7jQ+gq2kstkhUUMc2C3FkbpatyBxdN8IvOnM9lBxd\r\nrRxanpJbXG3LhTIZjydlSVqmGaWPIRs48W2khA5h0GY0ASiRHE4hI3VfgaqS\r\n/NEhsF9HaUno32tei6Gl4WRKFvmExC8yMQo+Dny+VPpSgTW20ZUyxiyqPwBi\r\nznDP38qmM7p/Db2V7pPlw1Rh7EsXiSiukStD5XdXA3Zo5sNB62xJKGhYIgUg\r\nFCrSHb4nB4TRuNA0pZ+51y/JW0dxF+/QVwpymbMi/rl0vKbz65KODoz54YFu\r\nlclAEFDX4IaddNW1soc2gkPETLXudBpP7/cvPUHQlATlSCw9ZlSlvZIHQX4o\r\nPBNt6MA3+AQgcL5mqlmAVsOqpCpG7sM1f2SgxpS+S9jAh0UydKsazUuTN963\r\nXegsH4ZS7sHrBPH+kDBztp2ggHl8DajS4YP9L+XCXFnCj/ATPhU42OAsYH8o\r\nPKQGU8BIuQeuMhaqvR8vE9atg7N9fZa4ICm6v4sVFwhTDwBHLSDxXG/Uy9yO\r\nwsnvAXDNe0qxx6gHugFPUxFGmhvWt1yJ4qQ=\r\n=Titu\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.9.1-unstable.104_1682349299498_0.9407022329916759"},"_hasShrinkwrap":false},"0.9.1-next.105":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.9.1-next.105","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build","build:clean":"tsc --build --clean && tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"^0.3.0-unstable.25","@sphereon/pex":"2.0.0-unstable.12","@sphereon/ssi-sdk-core":"^0.9.1-next.105+cbcf678","@sphereon/ssi-sdk-did-utils":"^0.9.1-next.105+cbcf678","@sphereon/ssi-types":"^0.9.1-next.105+cbcf678","@sphereon/wellknown-dids-client":"^0.1.3","@types/uuid":"^9.0.1","@veramo/core":"4.2.0","@veramo/credential-w3c":"4.2.0","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.6.0","@veramo/cli":"4.2.0","@veramo/did-provider-key":"4.2.0","@veramo/did-resolver":"4.2.0","@veramo/utils":"4.2.0","did-resolver":"^4.1.0","nock":"^13.2.1"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"cbcf678b279648f358aa9f9e56745b5745161e1f","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authorization request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst authorizationRequest = await agent.getSiopAuthorizationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authorization request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationRequestDetailsResponse = await agent.getSiopAuthorizationRequestDetails({\n  sessionId,\n  verifiedAuthorizationRequest: createAuthorizationResponse,\n})\n```\n\n### Verify authorization request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthorizationResponse = await agent.verifySiopAuthorizationRequestURI({\n  sessionId,\n  requestURI: createAuthorizationResponse,\n})\n```\n\n### Send authorization response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationResponse = await agent.sendSiopAuthorizationResponse({\n  sessionId,\n  verifiedAuthorizationRequest: verifiedAuthorizationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.9.1-next.105","_nodeVersion":"16.20.0","_npmVersion":"lerna/6.5.1/node@v16.20.0+x64 (linux)","dist":{"integrity":"sha512-W1fu/6ANqj9poDp8xhFH3A2Iyx0WWxahis7uOup50CBWCPNVuszIAn3Mq8t8PaMHlGXA4vMbAOf1EpKK06jsNg==","shasum":"8b51fc5e585b27ec265a0f3ddec7c0fdca67c89e","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.9.1-next.105.tgz","fileCount":34,"unpackedSize":140124,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAuRVXhp1+vaByU6y7AVfOfc4YLduaZIQJyToXn4UU0wAiEAw1qFHnXNEJgzPWeTY2WuTa6GYOPlD4D2srI3MuwS86k="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkRumZACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqYtg//dd+AAyTh4ZrjmHu0W9KCRFaTQhdba9nvkSIvvB2O80VK+/kD\r\nIlvCi7UM9zGhMCvvdm0tzOGdJxtxagO+mBmnDYO8zIIfGfb9cwk0j1b36ZPF\r\nScJDPp0sFVbI+7/VkKAsuj/P1ozM7J1YzHmGVNeEYEseLczy0NESxrjeWseJ\r\nk6fZGu4eP5FC3GZtDzSOlI2qazubsYZwKN89U6ymIwuPdrd4bL4u23dwjJIM\r\nX7ZNsW90F0xxQGZj38reHwsj6VPvJQBOLHfad/DB5n/7R3XYOO2Q1UZt6L6q\r\nh3slY4LKP6pYBuXrmpZVkAgAji2z7+R1fkZWz1UYcAAjKhVNt+lO9kaFYqU4\r\n7EMUJ17YB1pgpUOd+NKuAPouQ8aItBJTnKOmu+05TwCL9iY2dpANGc8L6uuN\r\n4TPRFBBGTgzJbnTXyzuuHJzKAyzzHPGfmmTbSLwADzRhfQoXLS7Pt6Oh0ya7\r\nnKoROA2IgYWITowr33ndYv8+GIq3D/Iixeoyb/nklGP3+gNgdT/cAN6i3usl\r\nImp6BKyZZarvTOetZAyGNQAC17teQ3LSXlDc2M5OEpl6LvI9C60cJs6rjZ2e\r\nEC9WtDhuAX4pyNJ7LjytI0Y1pOi1ACwVlGHY5muE5oyftCgp7anPozdnieu9\r\nEUYs0Gs9H7ugtF6WPBVeu459MI76NSAWfOo=\r\n=XOOl\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.9.1-next.105_1682368921591_0.10111585662820732"},"_hasShrinkwrap":false},"0.9.1-next.107":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.9.1-next.107","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build","build:clean":"tsc --build --clean && tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"^0.3.0-unstable.25","@sphereon/pex":"2.0.0-unstable.12","@sphereon/ssi-sdk-core":"^0.9.1-next.107+41161a4","@sphereon/ssi-sdk-did-utils":"^0.9.1-next.107+41161a4","@sphereon/ssi-types":"^0.9.1-next.107+41161a4","@sphereon/wellknown-dids-client":"^0.1.3","@types/uuid":"^9.0.1","@veramo/core":"4.2.0","@veramo/credential-w3c":"4.2.0","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.6.0","@veramo/cli":"4.2.0","@veramo/did-provider-key":"4.2.0","@veramo/did-resolver":"4.2.0","@veramo/utils":"4.2.0","did-resolver":"^4.1.0","nock":"^13.2.1"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"41161a405425e30dff40e39d6123368c58c3f655","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authorization request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst authorizationRequest = await agent.getSiopAuthorizationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authorization request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationRequestDetailsResponse = await agent.getSiopAuthorizationRequestDetails({\n  sessionId,\n  verifiedAuthorizationRequest: createAuthorizationResponse,\n})\n```\n\n### Verify authorization request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthorizationResponse = await agent.verifySiopAuthorizationRequestURI({\n  sessionId,\n  requestURI: createAuthorizationResponse,\n})\n```\n\n### Send authorization response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationResponse = await agent.sendSiopAuthorizationResponse({\n  sessionId,\n  verifiedAuthorizationRequest: verifiedAuthorizationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.9.1-next.107","_nodeVersion":"16.20.0","_npmVersion":"lerna/6.5.1/node@v16.20.0+x64 (linux)","dist":{"integrity":"sha512-R1zwGoUFeNGIy1sM6mnBg0gzfGfN9YWw9Am0EmiKSLQI6iVZYMuuJGFywLIYMZWrLCavX3i+GC4tnJQKpmIDWw==","shasum":"140bed872ba5692d2e080ed3754d0e7795ae2137","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.9.1-next.107.tgz","fileCount":34,"unpackedSize":140124,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCF4KdCkXwiAZ5l6jluFXAidOk9bE4uGrAzMOEdLWEttAIhAMlvFRDe4vIuFMHvkehb6BU6TS+uwtHzLSFpWxsZxk5x"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkR6SHACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrYVBAAko5ewBQ492LQIGfzVV3ngAd+cDn2Q6af0wyorx84DSnCIiWS\r\nDhDtHWseafVDZqaBjhvVGbJZOsXhbHhfDo9u9KJC3beIOZbe6cdUakgYMhZu\r\ntzzFwsDE4zdocPIKBb2yCnWN4cSTNsiJtALAfSZogtdzGay9K2Ttb9AKfh4l\r\nMQVX34k8yiw/QKiHakDXxIzL5I5Sio6xO/oI7rJVO0hjPBe8MBp+nO/9phVC\r\nlqvC3NNRV7W9t+3sCPchM84pzq/qIS0kidW95lrBgMWUoA+741ulMiHLY51C\r\nzlcQ9sMF2qewfrU92M2yQ7bR0bXDxR5nOGLX9x5VkPGmuPlUp6uMUjXzt9Z1\r\nntzmJikIZSmN+7XxJRTzhcz9W51EGkxjtCrxogxknsna2tRzzzjes1Pf5hGH\r\nmuLMNzPrD3D+7flc6LHDyrISVlTE57AON0f7J5VBFUa7c5ZlQR4V97jmHv++\r\nAs0ULHg0gh3fiKkqsFI5/dPIPQOYJNIonknYMpaQ09dBTkHnzlZ2W+SHmlAg\r\nQy59yQEQS1PRxMWueATkfFYzx5X21Dmn8c5zbJoONQvYq/FB7HaiRss5TUlL\r\n3gRejpYaxUR4Q20z7v91Sw5P81b+jQGUqJF4NrXdVp4+0gwHBXS5eXbnGh58\r\nFQR/XMkTCUkiTxYPFJe29miSxjTzKtC/0HQ=\r\n=XoV9\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.9.1-next.107_1682416775090_0.554755234081971"},"_hasShrinkwrap":false},"0.9.1-next.109":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.9.1-next.109","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build","build:clean":"tsc --build --clean && tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"^0.3.0-unstable.25","@sphereon/pex":"2.0.0-unstable.12","@sphereon/ssi-sdk-core":"^0.9.1-next.109+bd82063","@sphereon/ssi-sdk-did-utils":"^0.9.1-next.109+bd82063","@sphereon/ssi-types":"^0.9.1-next.109+bd82063","@sphereon/wellknown-dids-client":"^0.1.3","@types/uuid":"^9.0.1","@veramo/core":"4.2.0","@veramo/credential-w3c":"4.2.0","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.6.0","@veramo/cli":"4.2.0","@veramo/did-provider-key":"4.2.0","@veramo/did-resolver":"4.2.0","@veramo/utils":"4.2.0","did-resolver":"^4.1.0","nock":"^13.2.1"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"bd82063fc3f98bde5d171420266993642c530cfd","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authorization request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst authorizationRequest = await agent.getSiopAuthorizationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authorization request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationRequestDetailsResponse = await agent.getSiopAuthorizationRequestDetails({\n  sessionId,\n  verifiedAuthorizationRequest: createAuthorizationResponse,\n})\n```\n\n### Verify authorization request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthorizationResponse = await agent.verifySiopAuthorizationRequestURI({\n  sessionId,\n  requestURI: createAuthorizationResponse,\n})\n```\n\n### Send authorization response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationResponse = await agent.sendSiopAuthorizationResponse({\n  sessionId,\n  verifiedAuthorizationRequest: verifiedAuthorizationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.9.1-next.109","_nodeVersion":"16.20.0","_npmVersion":"lerna/6.5.1/node@v16.20.0+x64 (linux)","dist":{"integrity":"sha512-F37B8XSKVsl4UJA89thycqbHFnEvbqEcF/PTNH/svaN84OoGzqoUZ42r2/5drsRLb+kCyaaAQ2VtVLRDyFG1Hw==","shasum":"a8ac0c9ba9351144bca58573e0876e73c57f2f80","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.9.1-next.109.tgz","fileCount":34,"unpackedSize":140124,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHWyLaxIrSYCNbf9uN8on6VBLHbW/PIF76EdEycCbMq9AiEAqbvoElpyDudW9OG6K3RU/KHJ1M9hsiYjp2z2b7gfSfg="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkSQwWACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrMAxAAizd9qSSokIsfMGHQ8fnmhSfMdJU8O9Mz6D8iTL1mHYIYArj+\r\nz8EJQqcsHnPYo8ePJqJaGM2Bc2cLS7Fk0k6o7FNLlaFAivg6H0tihYRGMAWX\r\nYnbjusHfjMMUa8B21RkfLtAw28OGcSLRugEQyPtHpLN/+DiMRee9KZVklte/\r\nsqC+kDiirsCw+uWqxraPSsyTYvWzM1uYzs+539h6z534GZjd7dM/quyKWGIx\r\n9hfNfraeijT2OL2f5fnEx0K0XZLsA54t6dCcrMdqzzjaoXabcrldMqEwvcye\r\nnwGUg5H5En7SgN9jgrYERgIY7qCdclMzWzgE7QEHphZDUUBxWBH5R79cvtXB\r\n68ClUIWhcH/lrrCJfcYvzKS6dCI5PaXcDcuuY2TEhOcNthAhEAlzIoM4cvBt\r\nMgzSn6WD4Gzs/DPQ0e/8Ur8gwW/1RMzqV55EWrO3ZSrBRx7A9auupvGgy2hB\r\n37sD3zA6zHK4htIEThxi1/myDDq9TJzHX62wYGwpZCoI9bd5Pi8dMBHq7Tjw\r\n/jdd2rk+C3QabwOqTWsdt1kOg1/PqeVMyM+zqkbp4/9XtP8TGvX7xmXVG+Pm\r\nGWzI0xNzihY+u4gaCxvWExXS+uXh9iP9HiVHbj+hQaW6QKYFZXE4CwKaSg9o\r\ni23lOOvFxBK9Ysqbj7SkqXCBtFR9aawXvWA=\r\n=MVLi\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.9.1-next.109_1682508822676_0.30585823414456104"},"_hasShrinkwrap":false},"0.9.1-next.113":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.9.1-next.113","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build","build:clean":"tsc --build --clean && tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"^0.3.0-unstable.37","@sphereon/pex":"2.0.0-unstable.14","@sphereon/ssi-sdk-core":"^0.9.1-next.113+cc806d4","@sphereon/ssi-sdk-did-utils":"^0.9.1-next.113+cc806d4","@sphereon/ssi-types":"^0.9.1-next.113+cc806d4","@sphereon/wellknown-dids-client":"^0.1.3","@types/uuid":"^9.0.1","@veramo/core":"4.2.0","@veramo/credential-w3c":"4.2.0","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.6.0","@veramo/cli":"4.2.0","@veramo/did-provider-key":"4.2.0","@veramo/did-resolver":"4.2.0","@veramo/utils":"4.2.0","did-resolver":"^4.1.0","nock":"^13.2.1"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"cc806d4e2d4da20a32fabcc806a560155e123487","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authorization request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst authorizationRequest = await agent.getSiopAuthorizationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authorization request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationRequestDetailsResponse = await agent.getSiopAuthorizationRequestDetails({\n  sessionId,\n  verifiedAuthorizationRequest: createAuthorizationResponse,\n})\n```\n\n### Verify authorization request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthorizationResponse = await agent.verifySiopAuthorizationRequestURI({\n  sessionId,\n  requestURI: createAuthorizationResponse,\n})\n```\n\n### Send authorization response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationResponse = await agent.sendSiopAuthorizationResponse({\n  sessionId,\n  verifiedAuthorizationRequest: verifiedAuthorizationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.9.1-next.113","_nodeVersion":"16.20.0","_npmVersion":"lerna/6.5.1/node@v16.20.0+x64 (linux)","dist":{"integrity":"sha512-rwafUbuKRLJeMztxBG3Rqklk6IQZdEkOofCLgyVv9JBtwTNRNcBmv3iMCD3/4ffkgCCRpAiVVqAbz4M9nv+YCA==","shasum":"b603f23c185ba0d397f3df0e465bdd729119967c","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.9.1-next.113.tgz","fileCount":34,"unpackedSize":141056,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICXIcGMMXIOlmMEpLu226s6Vu29r0IQIncBgCxHtD/NbAiEA3nQ4bZOC6MHpdsuAPq/lqGky7TUe7zufaT02IBsQ/z0="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkSTu2ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmobNw/+Ki9tC8nNjmog1mJ8UDk8wavPkYgqr1JmCsC9XxO/pZbHhCP0\r\n5FnJOUJsiRBaaF5cbhfZ9Y31HUPbkgLD1j6ZERUvLDtMZYy4NBp8mS2XqvFq\r\nKFJZfFPwY1v5fN4hz52d5Pi7rEobhJJnAuORKIJ4cJGuGIl85BlxvHC2jrTq\r\nuFhXkrOjht8h9H0OmtDWImx2Lpw+T3oqeVin9r6SZEuLp74d19V0y7MrvoVU\r\nHKfUt3JYzlufCZY/kOZW8qhBDVGxdYq69bPnbIfMixwxeUAGa6rCapgwwOKL\r\nRJHmYIp9graUuVtJfRYl4p+aqPMrchm5x3Olg37NCiVzwekT66HoTfETu448\r\nWZJhhzygFuZRBFTxTMdBjTjTBYlTBGftx3/Vx264sqM8wvdY8qu3f+YTmii4\r\ntYHQBGTFQD6cMSZt5jNNTODpJDknFGFvjfyCC+OeIAhD3p36N7sI87U8+wo6\r\nNHVms/KCxxtrZ8DSl6bU+7vqs2fUNEYlpqr5QOO2goopaO19pRQPUoQJ+E2M\r\nBHR85C06M9R4Z0/WnGwrh5f1kuPtbBEXfZK3fJnBsu60nr0p/t/q5K3Z1yBf\r\nHkeg/BprLzgmevlIMjFhmrbrfGDN8sC4EcRX0cHXzSj/OQOnIkSjzR4FZ2GS\r\n/ahP7l7Lbal6QkQell9aXpZS2CJ51SRQZAk=\r\n=124P\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.9.1-next.113_1682521014194_0.33396498293628074"},"_hasShrinkwrap":false},"0.9.1-next.114":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.9.1-next.114","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build","build:clean":"tsc --build --clean && tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"^0.3.0-unstable.41","@sphereon/pex":"2.0.0-unstable.14","@sphereon/ssi-sdk-core":"^0.9.1-next.114+08ec06e","@sphereon/ssi-sdk-did-utils":"^0.9.1-next.114+08ec06e","@sphereon/ssi-types":"^0.9.1-next.114+08ec06e","@sphereon/wellknown-dids-client":"^0.1.3","@types/uuid":"^9.0.1","@veramo/core":"4.2.0","@veramo/credential-w3c":"4.2.0","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.6.0","@veramo/cli":"4.2.0","@veramo/did-provider-key":"4.2.0","@veramo/did-resolver":"4.2.0","@veramo/utils":"4.2.0","did-resolver":"^4.1.0","nock":"^13.2.1"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"08ec06ee2c9b883f7f497e960068458a51113b55","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authorization request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst authorizationRequest = await agent.getSiopAuthorizationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authorization request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationRequestDetailsResponse = await agent.getSiopAuthorizationRequestDetails({\n  sessionId,\n  verifiedAuthorizationRequest: createAuthorizationResponse,\n})\n```\n\n### Verify authorization request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthorizationResponse = await agent.verifySiopAuthorizationRequestURI({\n  sessionId,\n  requestURI: createAuthorizationResponse,\n})\n```\n\n### Send authorization response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationResponse = await agent.sendSiopAuthorizationResponse({\n  sessionId,\n  verifiedAuthorizationRequest: verifiedAuthorizationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.9.1-next.114","_nodeVersion":"16.20.0","_npmVersion":"lerna/6.5.1/node@v16.20.0+x64 (linux)","dist":{"integrity":"sha512-eYtIV8zWpogxl+F5zjPLbqPz0aA2AG7M1pGOJ1AK0bZzTAljuAMRAPBw4YfXgyWU6DXaPZL7UawfROSTppjw3A==","shasum":"0e95dcd9b720468265cc528457d0d4db4cf733d7","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.9.1-next.114.tgz","fileCount":34,"unpackedSize":141125,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGvm2Mkumci40VojzmFDbKhpmfymUCMP5lglauUqzQwoAiAD4Qm9EFcpxojL6uw9Uwtl0X8+mT7dUofDK+YeEq11DQ=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkSsoiACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmrqOw//QKFGEl8wXr+2q/He7hUkcD10Y9ctMUkODbYciY5xx7gN3l91\r\nnwwQUnsgq1gHM8XeAngpkaH+sd/dAioqPtUiZyKDt/gmwGaZ5w6q9fn1er5E\r\nw+HCP5AK8rz9wFNMj/ETm5R0gjpJvgYwoYDfzJJ9Mige2FqMUfuMHKjBo8YH\r\nlCuPlIkrE4FILOJ3a/0b7wUFyJbEdZreOiBIyH3Yv8U2h+WZnm9hRZOOjItP\r\n8fLZpMglrG+nawEgKThQBT9Bpe7DBqi3qYUaxBMRBNE7JoxES0Jb683elNA3\r\nVwcTf39OaDgewONOjs9e50fRu/oJ+ba5BrIIZ4RquSKHjOHZNm/72xz1iCZU\r\np8YcJUEbTEGrbmpTy7K74t2nfgLIcn4eJf47pbG84b0O7K1SXHneG/BKCU06\r\nNuGFXsYlUoxRWPhf/EyIDtfc6LAoCDRuJHXztnVoTW81dRJSzc7IGnRrassv\r\n+r7oH37+iUJKZ7WDv8Luq/UdV2o/1IY9kIKK72rDJcbU4pgSMVbxcnvqLZ2Z\r\n9J1wlTzVlqa0+ZPO8Gwq5Y1MbDkei5VHn78+D3av2TXpxs8QEnziUE2LmKqX\r\ntGZ2P1L34RKwnM5X/1z4pNcQLftyNl+8AvWgiNprs+teFPToF7BgtJG/sO36\r\nsev9kzon/9bg/byXyJ5KCN3Wznb6cNqNRKg=\r\n=TJie\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.9.1-next.114_1682623010046_0.31082136425441087"},"_hasShrinkwrap":false},"0.9.1-next.116":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.9.1-next.116","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build","build:clean":"tsc --build --clean && tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"^0.3.0-unstable.42","@sphereon/pex":"2.0.0-unstable.14","@sphereon/ssi-sdk-core":"^0.9.1-next.116+01593a4","@sphereon/ssi-sdk-did-utils":"^0.9.1-next.116+01593a4","@sphereon/ssi-types":"^0.9.1-next.116+01593a4","@sphereon/wellknown-dids-client":"^0.1.3","@types/uuid":"^9.0.1","@veramo/core":"4.2.0","@veramo/credential-w3c":"4.2.0","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.6.0","@veramo/cli":"4.2.0","@veramo/did-provider-key":"4.2.0","@veramo/did-resolver":"4.2.0","@veramo/utils":"4.2.0","did-resolver":"^4.1.0","nock":"^13.2.1"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"01593a4452e25fed16ec878e17d70c280f28e4ca","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authorization request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst authorizationRequest = await agent.getSiopAuthorizationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authorization request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationRequestDetailsResponse = await agent.getSiopAuthorizationRequestDetails({\n  sessionId,\n  verifiedAuthorizationRequest: createAuthorizationResponse,\n})\n```\n\n### Verify authorization request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthorizationResponse = await agent.verifySiopAuthorizationRequestURI({\n  sessionId,\n  requestURI: createAuthorizationResponse,\n})\n```\n\n### Send authorization response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationResponse = await agent.sendSiopAuthorizationResponse({\n  sessionId,\n  verifiedAuthorizationRequest: verifiedAuthorizationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.9.1-next.116","_nodeVersion":"16.20.0","_npmVersion":"lerna/6.5.1/node@v16.20.0+x64 (linux)","dist":{"integrity":"sha512-Oym0FO7nsQEdFwFqeS2t1GdYwvepXzerO74qv1sjG9ISr+DdHdubL69p0Ig9yjFJXHqua3Qm1zPAu27PZS0c1A==","shasum":"168a53b49bb69f3c66fb90954c16ab437ed401ae","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.9.1-next.116.tgz","fileCount":34,"unpackedSize":141125,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEgwzsl7VV098u4BUSSLQPvbR6ovdOEmbIP8bPWPPFcRAiEAlCRJMj43PF6Mrq4jijnxnxeDovC+WePkv78vK7KNhjc="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkSvLwACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqQow//ahWkbszmGyjafu82C4CmAhfbeTsu9aOEgsUmge8uBJTGCRzm\r\nLyFZY79jqZ8wHHBFH4Er/XeR1au02N+RkKrZKZTmIZol0uNwXGfEopUY7x4L\r\ndZW4mGvggYDsof8HhOnABhMorilcaA7GZCDwNaGKDRkxqlZSBj/hk9/PJqpI\r\nM6qr3D+A+XqetukblRLgmRy+vRt8oxUzuYrKpSpM566/2xtVOlWG9ScIA9Zh\r\nb3LPhF3k62cFPyOuOKKA/xHG1426Cggk4wsy/vlFERG2t9/oR/dTSO+3i13W\r\nppnTaHJVvByKGW7ZmfSkCVicDE73l2kHmkxats3XLYwbpFYysJ2SmUo9d3eB\r\npG1PI4NJ4/8wzBUrMtoUH1AOf4M9LHsWR19Uj7Q7kprUKhLUX5GUr3f4esun\r\ngZQRtlP/aSjKAedNr/xz9nyo1plCtyaAt9OFdb/kc6HQk4kt5GDOniH3ekLV\r\nJuMcpspnxvPCcsY/ZqLWtVij/TaQZLPwIDph9jMXgjE04n4w/cSWINC7NkqT\r\nER6W46ZgcrPqnpKUZBmf4s5ix3O2UCpCft2hnhzc7xfALCL7vz93xy79bldW\r\nnSS5kVBDrHFAiuY6RnyT9mmy//0X9N6mYVJiDuCdqbXPO21QaFx+0wFgnIaa\r\n8CxnkceS93hg/L77KoTJIL16XICyq+UCDiM=\r\n=246V\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.9.1-next.116_1682633455883_0.2782992395160948"},"_hasShrinkwrap":false},"0.9.1-next.118":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.9.1-next.118","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build","build:clean":"tsc --build --clean && tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"^0.3.0-unstable.42","@sphereon/pex":"2.0.0-unstable.14","@sphereon/ssi-sdk-core":"^0.9.1-next.118+612b082","@sphereon/ssi-sdk-did-utils":"^0.9.1-next.118+612b082","@sphereon/ssi-types":"^0.9.1-next.118+612b082","@sphereon/wellknown-dids-client":"^0.1.3","@types/uuid":"^9.0.1","@veramo/core":"4.2.0","@veramo/credential-w3c":"4.2.0","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.6.0","@veramo/cli":"4.2.0","@veramo/did-provider-key":"4.2.0","@veramo/did-resolver":"4.2.0","@veramo/utils":"4.2.0","did-resolver":"^4.1.0","nock":"^13.2.1"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"612b082d754eb90402160f423d939f3a6f9ec181","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authorization request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst authorizationRequest = await agent.getSiopAuthorizationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authorization request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationRequestDetailsResponse = await agent.getSiopAuthorizationRequestDetails({\n  sessionId,\n  verifiedAuthorizationRequest: createAuthorizationResponse,\n})\n```\n\n### Verify authorization request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthorizationResponse = await agent.verifySiopAuthorizationRequestURI({\n  sessionId,\n  requestURI: createAuthorizationResponse,\n})\n```\n\n### Send authorization response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationResponse = await agent.sendSiopAuthorizationResponse({\n  sessionId,\n  verifiedAuthorizationRequest: verifiedAuthorizationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.9.1-next.118","_nodeVersion":"16.20.0","_npmVersion":"lerna/6.5.1/node@v16.20.0+x64 (linux)","dist":{"integrity":"sha512-zosb6jv+2Yx3FuR1Cc/YM1x739MCzWrLPpNucMT0jvCo2zMFMet4z+fbV+CMep2fUIJFBLfxJOUmoUEPxwMFFw==","shasum":"1c512b5c6bad2b8e7df208d9141ef79a2b027155","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.9.1-next.118.tgz","fileCount":34,"unpackedSize":141125,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICCk5uO38/gqmjIdlEUjQCZSFy6bcexmnGl9VfpbhxzJAiAe+SlYb8zZmYwEtjyF/5WYG15Ejy8epMBjkOfywT47qQ=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkTYHsACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmowOA//W+cJq0N62NGw9Q5vR6erNcOubf2R314nKmSHmI81wKFXHijQ\r\ntCyS0M4+ogAQd8P9m7CztFic0wbuM7ZGEh72bRgt0/4JGdjzlGMDE6+K7mqb\r\neO+oK/cSKghsQLvmke9Dei/fTVU+l6ZfAQyYS4VhLWcL84qdES6q8p/JxKim\r\nBsF0aY7cqSusZTK/BRRqRD8vfoxfy8HzRm3luzaVbd3TaIops8bpmT+iANkj\r\no8UD4UzEY+37w2v9elRZdxM3O1OshbO1ZWa50oOwkNZUpZMnpEEwEU1g0D3S\r\nMoo0ecmZ+glVM/G0XOZmkoM1diU45+4M7q8z8uC13LnsQuUdWiYu8f00OCwR\r\nyN3oUqq945R/VJgk0fQ7pyA00ZWyj+StdyyDFHdAwHqh0UK7WGBPXUHj260c\r\nk7qPuZ97Kai8pfalecVdEMjIztBSDIZisi5HJys7QWDSN+lHpF1AcjBCplZy\r\nVlLl/ovPljoOh4vH8btmAKXw8uneK9jqPWz7ZuH7jcknfo8CPBHyqx69TZOS\r\nlctH0oCoXkDe8eH0MYWiLaJSVs/2G3iGU93sTl53nDKmKv2ov7U8nN1MI3MQ\r\nbKfEtw5r3eg1WvHtpxju6DI2T72nkjiMYxfdDmOg3Zgb76Thl+LqnitGqCfK\r\na3PPmqs+PggVDWwsyZSShC60VGj0k6A0Zkw=\r\n=rKtD\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.9.1-next.118_1682801132646_0.7692883819621639"},"_hasShrinkwrap":false},"0.9.1-next.120":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.9.1-next.120","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build","build:clean":"tsc --build --clean && tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"0.3.0-unstable.43","@sphereon/pex":"2.0.0-unstable.19","@sphereon/ssi-sdk-core":"^0.9.1-next.120+198701d","@sphereon/ssi-sdk-did-utils":"^0.9.1-next.120+198701d","@sphereon/ssi-types":"^0.9.1-next.120+198701d","@sphereon/wellknown-dids-client":"^0.1.3","@types/uuid":"^9.0.1","@veramo/core":"4.2.0","@veramo/credential-w3c":"4.2.0","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.6.0","@veramo/cli":"4.2.0","@veramo/did-provider-key":"4.2.0","@veramo/did-resolver":"4.2.0","@veramo/utils":"4.2.0","did-resolver":"^4.1.0","nock":"^13.2.1"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"198701dd4319c030608df1fc33ce25d62870dc43","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authorization request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst authorizationRequest = await agent.getSiopAuthorizationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authorization request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationRequestDetailsResponse = await agent.getSiopAuthorizationRequestDetails({\n  sessionId,\n  verifiedAuthorizationRequest: createAuthorizationResponse,\n})\n```\n\n### Verify authorization request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthorizationResponse = await agent.verifySiopAuthorizationRequestURI({\n  sessionId,\n  requestURI: createAuthorizationResponse,\n})\n```\n\n### Send authorization response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationResponse = await agent.sendSiopAuthorizationResponse({\n  sessionId,\n  verifiedAuthorizationRequest: verifiedAuthorizationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.9.1-next.120","_nodeVersion":"16.20.0","_npmVersion":"lerna/6.5.1/node@v16.20.0+x64 (linux)","dist":{"integrity":"sha512-xPoNB+DpZTFC4Hv9DYWWl1l0avHwQBj4Ktpn6sQT25F4cIDyeve4WDeTVr8OHN6+fqsYQAnNlQyNWlllOcwFtg==","shasum":"9276715ea63029845bd0f5e172e9ef2b90567e65","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.9.1-next.120.tgz","fileCount":34,"unpackedSize":142998,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDEv13vRxz57gVfF31pyIeeotE2vWKWSWm6nWcklnbe9wIgTgDCeH0/wQQ4NGUxj5HHgUFOLqXoO514x30qu5BSBac="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkTkiYACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmp9rA//VBJGIAJYbl+/QBN9eWZkzXArHU5tC8eBBHQGR5OXsu7tZE7e\r\nco8JpxDZgAqmdktyFjDuZjP6a8D9o1Co/GXdqHNeCHjipab2iJzqFGEOgL2Y\r\nJMJp1YC7RskZT8U2d5/XPOeKeMh6ScGmhJXBlJBvvbAla3QDaf7iUtbb+Blu\r\nXPGIN+1Iio173L3yBagmRdBnxPPcfMClj8oh57R2qK9npF+zXgqR4qeSKfZ0\r\nXf+op2ItH68HPXr0V0UaG89aV5CKkziTLbTbBixrpjPNE7yoVbxMGEr+6Eod\r\nFlu1CRI1hssAIPuPN1T/Pu/4wWDFLhuUM3KcdViZM+NBzFQ2IKYIQNuYsb+R\r\nWZwzDjgm0d2HRqYB3HrtLGHrGfeUO5P1kLekwFj00kAR9JJZM8mieInC72mo\r\nXTW8ZzTvOaw6KREr/0YMrE4T1L4CK3ZJ7q/x6Igbue/BjBxW5seJ126J/krn\r\nrep6l1FrmILThyutnVpzUZvQ/HpuF1+iWr0xCG3H2s/R3BqmTvY3dTWp1ZSU\r\nGaWP2s1RCjDU98gQ2NluaW7rNhkOWh9hdUlbNGSKZhfmwWdyxoUnLBhP8HN4\r\n7qEZBnPC6XnLdKBeontFTrdGJJt/EzIX4kMj3ghHpCgkMFBALv7EJJ5grW8u\r\nAndvZo8Bfh/MsucxG69s6FAhCmCOjG4JAnI=\r\n=lrrX\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.9.1-next.120_1682851992709_0.4855842481925865"},"_hasShrinkwrap":false},"0.9.1-next.121":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.9.1-next.121","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build","build:clean":"tsc --build --clean && tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"0.3.0-unstable.45","@sphereon/pex":"2.0.0","@sphereon/ssi-sdk-core":"^0.9.1-next.121+60cb6d6","@sphereon/ssi-sdk-did-utils":"^0.9.1-next.121+60cb6d6","@sphereon/ssi-types":"^0.9.1-next.121+60cb6d6","@sphereon/wellknown-dids-client":"^0.1.3","@types/uuid":"^9.0.1","@veramo/core":"4.2.0","@veramo/credential-w3c":"4.2.0","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.6.0","@veramo/cli":"4.2.0","@veramo/did-provider-key":"4.2.0","@veramo/did-resolver":"4.2.0","@veramo/utils":"4.2.0","did-resolver":"^4.1.0","nock":"^13.2.1"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"60cb6d63087feae065bd4cb5d43fb6665725d694","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authorization request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst authorizationRequest = await agent.getSiopAuthorizationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authorization request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationRequestDetailsResponse = await agent.getSiopAuthorizationRequestDetails({\n  sessionId,\n  verifiedAuthorizationRequest: createAuthorizationResponse,\n})\n```\n\n### Verify authorization request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthorizationResponse = await agent.verifySiopAuthorizationRequestURI({\n  sessionId,\n  requestURI: createAuthorizationResponse,\n})\n```\n\n### Send authorization response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationResponse = await agent.sendSiopAuthorizationResponse({\n  sessionId,\n  verifiedAuthorizationRequest: verifiedAuthorizationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.9.1-next.121","_nodeVersion":"16.20.0","_npmVersion":"lerna/6.5.1/node@v16.20.0+x64 (linux)","dist":{"integrity":"sha512-MrBJNhMfpEUqt9zM1p4CNE9TI2eQJdN+JfLD0505Q/2Oe94g1pE0lNVZnaf1cg7y1aWXsYdyLHjOsD8eRgU7VA==","shasum":"868382cfd5d310ce196a6054b7a76262fe77ffd7","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.9.1-next.121.tgz","fileCount":34,"unpackedSize":143915,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDWa3DaSCa9QWjs5Qrn31L+8DXLfdXr07G7SpZKZIvp3QIgATJ9ZXoQmu3qn6KtYb0exXsDPWHNViyi5tJQ1Mgm+0E="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkTtIOACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmoQuw//e4mFVIdBSUsFDAriggbX22j4qBb87SiXbdMB6xwbJzIOw5iU\r\nCg+nCFg5QgidmB/pb/iWSnCz3WJbfU2MwGI2gMh4BREBZlPsR0DKumIeQrjR\r\n2+FV8R1Qhy16/6GOR3KGRqEa/1r8XpqiezUbQuyuq3syYSromHCp5J8Vv+aM\r\nxEPJHUv0qFdMujfXm1I/AbWmpZ/qtEkI9ePbZridExYtsOI5khg275jxTWk2\r\n3TVpLG3171uyCKuok7EYzd3mAfzfSh9Ye2hTIB+ojcbNn1WerF4Q2ol3LQxH\r\nlf2ObJwM9+aQnUlQRCOElUVkjFhhAu3w5SYqLAl0inlwXi+mrr2SreiM1oYL\r\nnVuvK8HNeKsxUHw4XjFTvnKXqhXHuh7OUXCU4IPasKE0Aah7ek3svPH2Txoq\r\nDQamIfZbN/ECLQnXikZS753mKjr5AIhwv7f3SQyuwpPY7iRpeNBXDizUGS96\r\nP3fMIpRdmmtnNXObQ9ruG5fAF1h9rVT7a3hMoc98zT7GxQxZ1EnoWAR43dH8\r\n451isQHothGfxvW66moVmrgODH3h0hGg8fL68eKQBglv+poHcseKJtBzAggj\r\nUtOpZbU0zzl5CrlB4uhzWqUJ7f6My8YP6P2/54QjGGdMam09HVr4mWosLwd3\r\nvS5pw0yDyMNlLaUaadQxMJUt/k4zGrhAt5o=\r\n=WkSD\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.9.1-next.121_1682887182031_0.06030343736701593"},"_hasShrinkwrap":false},"0.10.0":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.10.0","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build","build:clean":"tsc --build --clean && tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"0.3.0-unstable.45","@sphereon/pex":"2.0.0","@sphereon/ssi-sdk-core":"^0.10.0","@sphereon/ssi-sdk-did-utils":"^0.10.0","@sphereon/ssi-types":"^0.10.0","@sphereon/wellknown-dids-client":"^0.1.3","@types/uuid":"^9.0.1","@veramo/core":"4.2.0","@veramo/credential-w3c":"4.2.0","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.6.0","@veramo/cli":"4.2.0","@veramo/did-provider-key":"4.2.0","@veramo/did-resolver":"4.2.0","@veramo/utils":"4.2.0","did-resolver":"^4.1.0","nock":"^13.2.1"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"134e3ba941e7f9574c2e11c6d5088ab5e8581955","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.10.0","_nodeVersion":"16.20.0","_npmVersion":"lerna/6.5.1/node@v16.20.0+x64 (linux)","dist":{"integrity":"sha512-feLukPuuzpTmVmW+hQto1plaKjN6u66Bzd9cE133K9prTUM0aLSVLmouIMmZLWqqHNORrgV70OyfVIIxEn/gbQ==","shasum":"b8b00c8fa43409f06b9830432575de084c29acb7","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.10.0.tgz","fileCount":34,"unpackedSize":143851,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCID9zxR8CbifC4ttzWNl4ZCNW6t/q21JoGXU4+txnFJ/VAiAaXQIGGcqo6agKTlsfWu+zrnz80+B/vNPxJ+0LlxsoPg=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkTudsACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmqbOw//RCMecgaQDBOUxy0EDzmTLTLqwjNr4tLy/O3PHFSm0fZwrv1j\r\nFoY4P0qVCUoBNn1IXq8fbobishcmxhQMslABPH7BxgTMnCJnAwZIH6FjUr6J\r\nRJGnPsZoq7GVjguxXlHUfUEqVZYmFFZIJEr1+1llACbcwruvl3D/dLxSitgY\r\njucZi7BuURQ6UtjQvFMAm4PAsUjKwhdhRn5CFxyro3rn/5Vxl/st/aRdnKPX\r\nP+wT+Y7xvoW2K+jSVEvrWqI7u8T0u6OHfhr/KzchRU60M0vSkHGQm3iDWs9c\r\nPwz1G3y8GYFrOtHtHei12prbkBLb1f0hRSUK9XNDRNWWmqQTeZndfKHnfZQ/\r\nSJnJGg3zGBdr1naZREPgSBK5QGwki6n87Szoa5xLRWCEe0Qp2LBgGacSD6fp\r\n0CR+UvaDn16IIrguRWOmtkHbYQUKZ3DEQ3i124l25uEgRw9QYcQL20uda4Q3\r\nY+gYbfxrCB5H0F7kGT7HtZCIZviB1ReFvyBDguEajjl3jV0kUBDlFcItG1EI\r\ndyINF+MXUmOVwXHiMk5ZpJUdJuJPxJocbnZ/fibkYQvWfs73/US0XYCjI2E7\r\nJRufQH+zD0QqEbsGIk/xlLjXG1opO2qLJsGHcIPvndJ59A9qzJMY2B5rrA6L\r\ntZx4bOFHR8C7pCmDp/TKRape/4BsuenAG1s=\r\n=De+x\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.10.0_1682892652580_0.050168349018713254"},"_hasShrinkwrap":false},"0.10.1-next.2":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.10.1-next.2","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build","build:clean":"tsc --build --clean && tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"0.3.1-unstable.0","@sphereon/pex":"2.0.1","@sphereon/ssi-sdk-core":"^0.10.1-next.2+488111f","@sphereon/ssi-sdk-did-utils":"^0.10.1-next.2+488111f","@sphereon/ssi-types":"^0.10.1-next.2+488111f","@sphereon/wellknown-dids-client":"^0.1.3","@types/uuid":"^9.0.1","@veramo/core":"4.2.0","@veramo/credential-w3c":"4.2.0","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.6.0","@veramo/cli":"4.2.0","@veramo/did-provider-key":"4.2.0","@veramo/did-resolver":"4.2.0","@veramo/utils":"4.2.0","did-resolver":"^4.1.0","nock":"^13.2.1"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"488111f22ed6a844f0db4738994647e02e0cf23d","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authorization request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst authorizationRequest = await agent.getSiopAuthorizationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authorization request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationRequestDetailsResponse = await agent.getSiopAuthorizationRequestDetails({\n  sessionId,\n  verifiedAuthorizationRequest: createAuthorizationResponse,\n})\n```\n\n### Verify authorization request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthorizationResponse = await agent.verifySiopAuthorizationRequestURI({\n  sessionId,\n  requestURI: createAuthorizationResponse,\n})\n```\n\n### Send authorization response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationResponse = await agent.sendSiopAuthorizationResponse({\n  sessionId,\n  verifiedAuthorizationRequest: verifiedAuthorizationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.10.1-next.2","_nodeVersion":"16.20.0","_npmVersion":"lerna/6.5.1/node@v16.20.0+x64 (linux)","dist":{"integrity":"sha512-MWE08DcUKk4S51jll6EDx1CTI8d6cN5EMEFGk3SBwz7sTuYejmBPUDxg//aK26YVO+tNlrh4kNR51fM+HnbiQg==","shasum":"999235c850437d7cea1e884a30425f360b0611c1","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.10.1-next.2.tgz","fileCount":34,"unpackedSize":143910,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDeAjpUJ3GRerWpBT1+ovZS0lVqqvbDQMPw/TDuw41puAiEA0jWjBGQAzrztJnLc0xzv1s5tTD+vVtxEuBDgpSnvAi4="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkTxY7ACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmo5fhAAlN20r0STl8KqmbeI6hsLSe62JOsYc7uudoeMxkO3D+cM9UEh\r\nCciK5lj30svKDX0YHXvpz0/vvSlMn8HH/avBaYtp4i7nMrSyYlWFlKlgH1WI\r\nAHc5xUMrKmH0i6X6Gim32m+OUvXTUmCb8GZciKhJZpQb7fhns3/IQLIxuzO5\r\ndhxwXn2p/IEVwwQu/6klSthR3jbeZFZgGEeDZnlcB/B1WxTLhG+QYn4d3ypv\r\nw/PBPEPFJgZbuUIzDpu4qozpwy4F/kgEL4i0USnVrJsBAV93tOUDDzdOGzMA\r\nkdFfq62OrXAYDxa7qOYGGhF5SpH81eIh1PqJP5YedHa0/8Ep6f6fGqWzqXfc\r\nAy+x9Ve5kXg7ECioGXxe7Jw1QgZRB9Pm7tzj0cFFJwTBV6vR9I7HVmToViJ0\r\n8CAA9jZlBzEz5LtlI+Z6p/YwuCswGtzirg/SSL15Mh8x7gSYmaZzsJwqMQGN\r\n+eW+wZc19+jZHbt5mgPBUoW6WQ5qvJWGnI6twfVpm+3bFWN5Yz50LeuVIWFI\r\nSfPzSJUOF9LjouToRERLGfx03eMFke4w+y8ob+6uW1u+L4PiY5xMtlTub9X9\r\nZjF4OEqgJNd0B9wv43cAeDQ0gRzMZJB0BpOo/6glu+m8TTVU3FWecA0FbWNy\r\nCtfGU5zk8RgDnCkxWJmrrakSa/8ZJdG2ReI=\r\n=cxCp\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.10.1-next.2_1682904635104_0.2951518336702359"},"_hasShrinkwrap":false},"0.10.1":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.10.1","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build","build:clean":"tsc --build --clean && tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"0.3.1-unstable.0","@sphereon/pex":"2.0.1","@sphereon/ssi-sdk-core":"^0.10.0","@sphereon/ssi-sdk-did-utils":"^0.10.0","@sphereon/ssi-types":"^0.10.0","@sphereon/wellknown-dids-client":"^0.1.3","@types/uuid":"^9.0.1","@veramo/core":"4.2.0","@veramo/credential-w3c":"4.2.0","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.6.0","@veramo/cli":"4.2.0","@veramo/did-provider-key":"4.2.0","@veramo/did-resolver":"4.2.0","@veramo/utils":"4.2.0","did-resolver":"^4.1.0","nock":"^13.2.1"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"e3a79ecd4e594d5aa9ffe82675b919daa44ba361","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.10.1","_nodeVersion":"16.20.0","_npmVersion":"lerna/6.5.1/node@v16.20.0+x64 (linux)","dist":{"integrity":"sha512-TCSKLFnHWFwzxgu3Z9c7y6JlVmFpi7l2Lb20FnRyrIM+S3ge+WgN/DUPINcZT9RCU4PXbDou8noutjM6MK1RyA==","shasum":"f915c1249bba2e857f3d5bfd668247b7e261012e","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.10.1.tgz","fileCount":34,"unpackedSize":143850,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAsbrm3iIHpSchxyBpNKnuSHRDlNpuLsC4YhTgLryKedAiAHu3l6nisjFObGTmn5rP/28Dg3NEY/n3OgWGGe5rWapg=="}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkTxeaACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2VmpA2g//fs11amaP9hJkwKCc2Ly3AedoKYhd9S9vJJXssAeMb1OcdCe/\r\ncTv0/CICtFVNi+hKaOltGhbRSz389R80NgLzx8L+am+PrxPeIPBzAhrs9P08\r\n6VBuFLhWHYX/fWvAAciTpckPHJu7vVHayKvjnN+GeaXNgSIi3qSIjmcTN7T1\r\nXuBM0Fj+qC/+619ELLMROhmozjHouhfCGaX6WRb/PhAM5/vwxLMTKZrMhHYj\r\n9Q/0GV5x+ablfYuYXtMm4ld+wdhLc69Pmk+yXkr+THHdZ6AszAW2BuqfF2X6\r\niLMilFeB1kWIdEA0CpbwuLLILkCJggcO6/TiGN/i8D9G37wgtR7wofvkiiB/\r\ndZOxd8ZHHGam/TSnrmb3qwLe38rjQujAJ5a5VEtdSxR3i9HveC9YmRAOEja5\r\nFvRFEGh4eFLUbR22ZVqvRXname1RAKPOjaJuV+XXTLadqD0f1mEd6yfqIeKC\r\nAf1RFFxGUyrzifXO/UxZ9PVVJpICK3QGjiNHWkQeeC82RGXhrmFz932NlAfV\r\n7x2P/dcOuFzlldzw6A2igY8FwNSvtsjMtTcxDwot+2os3jIhKnuTNzGGf5z7\r\nLZV/zV7ZDaS6naQKT8jz27jqVhezDOg+jaHBdvO2BZLjn9MfyFU2WDOuVWFE\r\nC+b0HKXBtaUliXjnZy/qWurKlW4rmdSgUv4=\r\n=vMxL\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.10.1_1682904986303_0.5490905561856769"},"_hasShrinkwrap":false},"0.10.1-next.6":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.10.1-next.6","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build","build:clean":"tsc --build --clean && tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"0.3.1-unstable.0","@sphereon/pex":"2.0.1","@sphereon/ssi-sdk-core":"^0.10.1-next.6+ce5b487","@sphereon/ssi-sdk-did-utils":"^0.10.1-next.6+ce5b487","@sphereon/ssi-types":"^0.10.1-next.6+ce5b487","@sphereon/wellknown-dids-client":"^0.1.3","@types/uuid":"^9.0.1","@veramo/core":"4.2.0","@veramo/credential-w3c":"4.2.0","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.6.0","@veramo/cli":"4.2.0","@veramo/did-provider-key":"4.2.0","@veramo/did-resolver":"4.2.0","@veramo/utils":"4.2.0","did-resolver":"^4.1.0","nock":"^13.2.1"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"ce5b487d4b5831aa033615fec9e4a45c19c1f3f7","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authorization request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst authorizationRequest = await agent.getSiopAuthorizationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authorization request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationRequestDetailsResponse = await agent.getSiopAuthorizationRequestDetails({\n  sessionId,\n  verifiedAuthorizationRequest: createAuthorizationResponse,\n})\n```\n\n### Verify authorization request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthorizationResponse = await agent.verifySiopAuthorizationRequestURI({\n  sessionId,\n  requestURI: createAuthorizationResponse,\n})\n```\n\n### Send authorization response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationResponse = await agent.sendSiopAuthorizationResponse({\n  sessionId,\n  verifiedAuthorizationRequest: verifiedAuthorizationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.10.1-next.6","_nodeVersion":"16.20.0","_npmVersion":"lerna/6.5.1/node@v16.20.0+x64 (linux)","dist":{"integrity":"sha512-tdbMhdeY+2ijG3sugaeGDSnhPlehCxdD6E9bK4TP+ic7P6IFwG0wMH1TDVJGmUq1JLH42CMDN8Er4stS/MNS9w==","shasum":"8bd73a7d783470d63e6b15fc4e827ab69ebac164","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.10.1-next.6.tgz","fileCount":34,"unpackedSize":143910,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDpVcmRVSYF+KWtLL667OlzUyxW76VNXRmJkmqOiTBaDQIhAKpVRvYu/BbsTh4OF2qceZ0n9daFlNX16yEs8Suv9sgl"}],"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v4.10.10\r\nComment: https://openpgpjs.org\r\n\r\nwsFzBAEBCAAGBQJkVD1RACEJED1NWxICdlZqFiEECWMYAoorWMhJKdjhPU1b\r\nEgJ2Vmox2w/+P62wQWMdgh0wW9TdIBf9GvpiApMUVbSM0Nweg2cvZBu/O2K7\r\ncbNksfJbF5UI5CUwTLflBfdriVWfbxvslxEIFjQUiu2x6SRuZnZQNn6UpSxM\r\n0b8Z/ZRY5BdkgNX3sNNnWVtMd2q7TfGlo4pw3dKIG9Ilke2GPajtyGUd5xMy\r\nte5H2BDVGgVjs3oiVEr9Hp8+hUGc+m1lsEHUCxsjSz8MqZp9nu1wwrkLvRO4\r\n8aVmcONxdg65wwzDnMeu1430ZITP2X0KECuCrZVrb9spsSA1y5ccQiqrlFdh\r\noeMCcjV0Dl+BmzbSssNmUrKxJlnIF2B2soxI8fsvvR+58Jgm3ibIu5Yikjz9\r\nQwajCVmDLfF9Rvub6ZCgyEIjSiZQ7Qd2UAIxIfzYrkLfQA1vRtmz35WYE4O3\r\nQylA8qGMEA1hZNfkO4fT7jhDeCMGz04RpNbyxSoy5Ed+LIg0aW1LO2HW23+S\r\nVN0x02WJmvW7/vW+KCW0WX3ZfM27lLecQQupQCwm3/d1u5f8E1iqLGE0phnv\r\nNJn24j3QePvlrI2CbQgMyeMxdSEBLLz3OfH96XHWdFOW/aaapWso6HXjbXn9\r\nLnhAaak/wtkMtF6mBr7O8LDUeNlhyfheTiFvsIMdvcruaaV+yi8K0t7akBqK\r\nCrPaee+dKlbjFYXAZb5PszlAIvm6vrtX198=\r\n=Okz3\r\n-----END PGP SIGNATURE-----\r\n"},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.10.1-next.6_1683242321353_0.6970338730204997"},"_hasShrinkwrap":false},"0.10.1-next.8":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.10.1-next.8","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build","build:clean":"tsc --build --clean && tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"0.3.1-unstable.1","@sphereon/pex":"2.0.1","@sphereon/ssi-sdk-core":"^0.10.1-next.8+7df0e64","@sphereon/ssi-sdk-did-utils":"^0.10.1-next.8+7df0e64","@sphereon/ssi-types":"^0.10.1-next.8+7df0e64","@sphereon/wellknown-dids-client":"^0.1.3","@types/uuid":"^9.0.1","@veramo/core":"4.2.0","@veramo/credential-w3c":"4.2.0","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.6.0","@veramo/cli":"4.2.0","@veramo/did-provider-key":"4.2.0","@veramo/did-resolver":"4.2.0","@veramo/utils":"4.2.0","did-resolver":"^4.1.0","nock":"^13.2.1"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"7df0e64ad6553e8153cf96d62156867fde8e4cef","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authorization request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst authorizationRequest = await agent.getSiopAuthorizationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authorization request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationRequestDetailsResponse = await agent.getSiopAuthorizationRequestDetails({\n  sessionId,\n  verifiedAuthorizationRequest: createAuthorizationResponse,\n})\n```\n\n### Verify authorization request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthorizationResponse = await agent.verifySiopAuthorizationRequestURI({\n  sessionId,\n  requestURI: createAuthorizationResponse,\n})\n```\n\n### Send authorization response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationResponse = await agent.sendSiopAuthorizationResponse({\n  sessionId,\n  verifiedAuthorizationRequest: verifiedAuthorizationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.10.1-next.8","_nodeVersion":"16.20.0","_npmVersion":"lerna/6.5.1/node@v16.20.0+x64 (linux)","dist":{"integrity":"sha512-6YTK/xOjtrpqpD4+0MyMQe0EEz1+MpbckkvYwqSbU2cKFZHpE/Oa0MVtEgIVHLv1Z4Pe5CSlMpYfnlbbeVRN+A==","shasum":"0091d5ce0a920d00ee0718f6682a572e8e6e217c","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.10.1-next.8.tgz","fileCount":34,"unpackedSize":143910,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDXnLK5HBxeE73Wm8sY4Ve1NlmspBs4XehoIF2DsEVBPgIgDIHcxiQt+7mydzi+wexB+Ei6YHfYBY4Rd6cFrgYeZvo="}]},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.10.1-next.8_1683307224762_0.6924944430500577"},"_hasShrinkwrap":false},"0.10.1-next.9":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.10.1-next.9","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build","build:clean":"tsc --build --clean && tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"0.3.1-unstable.1","@sphereon/pex":"2.0.1","@sphereon/ssi-sdk-core":"^0.10.1-next.9+1b2d26b","@sphereon/ssi-sdk-did-utils":"^0.10.1-next.9+1b2d26b","@sphereon/ssi-types":"^0.10.1-next.9+1b2d26b","@sphereon/wellknown-dids-client":"^0.1.3","@types/uuid":"^9.0.1","@veramo/core":"4.2.0","@veramo/credential-w3c":"4.2.0","cross-fetch":"^3.1.5","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.6.0","@veramo/cli":"4.2.0","@veramo/did-provider-key":"4.2.0","@veramo/did-resolver":"4.2.0","@veramo/utils":"4.2.0","did-resolver":"^4.1.0","nock":"^13.2.1"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"1b2d26bee8ef80eedbdb3389a36c960f30d9fa9d","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authorization request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst authorizationRequest = await agent.getSiopAuthorizationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authorization request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationRequestDetailsResponse = await agent.getSiopAuthorizationRequestDetails({\n  sessionId,\n  verifiedAuthorizationRequest: createAuthorizationResponse,\n})\n```\n\n### Verify authorization request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthorizationResponse = await agent.verifySiopAuthorizationRequestURI({\n  sessionId,\n  requestURI: createAuthorizationResponse,\n})\n```\n\n### Send authorization response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationResponse = await agent.sendSiopAuthorizationResponse({\n  sessionId,\n  verifiedAuthorizationRequest: verifiedAuthorizationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.10.1-next.9","_nodeVersion":"16.20.0","_npmVersion":"lerna/6.5.1/node@v16.20.0+x64 (linux)","dist":{"integrity":"sha512-XX4FRPqG6n1CKwS8aLFEmzc36/0DKH5DDOrx3bCqpi0D/Fk8y71BirxWsblRG1PQ6ZNUy0MGXF5A56F8BXDKtg==","shasum":"2f4456496be9e8f7c5773f998e8dad2dfa2530b9","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.10.1-next.9.tgz","fileCount":34,"unpackedSize":143910,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDnAmzGfJXaNQJIbHTOgpP2lMfK8JYRm7cqYaz8cXGCTQIhAJd03dNkltpCWhCOydAexlGMseK1NdYHtbEU9LXgt4MW"}]},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.10.1-next.9_1683309640161_0.9281421156229837"},"_hasShrinkwrap":false},"0.10.1-next.13":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.10.1-next.13","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build","build:clean":"tsc --build --clean && tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"0.3.1-unstable.1","@sphereon/pex":"2.0.1","@sphereon/ssi-sdk-core":"^0.10.1-next.13+8f56f22","@sphereon/ssi-sdk-did-utils":"^0.10.1-next.13+8f56f22","@sphereon/ssi-types":"^0.10.1-next.13+8f56f22","@sphereon/wellknown-dids-client":"^0.1.3","@types/uuid":"^9.0.1","@veramo/core":"4.2.0","@veramo/credential-w3c":"4.2.0","cross-fetch":"^3.1.5","did-jwt-vc":"3.1.3","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.6.0","@sphereon/ssi-sdk-agent-config":"^0.10.1-next.13+8f56f22","@veramo/did-provider-key":"4.2.0","@veramo/did-resolver":"4.2.0","@veramo/remote-client":"4.2.0","@veramo/remote-server":"4.2.0","@veramo/utils":"4.2.0","did-resolver":"^4.1.0","nock":"^13.2.1"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"8f56f226b2845ec49488734fabb9fde6ae707017","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authorization request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst authorizationRequest = await agent.getSiopAuthorizationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authorization request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationRequestDetailsResponse = await agent.getSiopAuthorizationRequestDetails({\n  sessionId,\n  verifiedAuthorizationRequest: createAuthorizationResponse,\n})\n```\n\n### Verify authorization request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthorizationResponse = await agent.verifySiopAuthorizationRequestURI({\n  sessionId,\n  requestURI: createAuthorizationResponse,\n})\n```\n\n### Send authorization response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationResponse = await agent.sendSiopAuthorizationResponse({\n  sessionId,\n  verifiedAuthorizationRequest: verifiedAuthorizationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.10.1-next.13","_nodeVersion":"18.16.0","_npmVersion":"lerna/6.6.2/node@v18.16.0+x64 (linux)","dist":{"integrity":"sha512-UfIp4TmSnLPULm0FswK8nJOqSwDpImpDgXRhF/ExkIJ4FthnPPRhuYqaeGnHqy+1BmcQhYkARfHjg/qtjq06sg==","shasum":"39de061208fbaaf13e28f6bf3a46dc9695790fa7","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.10.1-next.13.tgz","fileCount":34,"unpackedSize":144054,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGC13WMyWvyfv8N4L6UjDFvyxSQar6EGpjukYzX1zI/2AiAIByPYRmg+0uEnLQ/l3ifG+xen0GSx1CybqHXGqxyLeA=="}]},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.10.1-next.13_1683332811845_0.8788449319848985"},"_hasShrinkwrap":false},"0.10.1-next.14":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.10.1-next.14","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build","build:clean":"tsc --build --clean && tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"0.3.1-unstable.1","@sphereon/pex":"2.0.1","@sphereon/ssi-sdk-core":"^0.10.1-next.14+344ae1c","@sphereon/ssi-sdk-did-utils":"^0.10.1-next.14+344ae1c","@sphereon/ssi-types":"^0.10.1-next.14+344ae1c","@sphereon/wellknown-dids-client":"^0.1.3","@types/uuid":"^9.0.1","@veramo/core":"4.2.0","@veramo/credential-w3c":"4.2.0","cross-fetch":"^3.1.5","did-jwt-vc":"3.1.3","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.6.0","@sphereon/ssi-sdk-agent-config":"^0.10.1-next.14+344ae1c","@veramo/did-provider-key":"4.2.0","@veramo/did-resolver":"4.2.0","@veramo/remote-client":"4.2.0","@veramo/remote-server":"4.2.0","@veramo/utils":"4.2.0","did-resolver":"^4.1.0","nock":"^13.2.1"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"344ae1c41b4c30ceab399df3ee531635ae789835","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authorization request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst authorizationRequest = await agent.getSiopAuthorizationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authorization request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationRequestDetailsResponse = await agent.getSiopAuthorizationRequestDetails({\n  sessionId,\n  verifiedAuthorizationRequest: createAuthorizationResponse,\n})\n```\n\n### Verify authorization request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthorizationResponse = await agent.verifySiopAuthorizationRequestURI({\n  sessionId,\n  requestURI: createAuthorizationResponse,\n})\n```\n\n### Send authorization response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationResponse = await agent.sendSiopAuthorizationResponse({\n  sessionId,\n  verifiedAuthorizationRequest: verifiedAuthorizationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.10.1-next.14","_nodeVersion":"18.16.0","_npmVersion":"lerna/6.6.2/node@v18.16.0+x64 (linux)","dist":{"integrity":"sha512-Eqpk5Iqh0ohxNNtD55J3iyNuSuWqS1F37T864CUoawgrsvAu/LzNEi/YilTENNYeyNEY3I6nexA46/vY/KGAoQ==","shasum":"3ce0db613eddcfc588f72cea8c7748529dfb682d","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.10.1-next.14.tgz","fileCount":34,"unpackedSize":144054,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDSMr6JJRGDOGU0oTIDipln2y+JE6LSMgwiNTqH1y3EtAIhAMHdiHgqff3zYPMzHNSSY2b7afqucllsjQZoEsf9SXJD"}]},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.10.1-next.14_1683357319852_0.6821593499267311"},"_hasShrinkwrap":false},"0.10.2-next.11":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.10.2-next.11","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build","build:clean":"tsc --build --clean && tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"0.3.1-unstable.1","@sphereon/pex":"2.0.1","@sphereon/ssi-sdk-core":"^0.10.2-next.11+6e6b83f","@sphereon/ssi-sdk-did-utils":"^0.10.2-next.11+6e6b83f","@sphereon/ssi-types":"^0.10.2-next.11+6e6b83f","@sphereon/wellknown-dids-client":"^0.1.3","@types/uuid":"^9.0.1","@veramo/core":"4.2.0","@veramo/credential-w3c":"4.2.0","cross-fetch":"^3.1.5","did-jwt-vc":"3.1.3","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.6.0","@sphereon/ssi-sdk-agent-config":"^0.10.2-next.11+6e6b83f","@veramo/did-provider-key":"4.2.0","@veramo/did-resolver":"4.2.0","@veramo/remote-client":"4.2.0","@veramo/remote-server":"4.2.0","@veramo/utils":"4.2.0","did-resolver":"^4.1.0","nock":"^13.2.1"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"6e6b83fe7e6887cd2faad5846b8b1c7ad24aee7b","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authorization request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst authorizationRequest = await agent.getSiopAuthorizationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authorization request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationRequestDetailsResponse = await agent.getSiopAuthorizationRequestDetails({\n  sessionId,\n  verifiedAuthorizationRequest: createAuthorizationResponse,\n})\n```\n\n### Verify authorization request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthorizationResponse = await agent.verifySiopAuthorizationRequestURI({\n  sessionId,\n  requestURI: createAuthorizationResponse,\n})\n```\n\n### Send authorization response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationResponse = await agent.sendSiopAuthorizationResponse({\n  sessionId,\n  verifiedAuthorizationRequest: verifiedAuthorizationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.10.2-next.11","_nodeVersion":"18.16.0","_npmVersion":"lerna/6.6.2/node@v18.16.0+x64 (linux)","dist":{"integrity":"sha512-CN4tIDuxkoj4zjlx/hfwA4sc16LSveB68kEjocjk/dkw87e+Y0UBdtMN8AKtSJ88ssz8AFSewKRTH0m4ahKiAA==","shasum":"8fdd8dc2873a19b39c952b9a1ad49d08b6386058","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.10.2-next.11.tgz","fileCount":34,"unpackedSize":144054,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC80Nj6hpz3BzNQE+exzHRUBu3oa6uakTtaG3WdEDCRWAIhALvmePew6oyKUVVpyLdWcKzfwr9ZlSusFFCPlxPmxmOF"}]},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.10.2-next.11_1683495873420_0.49369125644979484"},"_hasShrinkwrap":false},"0.11.0":{"name":"@sphereon/ssi-sdk-did-auth-siop-authenticator","version":"0.11.0","source":"src/index.ts","main":"dist/index.js","types":"dist/index.d.ts","veramo":{"pluginInterfaces":{"IDidAuthSiopOpAuthenticator":"./src/types/IDidAuthSiopOpAuthenticator.ts"}},"scripts":{"build":"tsc --build","build:clean":"tsc --build --clean && tsc --build"},"dependencies":{"@sphereon/did-auth-siop":"0.3.1-unstable.1","@sphereon/pex":"2.0.1","@sphereon/ssi-sdk-core":"^0.11.0","@sphereon/ssi-sdk-did-utils":"^0.11.0","@sphereon/ssi-types":"^0.11.0","@sphereon/wellknown-dids-client":"^0.1.3","@types/uuid":"^9.0.1","@veramo/core":"4.2.0","@veramo/credential-w3c":"4.2.0","cross-fetch":"^3.1.5","did-jwt-vc":"3.1.3","uuid":"^8.3.2"},"devDependencies":{"@sphereon/did-uni-client":"^0.6.0","@sphereon/ssi-sdk-agent-config":"^0.11.0","@veramo/did-provider-key":"4.2.0","@veramo/did-resolver":"4.2.0","@veramo/remote-client":"4.2.0","@veramo/remote-server":"4.2.0","@veramo/utils":"4.2.0","did-resolver":"^4.1.0","nock":"^13.2.1"},"publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"license":"Apache-2.0","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"gitHead":"c0b30e037a02bb4bedbf1165feb73184ca8ef571","description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","_id":"@sphereon/ssi-sdk-did-auth-siop-authenticator@0.11.0","_nodeVersion":"18.16.0","_npmVersion":"lerna/6.6.2/node@v18.16.0+x64 (linux)","dist":{"integrity":"sha512-lBwpcOclDhS5kkxyodTbs2b9tsyIG6pT0QT99H5Bvr80l+Qad8idvL+AJxlAcVMylgZOnR4znOx6QPpaUifzVA==","shasum":"563773a714e3741fca6b9b21322fd69092b7d063","tarball":"https://registry.npmjs.org/@sphereon/ssi-sdk-did-auth-siop-authenticator/-/ssi-sdk-did-auth-siop-authenticator-0.11.0.tgz","fileCount":34,"unpackedSize":143974,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIBLSqS1lr+GxKq9C3/1BToBwPipVTbJ5aZ+rzufQpmHmAiBG2Dhg1IJii1ZmAPJbOu9pkZ82fyXRDcwW8YasFxrduQ=="}]},"_npmUser":{"name":"nklomp78","email":"dev@sphereon.com"},"directories":{},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/ssi-sdk-did-auth-siop-authenticator_0.11.0_1683497042917_0.3011506616258919"},"_hasShrinkwrap":false}},"time":{"created":"2021-12-16T15:00:05.782Z","0.1.2-unstable.135":"2021-12-16T15:00:05.977Z","modified":"2023-05-07T22:04:03.364Z","0.1.2-unstable.136":"2021-12-16T15:13:41.540Z","0.1.2-unstable.139":"2021-12-16T15:20:09.648Z","0.1.2-unstable.141":"2021-12-16T15:34:26.901Z","0.1.2-next.142":"2021-12-16T16:24:55.233Z","0.1.2-next.143":"2021-12-16T16:51:58.218Z","0.1.1-next.105":"2021-12-16T17:02:05.963Z","0.2.0":"2021-12-16T17:07:51.674Z","0.2.1-unstable.1":"2021-12-17T00:31:51.490Z","0.2.1-unstable.2":"2021-12-17T01:13:31.975Z","0.2.1-unstable.3":"2021-12-17T01:36:23.635Z","0.0.2-unstable.85":"2021-12-17T16:00:21.647Z","0.2.1-unstable.9":"2021-12-24T11:16:30.407Z","0.2.1-unstable.12":"2021-12-24T12:18:32.386Z","0.2.1-next.13":"2021-12-24T12:30:29.293Z","0.2.1-unstable.5":"2022-01-06T22:53:32.469Z","0.2.1-unstable.6":"2022-01-07T00:02:44.064Z","0.2.1-unstable.7":"2022-01-11T08:32:12.103Z","0.2.1-unstable.8":"2022-01-11T10:13:26.460Z","0.2.1-next.17":"2022-01-13T23:33:16.055Z","0.2.1-unstable.11":"2022-01-16T12:21:41.741Z","0.2.1-unstable.31":"2022-01-16T16:06:27.777Z","0.2.1-unstable.32":"2022-01-16T16:29:03.701Z","0.2.1-unstable.33":"2022-01-16T17:22:46.864Z","0.2.1-next.33":"2022-01-16T17:29:32.154Z","0.3.0":"2022-01-16T17:35:20.697Z","0.3.1-next.7":"2022-01-28T11:25:09.988Z","0.3.1":"2022-01-28T11:31:53.931Z","0.3.1-unstable.30":"2022-02-02T12:55:34.684Z","0.3.1-next.10":"2022-02-04T14:08:25.050Z","0.3.1-next.11":"2022-02-04T14:50:48.430Z","0.3.1-unstable.31":"2022-02-08T09:04:36.758Z","0.3.1-unstable.34":"2022-02-08T22:24:40.746Z","0.3.2-unstable.30":"2022-02-08T22:31:58.914Z","0.3.2-unstable.31":"2022-02-10T09:56:40.749Z","0.3.2-unstable.33":"2022-02-10T10:49:14.697Z","0.3.2-unstable.34":"2022-02-10T11:24:36.659Z","0.3.2-unstable.35":"2022-02-10T12:48:32.285Z","0.3.2-unstable.36":"2022-02-10T15:45:13.172Z","0.3.2-unstable.37":"2022-02-10T20:16:31.301Z","0.3.4-next.15":"2022-02-10T23:50:38.004Z","0.3.4":"2022-02-11T00:04:45.259Z","0.3.5-next.3":"2022-02-11T00:12:42.994Z","0.3.5-unstable.44":"2022-02-11T01:50:03.760Z","0.3.5-unstable.45":"2022-02-11T01:53:17.454Z","0.3.5-next.46":"2022-02-11T01:55:39.019Z","0.3.5-next.47":"2022-02-11T02:08:17.504Z","0.4.0":"2022-02-11T02:28:19.852Z","0.4.1-unstable.2":"2022-02-18T20:37:27.103Z","0.4.1-unstable.3":"2022-02-21T18:54:33.811Z","0.4.1-unstable.4":"2022-02-22T17:23:57.206Z","0.4.1-unstable.5":"2022-02-23T13:53:46.985Z","0.4.1-next.6":"2022-02-23T13:58:15.172Z","0.4.1-next.7":"2022-02-23T16:09:18.608Z","0.5.0":"2022-02-23T16:19:07.601Z","0.5.1-next.1":"2022-02-23T18:16:44.329Z","0.5.1":"2022-02-23T20:04:56.414Z","0.5.2-next.3":"2022-02-25T02:30:58.026Z","0.5.2-next.4":"2022-02-25T02:41:52.807Z","0.5.2-next.6":"2022-02-25T02:57:43.129Z","0.5.2-next.7":"2022-02-25T03:27:53.836Z","0.5.2-next.8":"2022-02-25T03:38:16.884Z","0.5.2-next.9":"2022-02-25T04:26:42.537Z","0.5.2-next.10":"2022-05-12T12:10:55.776Z","0.5.2-unstable.32":"2022-05-13T14:32:08.126Z","0.5.2-unstable.33":"2022-05-16T09:31:02.884Z","0.5.2-unstable.35":"2022-05-18T07:32:15.866Z","0.5.2-unstable.42":"2022-05-19T10:16:52.274Z","0.5.2-next.45":"2022-05-20T13:46:04.844Z","0.5.2-next.70":"2022-05-31T11:28:44.081Z","0.5.2-unstable.73":"2022-06-16T08:23:12.575Z","0.5.2-unstable.70":"2022-06-27T14:42:23.178Z","0.5.2-next.73":"2022-06-30T11:02:58.372Z","0.5.2-next.113":"2022-07-01T22:26:18.262Z","0.6.0":"2022-07-01T22:38:11.965Z","0.5.2-next.116":"2022-07-06T00:10:00.690Z","0.6.1-next.6":"2022-07-06T00:40:00.993Z","0.6.1-next.8":"2022-07-06T21:43:59.735Z","0.6.1-next.9":"2022-07-06T22:17:44.609Z","0.6.1-unstable.49":"2022-07-12T22:45:43.748Z","0.6.1-next.50":"2022-07-12T22:58:36.398Z","0.6.1-unstable.63":"2022-07-13T08:31:17.368Z","0.6.1-unstable.64":"2022-07-13T11:08:41.620Z","0.6.1-unstable.65":"2022-07-13T11:14:02.044Z","0.6.1-next.66":"2022-07-13T11:36:39.495Z","0.6.1-next.67":"2022-07-28T21:36:13.383Z","0.6.1-unstable.74":"2022-08-02T19:38:30.174Z","0.6.1-unstable.75":"2022-08-02T21:58:14.937Z","0.6.1-unstable.76":"2022-08-02T22:43:22.337Z","0.6.1-unstable.77":"2022-08-02T23:35:12.313Z","0.6.1-unstable.78":"2022-08-03T00:03:11.697Z","0.6.1-unstable.79":"2022-08-03T00:26:04.448Z","0.6.1-unstable.80":"2022-08-03T07:47:37.802Z","0.6.1-unstable.82":"2022-08-03T10:26:46.260Z","0.6.1-unstable.83":"2022-08-03T13:42:30.996Z","0.6.1-unstable.84":"2022-08-03T18:42:36.738Z","0.6.1-unstable.86":"2022-08-03T18:53:49.342Z","0.6.1-unstable.87":"2022-08-03T20:06:42.085Z","0.6.1-unstable.88":"2022-08-03T21:52:13.230Z","0.6.1-unstable.89":"2022-08-03T21:55:51.515Z","0.6.1-unstable.90":"2022-08-03T22:09:34.930Z","0.6.1-unstable.92":"2022-08-03T22:26:00.631Z","0.6.1-unstable.68":"2022-08-03T22:27:54.836Z","0.6.1-unstable.70":"2022-08-03T23:39:26.684Z","0.6.1-unstable.71":"2022-08-04T10:24:52.570Z","0.6.1-unstable.72":"2022-08-04T10:26:33.940Z","0.6.1-unstable.73":"2022-08-04T10:28:24.148Z","0.6.1-next.76":"2022-08-04T11:42:15.021Z","0.6.1-next.78":"2022-08-05T16:06:55.417Z","0.6.1-next.79":"2022-08-05T16:13:22.706Z","0.7.0":"2022-08-05T19:52:47.089Z","0.7.1-unstable.9":"2022-08-06T00:27:48.655Z","0.7.1-unstable.11":"2022-08-06T11:52:57.738Z","0.7.1-unstable.13":"2022-08-08T00:12:08.907Z","0.7.1-unstable.15":"2022-08-10T11:32:37.851Z","0.7.1-unstable.16":"2022-08-10T12:02:10.916Z","0.7.1-unstable.17":"2022-08-10T13:03:55.292Z","0.7.1-unstable.18":"2022-08-10T19:42:55.568Z","0.7.1-next.18":"2022-08-12T08:37:43.125Z","0.7.1-unstable.67":"2022-08-12T16:51:51.916Z","0.7.1-unstable.39":"2022-08-12T17:20:50.924Z","0.7.1-next.38":"2022-08-12T17:23:14.882Z","0.7.1-unstable.40":"2022-08-15T15:52:25.660Z","0.7.1-next.39":"2022-08-15T16:01:11.258Z","0.7.1-next.40":"2022-08-18T01:03:11.435Z","0.7.1-next.43":"2022-08-21T00:15:55.326Z","0.7.1-unstable.43":"2022-08-22T17:32:13.950Z","0.7.1-unstable.44":"2022-08-23T15:39:09.288Z","0.7.1-unstable.45":"2022-08-23T16:58:58.928Z","0.7.1-next.54":"2022-08-25T11:56:49.197Z","0.7.1-next.66":"2022-09-02T22:38:16.691Z","0.7.1-next.68":"2022-09-02T23:52:59.462Z","0.8.0":"2022-09-03T00:09:17.336Z","0.8.1-next.2":"2022-09-03T00:56:56.905Z","0.8.1-next.3":"2022-09-03T01:09:51.700Z","0.8.1-unstable.4":"2022-09-15T09:00:39.588Z","0.8.1-unstable.5":"2022-09-15T09:17:34.416Z","0.8.1-next.6":"2022-09-15T09:32:01.241Z","0.8.1-unstable.9":"2022-09-17T23:57:05.432Z","0.8.1-unstable.11":"2022-09-19T14:02:13.391Z","0.8.1-next.12":"2022-09-19T15:11:34.539Z","0.8.1-next.18":"2022-09-22T15:12:30.434Z","0.8.1-unstable.24":"2022-09-29T21:06:52.787Z","0.8.1-unstable.25":"2022-10-04T20:18:23.691Z","0.8.1-next.26":"2022-10-04T20:50:09.516Z","0.8.1-unstable.27":"2022-10-12T10:51:01.443Z","0.8.1-unstable.29":"2022-10-13T07:12:00.783Z","0.8.1-unstable.28":"2022-10-13T07:13:19.045Z","0.8.1-unstable.30":"2022-10-13T07:17:46.709Z","0.8.1-next.31":"2022-10-13T07:51:34.431Z","0.8.1-next.42":"2022-10-18T11:11:45.182Z","0.8.1-next.50":"2022-10-18T11:13:06.935Z","0.8.1-unstable.50":"2022-10-26T00:44:43.330Z","0.8.1-unstable.53":"2022-10-26T23:14:44.008Z","0.8.1-unstable.54":"2022-10-26T23:18:59.256Z","0.8.1-next.55":"2022-10-26T23:31:16.742Z","0.8.1-unstable.55":"2022-10-27T20:32:46.001Z","0.8.1-next.57":"2022-10-27T20:37:45.747Z","0.8.1-unstable.61":"2022-10-27T20:43:45.615Z","0.8.1-unstable.63":"2022-10-28T00:03:00.498Z","0.8.1-unstable.65":"2022-10-28T08:50:02.837Z","0.8.1-next.66":"2022-10-28T11:23:23.023Z","0.8.1-unstable.73":"2022-11-03T22:51:10.997Z","0.8.1-unstable.74":"2022-11-04T00:24:14.218Z","0.8.1-next.77":"2022-11-08T15:21:03.989Z","0.8.1-next.84":"2022-11-08T15:29:54.685Z","0.8.1-unstable.85":"2022-11-14T13:39:49.151Z","0.8.1-unstable.86":"2022-11-14T13:53:46.946Z","0.8.1-next.114":"2022-12-17T02:01:17.861Z","0.8.1-next.117":"2022-12-17T02:19:11.526Z","0.8.1-next.119":"2022-12-27T23:57:18.684Z","0.8.1-unstable.135":"2023-01-03T15:31:51.178Z","0.8.1-next.120":"2023-01-10T01:20:22.484Z","0.8.1-next.121":"2023-01-11T19:11:08.340Z","0.8.1-next.122":"2023-01-11T20:34:28.291Z","0.8.1-next.123":"2023-01-11T21:40:27.726Z","0.8.1-unstable.145":"2023-01-12T01:13:26.792Z","0.8.1-next.146":"2023-01-12T01:23:49.118Z","0.8.1-next.154":"2023-01-12T13:11:19.363Z","0.8.1-next.156":"2023-01-13T00:43:52.308Z","0.8.1-next.157":"2023-01-13T01:42:11.209Z","0.8.1-next.158":"2023-01-13T02:03:19.698Z","0.8.1-next.159":"2023-01-13T02:21:13.154Z","0.8.1-next.161":"2023-01-13T03:10:26.518Z","0.8.1-next.162":"2023-01-13T03:52:07.596Z","0.8.1-next.163":"2023-01-13T04:07:52.927Z","0.8.1-next.164":"2023-01-14T05:43:59.001Z","0.8.1-next.165":"2023-01-14T06:18:20.532Z","0.8.1-next.166":"2023-01-14T06:38:00.715Z","0.8.1-next.167":"2023-01-14T06:56:43.780Z","0.8.1-next.168":"2023-01-14T07:31:09.364Z","0.8.1-next.169":"2023-01-15T02:09:16.051Z","0.8.1-unstable.170":"2023-01-15T03:25:59.053Z","0.8.1-unstable.171":"2023-01-15T03:36:07.024Z","0.8.1-unstable.172":"2023-01-15T03:59:32.190Z","0.8.1-unstable.173":"2023-01-15T05:05:39.152Z","0.8.1-unstable.174":"2023-01-15T05:47:59.463Z","0.8.1-unstable.175":"2023-01-15T08:06:53.218Z","0.8.1-unstable.176":"2023-01-16T02:09:24.769Z","0.8.1-unstable.177":"2023-01-16T04:45:10.069Z","0.8.1-unstable.178":"2023-01-16T05:00:46.966Z","0.8.1-unstable.179":"2023-01-20T01:15:06.719Z","0.8.1-next.179":"2023-01-25T21:35:04.231Z","0.8.1-next.190":"2023-02-16T10:03:54.988Z","0.8.1-next.192":"2023-02-17T16:01:04.012Z","0.8.1-next.194":"2023-02-17T22:04:26.672Z","0.8.1-unstable.195":"2023-02-18T00:42:26.618Z","0.8.1-unstable.198":"2023-02-18T03:01:06.692Z","0.8.1-unstable.200":"2023-02-18T13:16:35.087Z","0.8.1-unstable.201":"2023-02-18T14:05:06.080Z","0.8.1-unstable.203":"2023-02-18T22:50:38.571Z","0.8.1-unstable.206":"2023-02-21T01:47:37.559Z","0.8.1-unstable.207":"2023-02-21T02:07:55.889Z","0.8.1-unstable.208":"2023-02-22T03:26:42.114Z","0.8.1-unstable.209":"2023-02-22T19:38:13.820Z","0.8.1-unstable.210":"2023-02-22T23:42:33.296Z","0.8.1-unstable.211":"2023-02-23T00:15:45.800Z","0.8.1-unstable.212":"2023-02-23T01:44:54.907Z","0.8.1-unstable.213":"2023-02-23T02:13:39.573Z","0.8.1-unstable.215":"2023-02-23T19:33:15.422Z","0.8.1-unstable.217":"2023-02-23T20:31:31.554Z","0.8.1-unstable.218":"2023-02-23T22:12:09.429Z","0.8.1-unstable.219":"2023-02-23T22:51:49.244Z","0.8.1-unstable.220":"2023-02-23T23:26:07.133Z","0.8.1-unstable.221":"2023-02-24T00:31:15.315Z","0.8.1-unstable.222":"2023-02-24T01:25:25.716Z","0.8.1-unstable.225":"2023-02-24T04:09:35.645Z","0.8.1-unstable.227":"2023-02-25T01:03:06.129Z","0.8.1-unstable.228":"2023-02-26T03:24:47.256Z","0.8.1-unstable.229":"2023-02-26T07:06:43.322Z","0.8.1-unstable.230":"2023-02-26T07:36:10.200Z","0.8.1-unstable.238":"2023-02-26T09:50:28.902Z","0.8.1-unstable.239":"2023-02-26T16:50:24.300Z","0.8.1-unstable.240":"2023-02-26T23:35:34.428Z","0.8.1-unstable.242":"2023-02-27T02:00:05.533Z","0.8.1-unstable.264":"2023-03-03T08:34:50.621Z","0.8.1-unstable.263":"2023-03-03T16:17:13.247Z","0.8.1-unstable.271":"2023-03-06T14:35:41.015Z","0.8.1-unstable.272":"2023-03-06T15:10:16.720Z","0.8.1-unstable.277":"2023-03-07T12:01:06.241Z","0.8.1-unstable.266":"2023-03-07T22:21:12.825Z","0.8.1-unstable.267":"2023-03-07T23:30:51.773Z","0.8.1-unstable.268":"2023-03-07T23:41:37.949Z","0.8.1-unstable.269":"2023-03-08T00:08:54.813Z","0.8.1-unstable.270":"2023-03-08T01:01:37.055Z","0.8.1-unstable.278":"2023-03-08T16:28:33.152Z","0.8.1-unstable.279":"2023-03-08T19:45:49.232Z","0.8.1-unstable.280":"2023-03-08T22:12:03.178Z","0.8.1-next.272":"2023-03-09T00:37:13.204Z","0.9.0":"2023-03-09T00:46:02.081Z","0.9.1-next.9":"2023-03-10T00:49:30.172Z","0.9.1-unstable.17":"2023-03-10T10:27:19.267Z","0.9.1-next.10":"2023-03-11T00:05:15.775Z","0.9.1-next.11":"2023-03-11T00:33:35.694Z","0.9.1-next.12":"2023-03-11T01:10:46.398Z","0.9.1-next.13":"2023-03-11T03:52:37.059Z","0.9.1-next.15":"2023-03-11T23:46:59.077Z","0.9.1-next.16":"2023-03-12T05:23:35.362Z","0.9.1-next.17":"2023-03-12T05:57:59.753Z","0.9.1-unstable.27":"2023-03-15T14:00:16.013Z","0.9.1-unstable.28":"2023-03-15T14:25:49.826Z","0.9.1-unstable.30":"2023-03-15T15:01:18.935Z","0.9.1-unstable.34":"2023-03-15T16:32:23.888Z","0.9.1-unstable.18":"2023-03-16T10:13:22.800Z","0.9.1-unstable.19":"2023-03-16T10:18:46.395Z","0.9.1-unstable.20":"2023-03-16T10:20:43.081Z","0.9.1-next.21":"2023-03-17T09:18:44.468Z","0.9.1-next.42":"2023-03-17T09:57:17.901Z","0.9.1-next.55":"2023-03-17T11:52:32.300Z","0.9.1-next.56":"2023-03-19T00:04:49.451Z","0.9.1-next.62":"2023-03-22T00:37:18.725Z","0.9.1-unstable.66":"2023-03-22T12:05:46.958Z","0.9.1-unstable.67":"2023-03-23T09:12:28.064Z","0.9.1-unstable.65":"2023-03-23T11:57:51.524Z","0.9.1-unstable.68":"2023-03-23T15:13:41.407Z","0.9.1-next.69":"2023-03-24T11:59:19.008Z","0.9.1-unstable.85":"2023-03-27T10:49:47.001Z","0.9.1-unstable.87":"2023-03-27T12:09:37.907Z","0.9.1-unstable.88":"2023-03-27T12:12:09.292Z","0.9.1-next.89":"2023-03-27T21:34:25.969Z","0.9.1-next.96":"2023-03-29T09:07:08.913Z","0.9.1-next.97":"2023-03-29T19:23:34.040Z","0.9.1-next.99":"2023-03-29T19:26:19.409Z","0.9.1-next.100":"2023-03-29T19:35:36.837Z","0.9.1-unstable.101":"2023-04-13T09:46:37.648Z","0.9.1-unstable.102":"2023-04-14T13:15:45.869Z","0.9.1-next.103":"2023-04-17T09:11:47.380Z","0.9.1-unstable.104":"2023-04-24T15:14:59.750Z","0.9.1-next.105":"2023-04-24T20:42:01.779Z","0.9.1-next.107":"2023-04-25T09:59:35.320Z","0.9.1-next.109":"2023-04-26T11:33:42.891Z","0.9.1-next.113":"2023-04-26T14:56:54.407Z","0.9.1-next.114":"2023-04-27T19:16:50.289Z","0.9.1-next.116":"2023-04-27T22:10:56.096Z","0.9.1-next.118":"2023-04-29T20:45:32.859Z","0.9.1-next.120":"2023-04-30T10:53:12.893Z","0.9.1-next.121":"2023-04-30T20:39:42.186Z","0.10.0":"2023-04-30T22:10:52.787Z","0.10.1-next.2":"2023-05-01T01:30:35.383Z","0.10.1":"2023-05-01T01:36:26.491Z","0.10.1-next.6":"2023-05-04T23:18:41.581Z","0.10.1-next.8":"2023-05-05T17:20:25.001Z","0.10.1-next.9":"2023-05-05T18:00:40.450Z","0.10.1-next.13":"2023-05-06T00:26:52.039Z","0.10.1-next.14":"2023-05-06T07:15:20.098Z","0.10.2-next.11":"2023-05-07T21:44:33.577Z","0.11.0":"2023-05-07T22:04:03.245Z"},"maintainers":[{"name":"nklomp78","email":"dev@sphereon.com"},{"name":"nklomp","email":"nklomp@sphereon.com"},{"name":"spostma","email":"spostma@sphereon.com"},{"name":"bramtencate","email":"btencate@sphereon.com"}],"description":"<!--suppress HtmlDeprecatedAttribute --> <h1 align=\"center\">   <br>   <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>   <br>DID Auth SIOP OP Authenticator (Type","homepage":"https://github.com/Sphereon-Opensource/SSI-SDK#readme","keywords":["Sphereon","SSI","Veramo","DID","SIOP","SIOPv2","OIDC4VP","Presentation Exchange","OpenID Connect","Authenticator"],"repository":{"type":"git","url":"git+ssh://git@github.com/Sphereon-Opensource/SSI-SDK.git"},"author":{"name":"Sphereon","email":"dev@sphereon.com"},"bugs":{"url":"https://github.com/Sphereon-Opensource/SSI-SDK/issues"},"license":"Apache-2.0","readme":"<!--suppress HtmlDeprecatedAttribute -->\n<h1 align=\"center\">\n  <br>\n  <a href=\"https://www.sphereon.com\"><img src=\"https://sphereon.com/content/themes/sphereon/assets/img/logo.svg\" alt=\"Sphereon\" width=\"400\"></a>\n  <br>DID Auth SIOP OP Authenticator (Typescript) \n  <br>\n</h1>\n\n---\n\n**Warning: This package still is in very early development. Breaking changes without notice will happen at this point!**\n\n---\n\nA Veramo authentication plugin using the [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop) authentication library for having clients / people conforming to\nthe [Self Issued OpenID Provider v2 (SIOPv2)](https://openid.net/specs/openid-connect-self-issued-v2-1_0.html)\nand [OpenID Connect for Verifiable Presentations (OIDC4VP)](https://openid.net/specs/openid-connect-4-verifiable-presentations-1_0.html)\nas specified in the OpenID Connect working group.\n\n## Self Issued OpenID Provider v2 (SIOP)\n\nFor more information about [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#introduction), see the documentation in the readme.\n\n## Requirements\n\nFor this plugin a DID resolver is also required. A DID resolver can be added to the agent as plugin as seen in the example below.\n\n## Available functions\n\n- getSessionForSiop\n- registerSessionForSiop\n- removeSessionForSiop\n- registerCustomApprovalForSiop\n- removeCustomApprovalForSiop\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\nThe following functions can also be used on the session object without the need of a session id first.\n\n- authenticateWithSiop\n- getSiopAuthorizationRequestFromRP\n- getSiopAuthorizationRequestDetails\n- verifySiopAuthorizationRequestURI\n- sendSiopAuthorizationResponse\n\n## Usage\n\n### Adding the plugin to an agent:\n\n```typescript\nimport { IDidAuthSiopOpAuthenticator } from '@sphereon/ssi-sdk-did-auth-siop-authenticator'\nimport { Resolver } from 'did-resolver'\nimport { getDidKeyResolver } from '@veramo/did-provider-key'\nimport { DIDResolverPlugin } from '@veramo/did-resolver'\nimport { getUniResolver } from '@sphereon/did-uni-client'\n\nconst agent = createAgent<IDidAuthSiopOpAuthenticator & IResolver>({\n  plugins: [\n    new DidAuthSiopOpAuthenticator(),\n    new DIDResolverPlugin({\n      resolver: new Resolver({\n        ...getDidKeyResolver(),\n        ...getUniResolver('lto', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n        ...getUniResolver('factom', { resolveUrl: 'https://uniresolver.test.sphereon.io/1.0/identifiers' }),\n      }),\n    }),\n  ],\n})\n```\n\n### Get an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.getSessionForSiop({\n  sessionId,\n})\n```\n\n### Register an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst identifier = {\n  did: 'did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a',\n  provider: 'example_provider',\n  controllerKeyId: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n  keys: [\n    {\n      kid: `did:ethr:0xb9c5714089478a327f09197987f16f9e5d936e8a#controller`,\n      kms: 'example_kms',\n      type: 'Ed25519' as const,\n      publicKeyHex: '1e21e21e...',\n      privateKeyHex: 'elfcvtswdbn...',\n    },\n  ],\n  services: [],\n}\n\nconst opSession = await agent.registerSessionForSiop({\n  sessionId,\n  identifier,\n})\n```\n\n### Remove an OP session:\n\n```typescript\nconst sessionId = 'example_session_id'\nconst opSession = await agent.removeSessionForSiop({\n  sessionId,\n})\n```\n\n### Authenticate with DID auth SIOP:\n\nIt is possible to register custom approval functions as an extra confirmation before sending the authentication response.\nThese functions can then be used as an optional parameter. It is also possible to directly provide a custom approval function.\n\nThese custom approval functions can also be provided at agent creation.\n\n```typescript\nawait agent.registerCustomApprovalForSiop({\n  key: 'example_key',\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => Promise.resolve(),\n})\n```\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst customApprovalKey = 'example_key'\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: customApprovalKey,\n})\n```\n\n```typescript\nconst authenticationResponse = await agent.authenticateWithSiop({\n  sessionId,\n  stateId,\n  redirectUrl,\n  customApproval: (verifiedAuthorizationRequest: VerifiedAuthorizationRequest) => {\n    return Promise.resolve()\n  },\n})\n```\n\n### Get authorization request from the relying party:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#rp-creates-the-authentication-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst stateId = 'example_state_id'\nconst redirectUrl = 'https://example.com'\nconst authorizationRequest = await agent.getSiopAuthorizationRequestFromRP({\n  sessionId,\n  stateId,\n  redirectUrl,\n})\n```\n\n### Get authorization request details:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-presentation-exchange)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationRequestDetailsResponse = await agent.getSiopAuthorizationRequestDetails({\n  sessionId,\n  verifiedAuthorizationRequest: createAuthorizationResponse,\n})\n```\n\n### Verify authorization request URI:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-authentication-request-verification)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst verifiedAuthorizationResponse = await agent.verifySiopAuthorizationRequestURI({\n  sessionId,\n  requestURI: createAuthorizationResponse,\n})\n```\n\n### Send authorization response:\n\nFor more detailed information see: [Self Issued OpenID Provider v2 (SIOP)](https://github.com/Sphereon-Opensource/did-auth-siop#op-creates-the-authentication-response-using-the-verified-request)\n\n```typescript\nconst sessionId = 'example_session_id'\nconst authorizationResponse = await agent.sendSiopAuthorizationResponse({\n  sessionId,\n  verifiedAuthorizationRequest: verifiedAuthorizationResponse,\n})\n```\n\n## Installation\n\n```shell\nyarn add @sphereon/ssi-sdk-did-auth-siop-authenticator\n```\n\n## Build\n\n```shell\nyarn build\n```\n","readmeFilename":"README.md"}