diff --git a/src/service/oauth/oauth.lua b/src/service/oauth/oauth.lua index 523b446..018df3e 100644 --- a/src/service/oauth/oauth.lua +++ b/src/service/oauth/oauth.lua @@ -100,6 +100,7 @@ local function authorizatePassword(args) resp:send(result) return end + print("验证用户名和密码: ", args.username) -- 3.对当前用户的持有的应用程序进行验证 local userid = res[1].id local client_id = args.client_id @@ -203,12 +204,14 @@ local function authorizateRefresh(args) return end -- 2.验证并消费 refresh_token(滚动刷新:生成新的 rt) + --print("begin consume token:", args.client_id) local rt_data, err = client.consumeRefreshToken(args.refresh_token, args.client_id, true) if not rt_data then ngx.log(ngx.ERR, "refresh_token 验证失败: ", err) ngx.exit(ngx.HTTP_BAD_REQUEST) end -- 3.生成新 Access Token + --print("begin generate token:", rt_data.scope, args.client_id) local priv_key = conf.secret_key local new_access_token = token.generate_access_token(priv_key, rt_data.sub, args.client_id, rt_data.scope) --存储到redis中,并设置有效期时间 @@ -258,6 +261,7 @@ function _M:token() end local grant_type = args.grant_type + --print("grant_type类型: ", grant_type) if grant_type == "password" then authorizatePassword(args) elseif grant_type == "authorization_code" then