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
@@ -17,7 +47,9 @@ auth_jwt_algorithm HS256; # or RS256
17
47
auth_jwt_validate_email on; # or off
18
48
```
19
49
20
-
So, a typical use would be to specify the key and loginurl on the main level and then only turn on the locations that you want to secure (not the login page). Unauthorized requests are given 302 "Moved Temporarily" responses with a ___location of the specified loginurl.
50
+
So, a typical use would be to specify the key and loginurl on the main level
51
+
and then only turn on the locations that you want to secure (not the login page).
52
+
Unauthorized requests are given 302 "Moved Temporarily" responses with a ___location of the specified loginurl.
21
53
22
54
```
23
55
auth_jwt_redirect off;
@@ -28,13 +60,16 @@ If you prefer to return 401 Unauthorized, you may turn `auth_jwt_redirect` off.
28
60
auth_jwt_validation_type AUTHORIZATION;
29
61
auth_jwt_validation_type COOKIE=rampartjwt;
30
62
```
31
-
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.
63
+
By default the authorization header is used to provide a JWT for validation.
64
+
However, you may use the `auth_jwt_validation_type` configuration to specify the name of a cookie that provides the JWT.
32
65
33
66
34
67
35
-
The default algorithm is 'HS256', for symmetric key validation. Also supported is 'RS256', for RSA 256-bit public key validation.
68
+
The default algorithm is 'HS256', for symmetric key validation.
69
+
Also supported is 'RS256', for RSA 256-bit public key validation.
36
70
37
-
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.:
71
+
If using "auth_jwt_algorithm RS256;", then the 'auth_jwt_key' field must be set to your public key.
72
+
That is the public key, rather than a PEM certificate. I.e.:
38
73
39
74
```
40
75
auth_jwt_key "-----BEGIN PUBLIC KEY-----
@@ -48,16 +83,10 @@ oQIDAQAB
48
83
-----END PUBLIC KEY-----";
49
84
```
50
85
51
-
52
-
53
-
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:
86
+
By default, the module will attempt to validate the email address field of the JWT, then set the x-email header of the
87
+
session, and will log an error if it isn't found. To disable this behavior, for instance if you are using a different
88
+
user identifier property such as 'sub', set:
54
89
55
90
```
56
91
auth_jwt_validate_email off;
57
92
```
58
-
59
-
60
-
61
-
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.
62
-
63
-
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