Giter Site home page Giter Site logo

guardian-example's Introduction

Guardian example

Example for Guardian configuration and transaction API

Setup

You need to setup the following variable on your server in order for this example to work

AUTH0_API_TOKEN: 'See https://auth.com/docs/api/management/v2',
AUTH0_DOMAIN: '{tenant}.auth0.com',
AUTH0_SECRET: 'Client secret: DON\'T NOT COMMIT TO GIT REPO',
AUTH0_CLIENT: 'Client id',
AUTH0_TENANT: 'Name of your tenant',
AUTH0_REGION: 'au|us|eu',
COOKIE_SECRET: 'Secret to sign generated cookies DON\'T NOT COMMIT TO GIT REPO',
MY_API_SECRET: 'Secret to sign your own tokens DON\'T NOT COMMIT TO GIT REPO'

Multifactor rule

Activate Guardian an use the following multifactor rule

function (user, context, callback) {
  if (user.user_metadata && user.user_metadata.use_mfa === false){
    return callback(null, user, context);
  }

  context.multifactor = {
    provider: 'guardian', //required
    ignoreCookie: true, // optional. Force Auth0 MFA everytime this rule runs. Defaults to false. if accepted by users the cookie lasts for 30 days (this cannot be changed)
  };

  return callback(null, user, context);
}

User profile

User profile

MFA Configuration

MFA Configuration

Step up / Require login

Step up

guardian-example's People

Contributors

dafortune avatar fiddur avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.