=encoding utf-8 =head1 NAME ngx_http_auth_jwt_module - Module ngx_http_auth_jwt_module =head1 The C module (1.11.3) implements client authorization by validating the provided L (JWT) using the specified keys. JWT claims must be encoded in a L (JWS) structure. The module can be used for L authentication. The module may be combined with other access modules, such as L, L, and L, via the L directive. B This module is available as part of our commercial subscription. =head1 Example Configuration location / { auth_jwt "closed site"; auth_jwt_key_file conf/keys.json; } =head1 Directives =head2 auth_jwt B auth_jwt I> [I>] E C> B I B I B I B I Enables validation of JSON Web Token. The specified I> is used as a C. Parameter value can contain variables. The optional C argument specifies a variable that contains JSON Web Token. By default, JWT is passed in the C header as a L. JWT may be also passed as a cookie or a part of a query string: auth_jwt "closed site" token=$cookie_auth_token; The special value C cancels the effect of the C directive inherited from the previous configuration level. =head2 auth_jwt_key_file B auth_jwt_key_file I>> B I B I B I Specifies a I> in L format for validating JWT signature. Parameter value can contain variables. =head1 Embedded Variables The C module supports embedded variables. Variables that return L: =over =item C<$jwt_claim_aud> the C (audience) claim =item C<$jwt_claim_email> the C claim =item C<$jwt_claim_exp> the C (expiration time) claim =item C<$jwt_claim_iat> the C (issued at) claim =item C<$jwt_claim_iss> the issuer of the claim =item C<$jwt_claim_jti> the JWT ID =item C<$jwt_claim_nbf> the C (not-before time) claim =item C<$jwt_claim_sub> the subject of the JWT =back Variables that return parameters of L: =over =item C<$jwt_header_alg> the C (algorithm) header parameter =item C<$jwt_header_cty> the C (content type) header parameter =item C<$jwt_header_enc> the C (encryption algorithm) header parameter =item C<$jwt_header_kid> the C (key ID) header parameter =item C<$jwt_header_typ> the C (type) header parameter =back