|
16 | 16 |
|
17 | 17 | #include "ngx_http_auth_jwt_header_processing.h"
|
18 | 18 | #include "ngx_http_auth_jwt_binary_converters.h"
|
| 19 | +#include "ngx_http_auth_jwt_query_processing.h" |
19 | 20 | #include "ngx_http_auth_jwt_string.h"
|
20 | 21 |
|
21 | 22 | #include <stdio.h>
|
@@ -513,7 +514,7 @@ static char * getJwt(ngx_http_request_t *r, ngx_str_t auth_jwt_validation_type)
|
513 | 514 | ngx_table_elt_t *authorizationHeader;
|
514 | 515 | char* jwtPtr = NULL;
|
515 | 516 | ngx_str_t jwtCookieVal;
|
516 |
| - //ngx_str_t jwtQueryVal; |
| 517 | + ngx_str_t jwtQueryVal; |
517 | 518 | ngx_int_t n;
|
518 | 519 | ngx_int_t bearer_length;
|
519 | 520 | ngx_str_t authorizationHeaderStr;
|
@@ -543,7 +544,23 @@ static char * getJwt(ngx_http_request_t *r, ngx_str_t auth_jwt_validation_type)
|
543 | 544 | }
|
544 | 545 | else if (auth_jwt_validation_type.len > sizeof("QUERY=") && ngx_strncmp(auth_jwt_validation_type.data, "QUERY=", sizeof("QUERY=") - 1)==0)
|
545 | 546 | {
|
546 |
| - ngx_log_error(NGX_LOG_DEBUG, r->connection->log, 0, "auth_jwt_validation_type.len %d", auth_jwt_validation_type.len); |
| 547 | + auth_jwt_validation_type.data += sizeof("QUERY=") - 1; |
| 548 | + auth_jwt_validation_type.len -= sizeof("QUERY=") - 1; |
| 549 | + |
| 550 | + ngx_log_error(NGX_LOG_DEBUG, r->connection->log, 0, "http thread: \"%V?%V\"", &r->uri, &r->args); |
| 551 | + |
| 552 | + |
| 553 | + // get value from query |
| 554 | + n = get_value_from_query(r, &auth_jwt_validation_type, &jwtQueryVal); |
| 555 | + if (n != NGX_ERROR) |
| 556 | + { |
| 557 | + jwtPtr = ngx_str_t_to_char_ptr(r->pool, jwtQueryVal); |
| 558 | + } |
| 559 | + else |
| 560 | + { |
| 561 | + ngx_log_error(NGX_LOG_ERR, r->connection->log, 0, "error get value from query param"); |
| 562 | + } |
| 563 | + |
547 | 564 | }
|
548 | 565 | else if (auth_jwt_validation_type.len > sizeof("COOKIE=") && ngx_strncmp(auth_jwt_validation_type.data, "COOKIE=", sizeof("COOKIE=") - 1)==0)
|
549 | 566 | {
|
|
0 commit comments