mod_http_oauth2/mod_http_oauth2.lua
changeset 5618 7565298aa197
parent 5612 1893ae742f66
child 5620 59d5fc50f602
equal deleted inserted replaced
5617:a9682cad0e67 5618:7565298aa197
   745 	"authorization_code";
   745 	"authorization_code";
   746 	"password"; -- TODO Disable. The resource owner password credentials grant [RFC6749] MUST NOT be used.
   746 	"password"; -- TODO Disable. The resource owner password credentials grant [RFC6749] MUST NOT be used.
   747 	"refresh_token";
   747 	"refresh_token";
   748 	device_uri;
   748 	device_uri;
   749 })
   749 })
       
   750 if allowed_grant_type_handlers:contains("device_code") then
       
   751 	-- expand short form because that URI is long
       
   752 	module:log("debug", "Expanding %q to %q in '%s'", "device_code", device_uri, "allowed_oauth2_grant_types");
       
   753 	allowed_grant_type_handlers:remove("device_code");
       
   754 	allowed_grant_type_handlers:add(device_uri);
       
   755 end
   750 for handler_type in pairs(grant_type_handlers) do
   756 for handler_type in pairs(grant_type_handlers) do
   751 	if not allowed_grant_type_handlers:contains(handler_type) then
   757 	if not allowed_grant_type_handlers:contains(handler_type) then
   752 		module:log("debug", "Grant type %q disabled", handler_type);
   758 		module:log("debug", "Grant type %q disabled", handler_type);
   753 		grant_type_handlers[handler_type] = nil;
   759 		grant_type_handlers[handler_type] = nil;
   754 	else
   760 	else