Skip to content

Signing API calls - Documentation #1

Description

@SavageLion92

https://docs.licensespring.com/docs/signing-api-calls
const fetch = require('node-fetch');

const sharedKey = 'XXXXXXXXX-XXXXX-XXXXXXXXXXXXX_XXXXXX_XXXXXX',
apiKey = 'XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX',
productCode = "XX",
baseURL = 'https://api.licensespring.com/api/v4/webhook';

function GenerateHeaders(){
const signingDate = (new Date()).toUTCString(),
signingString = licenseSpring\ndate: ${signingDate};

const signature = crypto.createHmac('sha256', sharedKey).update(signingString).digest('base64');

return {
        'Content-Type': 'application/json',
        'Date': signingDate,
        'Authorization' : `algorithm="hmac-sha256",headers="date",signature="${signature}",apikey="${apiKey}"`,
    };

}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions