diff --git a/kong/plugins/oauth2/access.lua b/kong/plugins/oauth2/access.lua index 2dec3246775..2aa26adc2bd 100644 --- a/kong/plugins/oauth2/access.lua +++ b/kong/plugins/oauth2/access.lua @@ -266,7 +266,7 @@ local function issue_token(conf) if not ok then response_params = scopes -- If it's not ok, then this is the error message else - response_params = generate_token(conf, client, nil, table.concat(scopes, " "), state) + response_params = generate_token(conf, client, parameters.authenticated_userid, table.concat(scopes, " "), state) end end elseif grant_type == GRANT_REFRESH_TOKEN then @@ -407,4 +407,4 @@ function _M.execute(conf) ngx.ctx.authenticated_entity = credential end -return _M \ No newline at end of file +return _M