Skip to content

Unofficial NodeJs itsme library used to authenticate users.

License

Notifications You must be signed in to change notification settings

chainius/node-itsme

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

node-itsme

Unofficial NodeJs itsme library used to authenticate users.

Simple example:

const ItsMe    = require('itsme');

async function main() {

    const itsme = new ItsMe({
        client_id: 'test account',
        auth_redirect: 'https://localhost:8080/itsme'
    });

    itsme.setKeys([
      enc_key,
      sig_key
    );

    //-----

    const authUrl = await itsme.authUrl('openid profile address phone service:PROJECT_LOGIN');

    console.log('Please # on the following url:')
    console.log(authUrl);
    console.log("");
    
    //-----
    //Once token received:

    const token = "...";
    const authResult = await itsme.parseAuthResponse(token)

    console.log("");
    console.log("Parsed auth response:")
    console.log(JSON.stringify(authResult, null, 4));
    console.log("")

    const userinfo = await itsme.userinfo( authResult.access_token );
    console.log("Received userinfo:")
    console.log(JSON.stringify(userinfo, null, 4));
}

main().catch(console.error)

About

Unofficial NodeJs itsme library used to authenticate users.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published