| title | Falcor API Tutorial | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| name | Falcor API | ||||||||
| thirdParty | false | ||||||||
| alias |
|
||||||||
| languages |
|
||||||||
| image | /media/platforms/falcor.png | ||||||||
| tags |
|
||||||||
| snippets |
|
::: panel-info System Requirements This tutorial and seed project have been tested with the following:
- NodeJS 5.6.0 :::
<%= include('../_includes/_package', { pkgRepo: 'node-auth0', pkgBranch: 'master', pkgPath: 'examples/falcor-api', pkgFilePath: null, pkgType: 'server' }) %>
Otherwise, Please follow the steps below to configure your existing Falcor app to use it with Auth0.
You need to add a few dependencies, including express-jwt. Also, If you haven't already done so, you need to install falcor-express and falcor-router.
Just run the following code to install the dependencies and add them to your package.json.
${snippet(meta.snippets.dependencies)}
You need to set the ClientID and ClientSecret in express-jwt's configuration so that it can validate and sign JWTs for you.
${snippet(meta.snippets.setup)}
In your Falcor app, you serve a virtual JSON resource from a single endpoint. You can protect this endpoint globally with the express-jwt middleware.
${snippet(meta.snippets.use)}
When you send a request to the Falcor model, you need to include the JWT as an Authorization header.
${snippet(meta.snippets.frontend)}
Your Falcor app is now secure with Auth0 and express-jwt. Congrats, you're awesome!