update auth docs (#1305)

* fix broken auth example links

* add jwt examples

* misc auth docs changes
This commit is contained in:
Rishichandra Wawhal 2019-01-04 19:31:18 +05:30 committed by Rikin Kachhia
parent 8ec69b68e6
commit 97c4cf0e2a
6 changed files with 40 additions and 13 deletions

View File

@ -1,5 +1,5 @@
Common roles and auth examples
==============================
Access control examples
=======================
.. contents:: Table of contents
:backlinks: none

View File

@ -34,7 +34,8 @@ Next, let's setup some :doc:`basic access control rules <basics>`.
basics
roles-variables
Permissions examples <common-roles-auth-examples>
common-roles-auth-examples
webhook
webhook-examples
jwt
jwt-examples

View File

@ -0,0 +1,17 @@
Auth JWT examples
=================
.. contents:: Table of contents
:backlinks: none
:depth: 1
:local:
Here are some sample apps that use JWT authorization. You can follow the instructions in the READMEs of the
repositories to get started.
- `Auth0 JWT example <https://github.com/hasura/graphql-engine/tree/master/community/examples/todo-auth0-jwt>`__:
A todo app that uses Hasura GraphQL Engine and Auth0 JWT
- `Firebase JWT example <https://github.com/hasura/graphql-engine/tree/master/community/examples/firebase-jwt>`__:
Barebones example to show how to have Firebase Auth integrated with Hasura JWT mode

View File

@ -326,12 +326,20 @@ And use it in the ``key`` field:
"
}
Generate JWT Config
^^^^^^^^^^^^^^^^^^^
The JWT Config to be used in env ``HASURA_GRAPHQL_JWT_SECRET`` or ``--jwt-secret`` flag can be generated using
the following UI https://hasura.io/jwt-config.
Generating JWT Config
---------------------
Currently the UI supports generating config for Auth0 and Firebase. The config generated from this page can be
directly pasted in yaml files and command line arguments as it takes care of escaping new lines.
The JWT Config to be used in env ``HASURA_GRAPHQL_JWT_SECRET`` or ``--jwt-secret`` flag can be generated using:
https://hasura.io/jwt-config.
**Currently the UI supports generating config for Auth0 and Firebase**.
The config generated from this page can be directly pasted in yaml files and command line arguments as it takes
care of escaping new lines.
.. image:: ../../../img/graphql/manual/auth/jwt-config-generated.png
:scale: 50 %
**See:**
- :doc:`Auth JWT examples <jwt-examples>`

View File

@ -6,7 +6,7 @@ Auth webhook samples
:depth: 1
:local:
We have put together a `GitHub Node.js repo <https://github.com/hasura/sample-auth-webhook>`__ that has some sample auth
We have put together a `GitHub Node.js repo <https://github.com/hasura/graphql-engine/tree/master/community/boilerplates/auth-webhooks/nodejs-express>`__ that has some sample auth
webhooks configured.
You can deploy these samples using `glitch <https://glitch.com/>`__:
@ -19,9 +19,9 @@ You can deploy these samples using `glitch <https://glitch.com/>`__:
Once deployed, you can use any of the following endpoints as your auth webhook in the GraphQL engine:
- ``/simple/webhook`` (`View source <https://github.com/hasura/sample-auth-webhook/blob/master/server.js#L25>`__)
- ``/firebase/webhook`` (`View source <https://github.com/hasura/sample-auth-webhook/tree/master/firebase>`__)
- ``/auth0/webhook`` (`View source <https://github.com/hasura/sample-auth-webhook/tree/master/auth0>`__)
- ``/simple/webhook`` (`View source <https://github.com/hasura/graphql-engine/blob/master/community/boilerplates/auth-webhooks/nodejs-express/server.js>`__)
- ``/firebase/webhook`` (`View source <https://github.com/hasura/graphql-engine/blob/master/community/boilerplates/auth-webhooks/nodejs-express/firebase/firebaseHandler.js>`__)
- ``/auth0/webhook`` (`View source <https://github.com/hasura/graphql-engine/blob/master/community/boilerplates/auth-webhooks/nodejs-express/auth0/auth0Handler.js>`__)
.. note::

View File

@ -95,6 +95,7 @@ The config generated from this page can be directly pasted in yaml files and com
escaping new lines.
.. image:: ../../../../img/graphql/manual/auth/jwt-config-generated.png
:scale: 50 %
Add Access Control Rules via Hasura Console