JWT#
El módulo permite la validación de JSON Web Tokens (JWT) usando claves especificadas.
Es incompatible con el módulo Auth JWT. Para instalar el módulo, use uno de los
siguientes paquetes: Angie: Angie PRO: Habilite el módulo en el contexto Para documentación detallada y código fuente, consulte:
max-lt/nginx-jwt-moduleInstalación#
angie-module-jwt
angie-pro-module-jwt
Carga del módulo#
main{}
:load_module modules/ngx_http_auth_jwt_module.so;
Ejemplo de configuración#
http {
server {
auth_jwt_key "0123456789abcdef" hex;
auth_jwt off;
# Autorización vía cabecera Authentication
location /secured-by-auth-header/ {
auth_jwt on;
}
# Autorización vía cookie
location /secured-by-cookie/ {
auth_jwt $cookie_MyCookieName;
}
# Herencia y sobrescritura de claves
location /secured-by-auth-header-too/ {
auth_jwt_key "another-secret";
auth_jwt on;
}
# Autorización vía clave RSA
location /secured-by-rsa-key/ {
auth_jwt_key /etc/keys/rsa-public.pem file;
auth_jwt on;
}
location /not-secure/ {}
}
}
Información adicional#