File tree 1 file changed +18
-2
lines changed
1 file changed +18
-2
lines changed Original file line number Diff line number Diff line change @@ -56,6 +56,11 @@ local pairs = pairs
56
56
local type = type
57
57
local ngx = ngx
58
58
59
+ local supported_token_auth_methods = {
60
+ client_secret_basic = true ,
61
+ client_secret_post = true
62
+ }
63
+
59
64
local openidc = {
60
65
_VERSION = " 1.4.0"
61
66
}
549
554
-- get the token endpoint authentication method
550
555
local function openidc_get_token_auth_method (opts )
551
556
557
+ if opts .token_endpoint_auth_method ~= nil and not supported_token_auth_methods [opts .token_endpoint_auth_method ] then
558
+ ngx .log (ngx .ERR , " configured value for token_endpoint_auth_method (" .. opts .token_endpoint_auth_method .. " ) is not supported, ignoring it" )
559
+ opts .token_endpoint_auth_method = nil
560
+ end
561
+
552
562
local result
553
563
if opts .discovery .token_endpoint_auth_methods_supported ~= nil then
554
564
-- if set check to make sure the discovery data includes the selected client auth method
@@ -566,8 +576,14 @@ local function openidc_get_token_auth_method(opts)
566
576
return nil
567
577
end
568
578
else
569
- result = opts .discovery .token_endpoint_auth_methods_supported [1 ]
570
- ngx .log (ngx .DEBUG , " no configuration setting for option so select the first method specified by the OP: " .. result )
579
+ for index , value in ipairs (opts .discovery .token_endpoint_auth_methods_supported ) do
580
+ ngx .log (ngx .DEBUG , index .. " => " .. value )
581
+ if supported_token_auth_methods [value ] then
582
+ result = value
583
+ ngx .log (ngx .DEBUG , " no configuration setting for option so select the first supported method specified by the OP: " .. result )
584
+ break
585
+ end
586
+ end
571
587
end
572
588
else
573
589
result = opts .token_endpoint_auth_method
You can’t perform that action at this time.
0 commit comments