0.9.9 • Published 5 years ago

smartid-calls v0.9.9

Weekly downloads
1
License
ISC
Repository
github
Last release
5 years ago

Typescript Smart-ID comunication layer for Node.js

Install

npm install smartid-calls

Usage

import SmartID from 'smartid-calls';

config = {
  algorithm: 'SHA256',
  host: 'https://sid.demo.sk.ee/smart-id-rp/v1',
  requestParams: {
    relyingPartyUUID: '00000000-0000-0000-0000-000000000000',
    relyingPartyName: 'DEMO',
    certificateLevel: 'QUALIFIED'
  }
}
smartauth = new SmartID(config);

const persNr = '010101-10006';
const country = 'LV';

// Initiate the authentication session
const resp = await smartauth.authenticate(country, persNr, 'Testing');
const sessionId = resp.sessionId;
const authHash = resp.authHash;

// Get the session
const sess = await smartauth.getSession(sessionId);

// Verify that it has been properly signed
const verification = await smartauth.verifyRequest(sessionId, sess.all, authHash);

Additionally Proxy server credentials can be supplied, to route traffic through specific IP address, which is whitelisted on SmartID side.

//...
config = {
  algorithm: 'SHA256',
  host: 'https://sid.demo.sk.ee/smart-id-rp/v1',
  requestParams: {
    relyingPartyUUID: '00000000-0000-0000-0000-000000000000',
    relyingPartyName: 'DEMO',
    certificateLevel: 'QUALIFIED'
  },
  proxy: {
    host: 'example.hostname.com',
    port: 8080,
    username: 'proxu-username',
    password: 'your-password',
  },
}
smartauth = new SmartID(config);
//...

Running tests

Running npm run test will use automated identities to test different cases. Smart-ID provides test accounts for automated testing.

0.9.9

5 years ago

0.9.8

5 years ago

0.9.7

5 years ago

0.9.6

5 years ago

0.9.5

5 years ago

0.9.4

5 years ago

0.9.3

5 years ago

0.9.2

5 years ago

0.9.1

5 years ago

0.9.0

5 years ago