From 3b8ec49fba9700d0718a8addf8091bac5b7472c6 Mon Sep 17 00:00:00 2001 From: kraserge Date: Sun, 14 Apr 2019 19:08:48 +0300 Subject: [PATCH] SQL inside pgjwt (#207) Correct url https://github.com/michelp/pgjwt/blob/master/pgjwt--0.1.0.sql --- auth.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/auth.rst b/auth.rst index a0ddc2ee5..0800a0810 100644 --- a/auth.rst +++ b/auth.rst @@ -155,7 +155,7 @@ You can create a valid JWT either from inside your database or via an external s JWT from SQL ~~~~~~~~~~~~ -You can create JWT tokens in SQL using the `pgjwt extension `_. It's simple and requires only pgcrypto. If you're on an environment like Amazon RDS which doesn't support installing new extensions, you can still manually run the `SQL inside pgjwt `_ (you'll need to replace ``@extschema@`` with another schema or just delete it) which creates the functions you will need. +You can create JWT tokens in SQL using the `pgjwt extension `_. It's simple and requires only pgcrypto. If you're on an environment like Amazon RDS which doesn't support installing new extensions, you can still manually run the `SQL inside pgjwt `_ (you'll need to replace ``@extschema@`` with another schema or just delete it) which creates the functions you will need. Next write a stored procedure that returns the token. The one below returns a token with a hard-coded role, which expires five minutes after it was issued. Note this function has a hard-coded secret as well.