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).
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 */
}
Then, you can simply initiate auth with on the client:
Meteor.loginWithAuth0()
master-stable
- used for Live pages
master-stable-onescreener-editor
- used for Onescreener Editor
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 |
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.