Skip to content

Commit e2ada99

Browse files
authored
Note JWTs are not the only authentication method
1 parent dc61ac9 commit e2ada99

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

src/pages/postgraphile/jwt-guide.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,21 @@ title: PostGraphile JWT Guide
99
> project. The language of the specification is meant to be generally applicable
1010
> and adoptable by any who might want to use it.
1111
12+
**NOTE**: what follows is a specification of how you can use JWTs to authenticate a user
13+
with PostgreSQL such that PostgreSQL may perform your authorization checks. This
14+
is not the only way of achieving this goal with PostGraphile, for example you
15+
can do as the PostGraphile maintainer does and use standard session-based
16+
authentication (i.e. with cookies) via the relevant Express/Koa/Fastify middleware
17+
and PostGraphile's [`pgSettings` function](/postgraphile/usage-library/#pgsettings-function)
18+
allowing you to leverage powerful pre-built authentication stacks such as
19+
[passport.js](http://www.passportjs.org/) which has OAuth integration with most
20+
major "social login" providers.
21+
1222
## PostgreSQL JSON Web Token Serialization Specification
1323

1424
This specification aims to define a standard way to serialize [JSON Web
1525
Tokens][jwt] (JWT, [RFC 7519][rfc7519]) to a PostgreSQL database for developers
16-
who want to move authentication logic into their PostgreSQL schema.
26+
who want to move authorization logic into their PostgreSQL schema.
1727

1828
[Terminology][jwt-terms] from the JSON Web Token specification will be used.
1929

0 commit comments

Comments
 (0)