
Security News
Axios Maintainer Confirms Social Engineering Attack Behind npm Compromise
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.
@trace4eu/authorisation-wrapper
Advanced tools
The `AuthorisationWrapper` class can be used for requesting an access token to the following authorisation servers: - EBSI Authorisation API: https://hub.ebsi.eu/apis/pilot/authorisation/v4. This is used by the `TimestampWrapper` and `TrackAndTraceWra
The AuthorisationWrapper class can be used for requesting an access token to the following authorisation servers:
EBSI Authorisation API: https://hub.ebsi.eu/apis/pilot/authorisation/v4.
This is used by the TimestampWrapper and TrackAndTraceWrapper for requesting an access token to EBSI, required value to consume EBSI Timestamp and Track and Trace apis.
Trace4eu authorization server: https://api-dev-auth.trace4eu.eu/oauth2/token.
This server is part of the authorization-and-authentication server of Trace4eu (https://github.com/trace4eu/authorization-and-authentication).
The client needs to execute a Oauth client credentials flow by sending a jwt assertion
It's used by the vc-component too when issuing EBSI verifiable credentials and when the authorization server issue and verify JWTs for managing the credential issuance process within the OIDC4VCI flow.
It depends on the SignatureWrapper for making the signatures. In order to instantiate the EbsiAuthorisationApi or the Trace4euAuthorisationApi, the wallet is required.
constructor(wallet: Wallet)Creates a new instance of the Wallet class.
Parameters:
isEnterprise: boolean: flag to indicate if keys will be imported locally otherwise it will link to an Enterprise Wallet.did: string: it represents the did of the entity.entityKeys: KeyPairData[]: array of keys in hex format. You need to specify the algorithm of each key.Example:
const did = 'did:ebsi:zobuuYAHkAbRFCcqdcJfTgR';
const entityKeys = [
{
alg: Algorithm.ES256K,
privateKeyHex:
'<ecc private key>',
kid: '<optional key identifier>'
},
{
alg: Algorithm.ES256,
privateKeyHex:
'<ecc private key>',,
kid: '<optional key identifier>'
},
];
const wallet = WalletFactory.createInstance(false, did, entityKeys);
EbsiAuthorisationApi(wallet: Wallet)Creates a new instance of the EbsiAuthorisationApi class.
Parameters:
wallet: Wallet: wallet will be used forExample:
const ebsiAuthorisationApi = new EbsiAuthorisationApi(wallet);
Trace4euAuthorisationApi(wallet: Wallet)Creates a new instance of the Trace4euAuthorisationApi class.
Parameters:
wallet: Wallet: wallet will be used forExample:
const trace4euAuthorisationApi = new Trace4euAuthorisationApi(wallet);
getAccessTokenRequest an access token to the corresponding authorization server.
Parameters:
alg: string: algorithm to be used.scope: string: scope to be requestedcredentials: string | string[]: ebsi authz server is an OIDC4VP server and vp_token needs to be presented with the required VCs according to the presentation definitionReturns:
Promise<string>: access tokenExample:
const ebsiAccessToken = await ebsiAuthorisationApi.getAccessToken(
'ES256',
'tnt_create',
[],
);
const trace4euAccessToken = await trace4euAuthorisationApi.getAccessToken(
'ES256',
'ocs:read',
);
FAQs
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.