Getting Started

🎉 Huzzah! So you've decided to take the plunge into the wonderful world of Authentication!

This guide will attempt to quickly walk you through how you can utilize Salte Auth for authentication.

Picking a Provider

What is a Provider?

A Provider (Identity Provider) tells Salte Auth who you're going to be authenticating with.

For a list of examples you should check out the providers page!.

😱 Which Provider should I use?!?

That primarily depends on where your priorities are.

I need all the features!

If you're worried about SSO (Single Sign-On) then an OpenID Connect Provider like Auth0, Azure, etc. are probably your best bet.

I'm not made of money!

If cost is more of a concern I'd recommend using one of the OAuth2 Providers like GitHub, Google, Facebook, etc.

Picking a Handler

What is a Handler?

A Handler tells Salte Auth how you're going to be authenticating.

For a list of examples you should check out the handlers page!.

Setting up Salte Auth

Install

# Install the Core
$ npm install @salte-auth/salte-auth
# Install a Provider
$ npm install @salte-auth/auth0
# Install a Handler
$ npm install @salte-auth/redirect

Usage

import { SalteAuth } from '@salte-auth/salte-auth';
import { Auth0 } from '@salte-auth/auth0';
import { Redirect } from '@salte-auth/redirect';

// Configure SalteAuth with Auth0's url and client id.
const auth = new SalteAuth({
  providers: [
    new Auth0({
      url: 'https://salte-os.auth0.com',
      clientID: '9JTBXBREtckkFHTxTNBceewrnn7NeDd0',

      routes: true
    })
  ],

  handlers: [
    new Redirect({
      default: true
    })
  ]
});

Examples

Checkout our examples repository for a collection of examples in a variety of frameworks!

Last updated