/meteor-auth0-oauth

OAuth handler for Auth0

Primary LanguageJavaScript

Meteor Auth0 OAuth 2.0 Provider

This is our approach of integrating Auth0 into Meteor. It focuses on the implementation on the backend and is frontend-agnostic, so you can develop your own frontend or use Auth0 Lock (But I don't know how to do it the moment).

Usage

Set your Auth0 Domain, Client ID and Client Secret in settings.json (read more about how to store your API keys (Securing API Keys)[https://guide.meteor.com/security.html#api-keys] ):

"private": {
  "AUTH0_CLIENT_SECRET": YOUR_CLIENT_SECRET,
  /* ... other private keys */
},
"public": {
  "AUTH0_DOMAIN": yourauth0domain.eu.auth0.com
  "AUTH0_CLIENT_ID": YOUR_CLIENT_ID,
  /* ... other private keys */
}

Launch Login

Then, you can simply initiate auth with on the client: Meteor.loginWithAuth0()

Onescreener Branches

master-stable - used for Live pages

master-stable-onescreener-editor - used for Onescreener Editor

Supported Options

Value Default Description
loginStyle 'popup' choose between popup (default) and redirect
type - adds a hash to the url. Can be used to identify login and signup flows separately.
path - redirect path after successful login

Project Aim

Although there are already some other meteor-auth0 repositories out there, this one has some different objectives:

  • Future ready: Use ES6
  • Separation of concerns: Auth0 can be used with or without Lock.js. This repo aims to be the common base.
  • Best practices: Use settings.json instead of Autopublish and databases.

Thanks and further info