File tree Expand file tree Collapse file tree
issuer-rest/lib/__tests__ Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -256,6 +256,7 @@ describe('VcIssuer', () => {
256256 credentialIssuerMetadata : {
257257 credential_endpoint : 'http://localhost:3456/test/credential-endpoint' ,
258258 credential_issuer : 'http://localhost:3456/test' ,
259+ token_endpoint : 'http://localhost:3456/test/token' ,
259260 credentials_supported : [
260261 {
261262 credentialSubject : {
Original file line number Diff line number Diff line change 55 CreateCredentialOfferURIResult ,
66 CREDENTIAL_MISSING_ERROR ,
77 CredentialDataSupplierInput ,
8+ CredentialIssuerMetadata ,
89 CredentialIssuerMetadataOpts ,
910 CredentialOfferFormat ,
1011 CredentialOfferPayloadV1_0_11 ,
@@ -69,6 +70,7 @@ export class VcIssuer<DIDDoc extends object> {
6970 cNonceExpiresIn ?: number | undefined // expiration duration in seconds
7071 } ,
7172 ) {
73+ this . setDefaultTokenEndpoint ( issuerMetadata )
7274 this . _issuerMetadata = issuerMetadata
7375 this . _defaultCredentialOfferBaseUri = args . defaultCredentialOfferBaseUri
7476 this . _credentialOfferSessions = args . credentialOfferSessions
@@ -603,6 +605,12 @@ export class VcIssuer<DIDDoc extends object> {
603605 return credential
604606 }
605607
608+ private setDefaultTokenEndpoint ( issuerMetadata : Partial < CredentialIssuerMetadata > ) {
609+ if ( ! issuerMetadata . token_endpoint ) {
610+ issuerMetadata . token_endpoint = `${ issuerMetadata . credential_issuer } /token`
611+ }
612+ }
613+
606614 get userPinRequired ( ) : boolean {
607615 return this . _userPinRequired
608616 }
You can’t perform that action at this time.
0 commit comments