eos-auth
Add user authentication and wallet access to any EOS dApp
Last updated 6 days ago by apimarket .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install eos-auth 
SYNC missed versions from official npm registry.

oreid-js

ORE ID Helper library written in Javascript

About

oreid-js is a javascript helper library for interacting with the Aikon ORE ID service.

ORE ID is a simple way to add OAuth login to your blockchain enabled app.

Install npm package:

npm install eos-auth

Usage

Example code:

//Initialize the library
let oreId = new OreId({ appId, apiKey, oreIdUrl });

//Start the OAuth flow by setting the user's browser to this URL
let authUrl = await oreId.getOreIdAuthUrl({ provider, callbackUrl, backgroundColor });
//...then handle the callback results of the Auth flow
let authResults = oreId.handleAuthResponse(authCallbackResults);

//Request that the user sign a transaction by setting the user's browser to this URL
let signUrl = await oreId.getOreIdSignUrl({ account, transaction, signCallbackUrl, chain, state, broadcast, returnSignedTransaction });
//...then handle the callback results of the Sign flow
let signResults = oreId.handleSignResponse(signedCallbackResults);

//Get the user's info given a blockchain account
let userInfo = await oreId.getUserInfoFromApi(account);

Express Middleware

This library includes Express middleware that you can use to simplify handling the callbacks from the ORE ID service.

// authCallbackHandler middleware handles callback response from ORE ID and extracts results
app.use('/authcallback', authCallbackHandler(oreId) );

Check out the Express Server example for a complete example.

Using EOS Transit and/or UAL

eos-auth makes it easy for you to add many popular EOS wallets to your app. It integrates EOS Transit and UAL so that you can use any wallet they support. eos-auth is the easiest way to use EOS Transit or UAL with your app.

EOS Transit

// add the provider package for each wallet you want to support
import scatterProvider from 'eos-transit-scatter-provider';
// pass in the array of providers when you initialize the library
const eosTransitWalletProviders = [ scatterProvider(), ... ]
const oreId = new OreId({ ..., eosTransitWalletProviders });

UAL

// add the provider package for each wallet you want to support
import { Scatter } from 'ual-scatter';
// pass in the array of providers when you initialize the library
const ualWalletProviders = [ Scatter, ... ]
let oreId = new OreId({ ..., ualWalletProviders });

NOTE: You can use both UAL and Transit together however you can't pass in duplicate providers. Using ual-scatter and eos-transit-scatter-provider at the same time will result in an error.

Current Support

Providers/Authenticators EOS Transit UAL
Scatter
Ledger
Lynx
Token Pocket
Meet One
Keycat
Whalevault
Portis

Check out the Express Server example for a complete example.

Example projects

Refer to the examples folder in the ore-id-docs repo for the following sample projects

  • ReactJS - A simple ReactJS website that includes React Login button component

  • React Native - A React Native app that includes a React OAuth flow modal component

  • Express Server - A simple Express server that includes the use of middleware to automate handling of callbacks

  • React Passwordless - A simple ReactJS website to call the passwordless api

Current Tags

  • 2.2.0                                ...           latest (6 days ago)

36 Versions

  • 2.2.0                                ...           6 days ago
  • 2.1.23                                ...           6 days ago
  • 2.1.22                                ...           a month ago
  • 2.1.21                                ...           a month ago
  • 2.1.20                                ...           a month ago
  • 2.1.19                                ...           a month ago
  • 2.1.18                                ...           a month ago
  • 2.1.17                                ...           a month ago
  • 2.1.16                                ...           a month ago
  • 2.1.15                                ...           2 months ago
  • 2.1.14                                ...           2 months ago
  • 2.1.13                                ...           2 months ago
  • 2.1.12                                ...           2 months ago
  • 2.1.11                                ...           3 months ago
  • 2.1.10                                ...           3 months ago
  • 2.1.9                                ...           3 months ago
  • 2.1.8                                ...           3 months ago
  • 2.1.7                                ...           3 months ago
  • 2.1.6                                ...           3 months ago
  • 2.1.5                                ...           3 months ago
  • 2.1.4                                ...           3 months ago
  • 2.1.3                                ...           3 months ago
  • 2.1.2                                ...           3 months ago
  • 2.1.1                                ...           4 months ago
  • 2.1.0                                ...           4 months ago
  • 2.0.2                                ...           4 months ago
  • 2.0.1                                ...           4 months ago
  • 2.0.0                                ...           4 months ago
  • 1.2.7                                ...           4 months ago
  • 1.2.6                                ...           5 months ago
  • 1.2.5                                ...           5 months ago
  • 1.2.4                                ...           5 months ago
  • 1.2.3                                ...           5 months ago
  • 1.2.2                                ...           6 months ago
  • 1.2.1                                ...           6 months ago
  • 1.2.0                                ...           6 months ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 74
Last Day 0
Last Week 40
Last Month 163
Dependencies (8)
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |