mirror of
https://github.com/hasura/graphql-engine.git
synced 2024-12-15 09:22:43 +03:00
update auth docs (#1305)
* fix broken auth example links * add jwt examples * misc auth docs changes
This commit is contained in:
parent
8ec69b68e6
commit
97c4cf0e2a
@ -1,5 +1,5 @@
|
||||
Common roles and auth examples
|
||||
==============================
|
||||
Access control examples
|
||||
=======================
|
||||
|
||||
.. contents:: Table of contents
|
||||
:backlinks: none
|
||||
|
@ -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
|
||||
|
17
docs/graphql/manual/auth/jwt-examples.rst
Normal file
17
docs/graphql/manual/auth/jwt-examples.rst
Normal 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
|
||||
|
@ -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>`
|
@ -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::
|
||||
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user