Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

smartid-auth

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

smartid-auth

Smart-ID authentication module for Node.JS

  • 1.0.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2
decreased by-66.67%
Maintainers
1
Weekly downloads
 
Created
Source

smartid-auth

Smart-ID authentication module for Node.JS

Install

npm install smartid-auth

Trying out with Demo

  1. [Download SmartID Demo app for Android] (https://play.google.com/store/apps/details?id=com.stagnationlab.sk&ah=a4HzglGscCO-V56s6FlAj3ty7Aw)
  2. Set up your demo app in your phone
  3. cd node_modules/smartid-auth/
  4. npm run demo [countrycode EE/LT/LV] [Personal-ID-Number] Example: npm run demo EE 12345678901

Usage

Documentation is in progress, refer to the example below:

const SmartIDAuth = require('smartid-auth');
const smartauth = new SmartIDAuth({
  host: 'https://sid.demo.sk.ee/smart-id-rp/v1',
  requestParams: {
    relyingPartyUUID: '00000000-0000-0000-0000-000000000000',
    relyingPartyName: 'DEMO',
    certificateLevel: 'QUALIFIED'
  }
});

smartauth.authenticate('EE', 'ESTONIAN-ID-CODE-GOES-HERE', 'MESSAGE-TO-DISPLAY-ON-PHONE-GOES-HERE').then(session => {
  // This is the verification code you should display to the user (on your site):
  console.log('Verification code: ' + session.verificationCode);
  console.log('Waiting for user action...');
  session.pollStatus().then(response => {
    console.log('Authentication OK!');
    console.log(response.data);
  }).catch(err => {
    console.error('Authentication error', err);
  });
}).catch(err => {
  console.error('Error on initializing authentication', err);
});

Demo output example

$ npm run demo EE 10101010005
Verification code: 8865
Waiting for user action...
Authentication OK!
{ countryName: 'EE',
  surname: 'SMART-ID',
  givenName: 'DEMO',
  serialNumber: 'PNOEE-10101010005',
  commonName: 'SMART-ID,DEMO,PNOEE-10101010005',
  organizationalUnitName: 'AUTHENTICATION' }

Running tests

Smart-ID provides test accounts for automated testing. Running npm run test will go through those:

EndResultCountrynational-identity-numbercertificateLevel
OKEE10101010005QUALIFIED
OKLV010101-10006QUALIFIED
OKLT10101010005QUALIFIED
USER_REFUSEDEE10101010016QUALIFIED
USER_REFUSEDLT10101010016QUALIFIED

Keywords

FAQs

Package last updated on 26 Oct 2017

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc