From 97c4cf0e2a81890d8f1deb991730fac16725b415 Mon Sep 17 00:00:00 2001 From: Rishichandra Wawhal Date: Fri, 4 Jan 2019 19:31:18 +0530 Subject: [PATCH] update auth docs (#1305) * fix broken auth example links * add jwt examples * misc auth docs changes --- .../auth/common-roles-auth-examples.rst | 4 ++-- docs/graphql/manual/auth/index.rst | 3 ++- docs/graphql/manual/auth/jwt-examples.rst | 17 ++++++++++++++++ docs/graphql/manual/auth/jwt.rst | 20 +++++++++++++------ docs/graphql/manual/auth/webhook-examples.rst | 8 ++++---- .../manual/guides/integrations/auth0-jwt.rst | 1 + 6 files changed, 40 insertions(+), 13 deletions(-) create mode 100644 docs/graphql/manual/auth/jwt-examples.rst diff --git a/docs/graphql/manual/auth/common-roles-auth-examples.rst b/docs/graphql/manual/auth/common-roles-auth-examples.rst index b7824ca0698..e129c4893b3 100644 --- a/docs/graphql/manual/auth/common-roles-auth-examples.rst +++ b/docs/graphql/manual/auth/common-roles-auth-examples.rst @@ -1,5 +1,5 @@ -Common roles and auth examples -============================== +Access control examples +======================= .. contents:: Table of contents :backlinks: none diff --git a/docs/graphql/manual/auth/index.rst b/docs/graphql/manual/auth/index.rst index 08edbc12d55..48acecee218 100644 --- a/docs/graphql/manual/auth/index.rst +++ b/docs/graphql/manual/auth/index.rst @@ -34,7 +34,8 @@ Next, let's setup some :doc:`basic access control rules `. basics roles-variables - Permissions examples + common-roles-auth-examples webhook webhook-examples jwt + jwt-examples diff --git a/docs/graphql/manual/auth/jwt-examples.rst b/docs/graphql/manual/auth/jwt-examples.rst new file mode 100644 index 00000000000..df079516807 --- /dev/null +++ b/docs/graphql/manual/auth/jwt-examples.rst @@ -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 `__: + A todo app that uses Hasura GraphQL Engine and Auth0 JWT + +- `Firebase JWT example `__: + Barebones example to show how to have Firebase Auth integrated with Hasura JWT mode + diff --git a/docs/graphql/manual/auth/jwt.rst b/docs/graphql/manual/auth/jwt.rst index b1a73475317..537948cee99 100644 --- a/docs/graphql/manual/auth/jwt.rst +++ b/docs/graphql/manual/auth/jwt.rst @@ -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 ` \ No newline at end of file diff --git a/docs/graphql/manual/auth/webhook-examples.rst b/docs/graphql/manual/auth/webhook-examples.rst index 59978f01ffb..5913f5ab73c 100644 --- a/docs/graphql/manual/auth/webhook-examples.rst +++ b/docs/graphql/manual/auth/webhook-examples.rst @@ -6,7 +6,7 @@ Auth webhook samples :depth: 1 :local: -We have put together a `GitHub Node.js repo `__ that has some sample auth +We have put together a `GitHub Node.js repo `__ that has some sample auth webhooks configured. You can deploy these samples using `glitch `__: @@ -19,9 +19,9 @@ You can deploy these samples using `glitch `__: Once deployed, you can use any of the following endpoints as your auth webhook in the GraphQL engine: -- ``/simple/webhook`` (`View source `__) -- ``/firebase/webhook`` (`View source `__) -- ``/auth0/webhook`` (`View source `__) +- ``/simple/webhook`` (`View source `__) +- ``/firebase/webhook`` (`View source `__) +- ``/auth0/webhook`` (`View source `__) .. note:: diff --git a/docs/graphql/manual/guides/integrations/auth0-jwt.rst b/docs/graphql/manual/guides/integrations/auth0-jwt.rst index 83ca2fa1a10..97726acae3a 100644 --- a/docs/graphql/manual/guides/integrations/auth0-jwt.rst +++ b/docs/graphql/manual/guides/integrations/auth0-jwt.rst @@ -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