Skip to content

Commit cc49ae6

Browse files
committed
release 4.1.0
- leverage HTTP status code from oauth2_token_verify - depend on liboauth2 >= 2.2.0 Signed-off-by: Hans Zandbelt <hans.zandbelt@openidc.com>
1 parent 9a11ebf commit cc49ae6

3 files changed

Lines changed: 15 additions & 6 deletions

File tree

ChangeLog

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
01/06/2026
2+
- leverage HTTP status code from oauth2_token_verify
3+
- depend on liboauth2 >= 2.2.0
4+
- release 4.1.0
5+
16
08/22/2024
27
- change LICENSE to Apache 2.0
38
- depend on liboauth2 >= 2.0.0

configure.ac

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
AC_INIT([ngx_oauth2_module],[4.0.0],[hans.zandbelt@openidc.com])
1+
AC_INIT([ngx_oauth2_module],[4.1.0],[hans.zandbelt@openidc.com])
22

33
AM_INIT_AUTOMAKE([foreign no-define subdir-objects])
44
AC_CONFIG_MACRO_DIRS([m4])
@@ -25,11 +25,11 @@ AM_CONDITIONAL(HAVE_NGINX, [test x"$have_nginx" = "xyes"])
2525
AC_SUBST(NGINX_CFLAGS)
2626
AC_SUBST(NGINX_LIBS)
2727

28-
PKG_CHECK_MODULES(OAUTH2, [liboauth2 >= 2.0.0])
28+
PKG_CHECK_MODULES(OAUTH2, [liboauth2 >= 2.2.0])
2929
AC_SUBST(OAUTH2_CFLAGS)
3030
AC_SUBST(OAUTH2_LIBS)
3131

32-
PKG_CHECK_MODULES(OAUTH2_NGINX, [liboauth2_nginx >= 2.0.0])
32+
PKG_CHECK_MODULES(OAUTH2_NGINX, [liboauth2_nginx >= 2.2.0])
3333
AC_SUBST(OAUTH2_NGINX_CFLAGS)
3434
AC_SUBST(OAUTH2_NGINX_LIBS)
3535

src/ngx_oauth2_module.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -228,12 +228,14 @@ static ngx_int_t ngx_oauth2_post_config(ngx_conf_t *cf)
228228

229229
static ngx_int_t ngx_oauth2_handler(ngx_http_request_t *r)
230230
{
231+
bool rc = false;
231232
ngx_int_t rv = NGX_DECLINED;
232233
oauth2_nginx_request_context_t *ctx = NULL;
233234
ngx_oauth2_cfg_t *cfg = NULL;
234235
ngx_str_t ngx_source_token;
235236
char *source_token = NULL;
236237
json_t *json_payload = NULL;
238+
oauth2_http_status_code_t status_code = 0;
237239

238240
if (r != r->main)
239241
// do not goto end because ctx->log is not available
@@ -286,9 +288,11 @@ static ngx_int_t ngx_oauth2_handler(ngx_http_request_t *r)
286288
oauth2_debug(ctx->log, "enter: source_token=%s, initial_request=%d",
287289
source_token, (r != r->main));
288290

289-
if (oauth2_token_verify(ctx->log, ctx->request, cfg->verify,
290-
source_token, &json_payload) == false) {
291-
oauth2_warn(ctx->log, "Token could not be verified.");
291+
rc = oauth2_token_verify(ctx->log, ctx->request, cfg->verify,
292+
source_token, &json_payload, &status_code);
293+
294+
if (rc == false) {
295+
oauth2_warn(ctx->log, "Token could not be verified [HTTP status code=%d].", (int)status_code);
292296
rv = NGX_HTTP_UNAUTHORIZED;
293297
goto end;
294298
}

0 commit comments

Comments
 (0)