Skip to content
This repository was archived by the owner on Mar 10, 2024. It is now read-only.

Commit 734527e

Browse files
committed
Merge branch 'master' into pr/42
2 parents 43ab8d5 + bf24cbe commit 734527e

File tree

2 files changed

+15
-16
lines changed

2 files changed

+15
-16
lines changed

Dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ FROM centos:7
22

33
LABEL maintainer="TeslaGov" email="[email protected]"
44

5-
ARG NGINX_VERSION=1.12.2
5+
ARG NGINX_VERSION=1.16.1
66

77
ENV LD_LIBRARY_PATH=/usr/local/lib
88

@@ -133,6 +133,8 @@ RUN wget http://nginx.org/download/nginx-$NGINX_VERSION.tar.gz && \
133133
# Get nginx ready to run
134134
COPY resources/nginx.conf /etc/nginx/nginx.conf
135135
COPY resources/test-jwt-nginx.conf /etc/nginx/conf.d/test-jwt-nginx.conf
136+
RUN rm -rf /usr/share/nginx/html
137+
RUN cp -r /root/dl/nginx-1.16.1/html /usr/share/nginx
136138
RUN cp -r /usr/share/nginx/html /usr/share/nginx/secure
137139
RUN cp -r /usr/share/nginx/html /usr/share/nginx/secure-rs256
138140
RUN cp -r /usr/share/nginx/html /usr/share/nginx/secure-auth-header

README.md

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -63,19 +63,9 @@ ___location /secure-___location/ {
6363
}
6464
```
6565

66-
```
67-
auth_jwt_validation_type AUTHORIZATION;
68-
auth_jwt_validation_type COOKIE=rampartjwt;
69-
```
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.
72-
73-
66+
The default algorithm is 'HS256', for symmetric key validation. When using HS256, the value for `auth_jwt_key` should be specified in binhex format. It is recommended to use at least 256 bits of data (32 pairs of hex characters or 64 characters in total) as in the example above. Note that using more than 512 bits will not increase the security. For key guidelines please see NIST Special Publication 800-107 Recommendation for Applications Using Approved Hash Algorithms, Section 5.3.2 The HMAC Key.
7467

75-
The default algorithm is 'HS256', for symmetric key validation.
76-
Also supported is 'RS256', for RSA 256-bit public key validation.
77-
78-
If using "auth_jwt_algorithm RS256;", then the 'auth_jwt_key' field must be set to your public key.
68+
The configuration also supports the `auth_jwt_algorithm` 'RS256', for RSA 256-bit public key validation. If using "auth_jwt_algorithm RS256;", then the `auth_jwt_key` field must be set to your public key.
7969
That is the public key, rather than a PEM certificate. I.e.:
8070

8171
```
@@ -90,10 +80,17 @@ oQIDAQAB
9080
-----END PUBLIC KEY-----";
9181
```
9282

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:
83+
This module supports two ways of presenting the token.
84+
```
85+
auth_jwt_validation_type AUTHORIZATION;
86+
auth_jwt_validation_type COOKIE=rampartjwt;
87+
```
88+
By default the authorization header is used to provide a JWT for validation.
89+
However, you may use the `auth_jwt_validation_type` configuration to specify the name of a cookie that provides the JWT.
9690

9791
```
9892
auth_jwt_validate_email off;
9993
```
94+
By default, the module will attempt to validate the email address field of the JWT, then set the x-email header of the
95+
session, and will log an error if it isn't found. To disable this behavior, for instance if you are using a different
96+
user identifier property such as 'sub', set `auth_jwt_validate_email` to the value `off`.

0 commit comments

Comments
 (0)