@@ -346,40 +346,6 @@ static int sts_check_access_handler(request_rec *r)
346346 return rv ;
347347}
348348
349- static int sts_fixup_handler (request_rec * r )
350- {
351- int rc = DECLINED ;
352-
353- /*
354- oauth2_apache_request_context_t *ctx =
355- oauth2_apache_request_context_get(r);
356-
357- oauth2_debug(ctx->log, "enter: \"%s?%s\", ap_is_initial_req(r)=%d",
358- r->parsed_uri.path, r->args, ap_is_initial_req(r));
359-
360- if (ap_is_initial_req(r) == 0)
361- goto end;
362-
363- char *source_token = NULL;
364-
365- void *data = NULL;
366- apr_pool_userdata_get(&data, fixup_userdata_key, r->pool);
367-
368- // TBD: do we need to only handle env var stuff; right now it also looks
369- // for
370- // tokens elsewhere
371- // TBD: always set target env var token in the fixup handler to be "more
372- // authoritative"?
373- if (data != NULL)
374- rc = sts_handler(ctx->log, ctx->request, r, &source_token);
375-
376- end:
377- oauth2_debug(ctx->log, "leave: %d", rc);
378- */
379-
380- return rc ;
381- }
382-
383349OAUTH2_APACHE_HANDLERS (sts )
384350
385351#define STS_CFG_FUNC_ARGS (nargs , member ) \
@@ -511,14 +477,13 @@ static const command_rec OAUTH2_APACHE_COMMANDS(sts)[] = {
511477
512478static void OAUTH2_APACHE_REGISTER_HOOKS (sts )(apr_pool_t * p )
513479{
514- static const char * const aszPre [] = {"mod_auth_openidc.c" , NULL };
480+ static const char * const aszPre [] = {"mod_auth_openidc.c" , "mod_oauth2" , NULL };
515481 ap_hook_post_config (OAUTH2_APACHE_POST_CONFIG (sts ), NULL , NULL , APR_HOOK_MIDDLE );
516482#if MODULE_MAGIC_NUMBER_MAJOR >= 20100714
517- ap_hook_check_access (sts_check_access_handler , NULL , NULL , APR_HOOK_MIDDLE , AP_AUTH_INTERNAL_PER_CONF );
483+ ap_hook_fixups (sts_check_access_handler , aszPre , NULL , APR_HOOK_LAST );
518484#else
519- ap_hook_access_checker (sts_check_access_handler , NULL , NULL , APR_HOOK_MIDDLE );
485+ ap_hook_fixups (sts_check_access_handler , aszPre , NULL , APR_HOOK_LAST );
520486#endif
521- ap_hook_fixups (sts_fixup_handler , aszPre , NULL , APR_HOOK_LAST );
522487 /*
523488 ap_hook_insert_filter(sts_filter_in_insert_filter, NULL, NULL,
524489 APR_HOOK_MIDDLE);
0 commit comments