You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 10, 2024. It is now read-only.
@@ -16,7 +46,10 @@ auth_jwt_algorithm HS256; # or RS256
16
46
auth_jwt_validate_email on; # or off
17
47
```
18
48
19
-
So, a typical use would be to specify the key on the main level and then only turn on the locations that you want to secure (not the login page). Unauthorized requests are given 401 "Unauthorized" responses, you can redirect them with the nginx's `error_page` directive.
49
+
So, a typical use would be to specify the key on the main level and then only
50
+
turn on the locations that you want to secure (not the login page). Unauthorized
51
+
requests are given 401 "Unauthorized" responses, you can redirect them with the
By default the authorization header is used to provide a JWT for validation. However, you may use the `auth_jwt_validation_type` configuration to specify the name of a cookie that provides the JWT.
70
+
By default the authorization header is used to provide a JWT for validation.
71
+
However, you may use the `auth_jwt_validation_type` configuration to specify the name of a cookie that provides the JWT.
38
72
39
73
40
74
41
-
The default algorithm is 'HS256', for symmetric key validation. Also supported is 'RS256', for RSA 256-bit public key validation.
75
+
The default algorithm is 'HS256', for symmetric key validation.
76
+
Also supported is 'RS256', for RSA 256-bit public key validation.
42
77
43
-
If using "auth_jwt_algorithm RS256;", then the 'auth_jwt_key' field must be set to your public key. That is the public key, rather than a PEM certificate. I.e.:
78
+
If using "auth_jwt_algorithm RS256;", then the 'auth_jwt_key' field must be set to your public key.
79
+
That is the public key, rather than a PEM certificate. I.e.:
44
80
45
81
```
46
82
auth_jwt_key "-----BEGIN PUBLIC KEY-----
@@ -54,16 +90,10 @@ oQIDAQAB
54
90
-----END PUBLIC KEY-----";
55
91
```
56
92
57
-
58
-
59
-
By default, the module will attempt to validate the email address field of the JWT, then set the x-email header of the session, and will log an error if it isn't found. To disable this behavior, for instance if you are using a different user identifier property such as 'sub', set:
93
+
By default, the module will attempt to validate the email address field of the JWT, then set the x-email header of the
94
+
session, and will log an error if it isn't found. To disable this behavior, for instance if you are using a different
95
+
user identifier property such as 'sub', set:
60
96
61
97
```
62
98
auth_jwt_validate_email off;
63
99
```
64
-
65
-
66
-
67
-
The Dockerfile builds all of the dependencies as well as the module, downloads a binary version of nginx, and runs the module as a dynamic module.
68
-
69
-
Have a look at build.sh, which creates the docker image and container and executes some test requests to illustrate that some pages are secured by the module and requre a valid JWT.
0 commit comments