File tree Expand file tree Collapse file tree 2 files changed +35
-0
lines changed Expand file tree Collapse file tree 2 files changed +35
-0
lines changed Original file line number Diff line number Diff line change 1+ select
2+ sign(
3+ payload := '{"sub":"1234567890","name":"John Doe","iat":1516239022}',
4+ secret := 'secret',
5+ algorithm := 'HS256'
6+ );
7+ sign
8+ -------------------------------------------------------------------------------------------------------------------------------------------------------------
9+ eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.XbPfbIHMI6arZ3Y922BhjWgQzWXcXNrz0ogtVhfEd2o
10+ (1 row)
11+
12+ select
13+ verify(
14+ token := 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYW1lIjoiRm9vIn0.Q8hKjuadCEhnCPuqIj9bfLhTh_9QSxshTRsA5Aq4IuM',
15+ secret := 'secret',
16+ algorithm := 'HS256'
17+ );
18+ verify
19+ ----------------------------------------------------------------
20+ ("{""alg"":""HS256"",""typ"":""JWT""}","{""name"":""Foo""}",t)
21+ (1 row)
22+
Original file line number Diff line number Diff line change 1+ select
2+ sign(
3+ payload := ' {"sub":"1234567890","name":"John Doe","iat":1516239022}' ,
4+ secret := ' secret' ,
5+ algorithm := ' HS256'
6+ );
7+
8+ select
9+ verify(
10+ token := ' eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYW1lIjoiRm9vIn0.Q8hKjuadCEhnCPuqIj9bfLhTh_9QSxshTRsA5Aq4IuM' ,
11+ secret := ' secret' ,
12+ algorithm := ' HS256'
13+ );
You can’t perform that action at this time.
0 commit comments