|
@@ -1,21 +1,15 @@
|
|
|
package com.lc.ibps.cloud.oauth.server.provider;
|
|
package com.lc.ibps.cloud.oauth.server.provider;
|
|
|
|
|
|
|
|
-import java.text.DateFormat;
|
|
|
|
|
import java.text.SimpleDateFormat;
|
|
import java.text.SimpleDateFormat;
|
|
|
-import java.time.format.DateTimeFormatter;
|
|
|
|
|
import java.util.*;
|
|
import java.util.*;
|
|
|
import java.util.concurrent.TimeUnit;
|
|
import java.util.concurrent.TimeUnit;
|
|
|
|
|
|
|
|
import cn.hutool.json.JSONObject;
|
|
import cn.hutool.json.JSONObject;
|
|
|
import cn.hutool.json.JSONUtil;
|
|
import cn.hutool.json.JSONUtil;
|
|
|
-import com.lc.ibps.base.framework.id.UniqueIdUtil;
|
|
|
|
|
-import com.lc.ibps.base.web.context.ContextUtil;
|
|
|
|
|
import com.lc.ibps.cloud.oauth.exception.*;
|
|
import com.lc.ibps.cloud.oauth.exception.*;
|
|
|
-import com.lc.ibps.cloud.oauth.server.util.LicUtil;
|
|
|
|
|
import com.lc.ibps.org.party.persistence.entity.PartyEmployeePo;
|
|
import com.lc.ibps.org.party.persistence.entity.PartyEmployeePo;
|
|
|
import com.lc.ibps.org.party.persistence.entity.PartyEntityPo;
|
|
import com.lc.ibps.org.party.persistence.entity.PartyEntityPo;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
-import org.springframework.context.annotation.Bean;
|
|
|
|
|
import org.springframework.data.redis.connection.DataType;
|
|
import org.springframework.data.redis.connection.DataType;
|
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
import org.springframework.util.Assert;
|
|
import org.springframework.util.Assert;
|
|
@@ -60,8 +54,6 @@ import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import io.swagger.annotations.ApiParam;
|
|
import io.swagger.annotations.ApiParam;
|
|
|
|
|
|
|
|
-import javax.validation.Valid;
|
|
|
|
|
-
|
|
|
|
|
import static com.lc.ibps.api.base.constants.StateEnum.ERROR;
|
|
import static com.lc.ibps.api.base.constants.StateEnum.ERROR;
|
|
|
import static com.lc.ibps.api.base.constants.StateEnum.SUCCESS;
|
|
import static com.lc.ibps.api.base.constants.StateEnum.SUCCESS;
|
|
|
|
|
|
|
@@ -159,8 +151,8 @@ public class TokenProvider extends BaseProvider implements ITokenService {
|
|
|
APIResult<TokenEntity> result = new APIResult<>();
|
|
APIResult<TokenEntity> result = new APIResult<>();
|
|
|
try{
|
|
try{
|
|
|
String grantType = accessTokenVo.getGrant_type();
|
|
String grantType = accessTokenVo.getGrant_type();
|
|
|
- String clientId = accessTokenVo.getClient_id();
|
|
|
|
|
- String clientSecret = accessTokenVo.getClient_secret();
|
|
|
|
|
|
|
+ String clientId = authorizationConfig.getDefaultClient();
|
|
|
|
|
+ String clientSecret = authorizationConfig.getDefaultSecret();
|
|
|
String username = accessTokenVo.getUsername();
|
|
String username = accessTokenVo.getUsername();
|
|
|
String password = accessTokenVo.getPassword();
|
|
String password = accessTokenVo.getPassword();
|
|
|
String refreshToken = accessTokenVo.getRefresh_token();
|
|
String refreshToken = accessTokenVo.getRefresh_token();
|
|
@@ -280,8 +272,8 @@ public class TokenProvider extends BaseProvider implements ITokenService {
|
|
|
APIResult<TokenEntity> result = new APIResult<>();
|
|
APIResult<TokenEntity> result = new APIResult<>();
|
|
|
try{
|
|
try{
|
|
|
String grantType = switchVo.getGrant_type();
|
|
String grantType = switchVo.getGrant_type();
|
|
|
- String clientId = switchVo.getClient_id();
|
|
|
|
|
- String clientSecret = switchVo.getClient_secret();
|
|
|
|
|
|
|
+ String clientId = authorizationConfig.getDefaultClient();
|
|
|
|
|
+ String clientSecret = authorizationConfig.getDefaultSecret();
|
|
|
String username = switchVo.getUsername();
|
|
String username = switchVo.getUsername();
|
|
|
String accessToken = switchVo.getAccess_token();
|
|
String accessToken = switchVo.getAccess_token();
|
|
|
//String redirectUri = accessTokenVo.getRedirect_uri();
|
|
//String redirectUri = accessTokenVo.getRedirect_uri();
|
|
@@ -357,8 +349,8 @@ public class TokenProvider extends BaseProvider implements ITokenService {
|
|
|
APIResult<TokenEntity> result = new APIResult<>();
|
|
APIResult<TokenEntity> result = new APIResult<>();
|
|
|
try{
|
|
try{
|
|
|
String grantType = switchVo.getGrant_type();
|
|
String grantType = switchVo.getGrant_type();
|
|
|
- String clientId = switchVo.getClient_id();
|
|
|
|
|
- String clientSecret = switchVo.getClient_secret();
|
|
|
|
|
|
|
+ String clientId = authorizationConfig.getDefaultClient();
|
|
|
|
|
+ String clientSecret = authorizationConfig.getDefaultSecret();
|
|
|
String accessToken = switchVo.getAccess_token();
|
|
String accessToken = switchVo.getAccess_token();
|
|
|
String username = switchVo.getUsername();
|
|
String username = switchVo.getUsername();
|
|
|
//String redirectUri = accessTokenVo.getRedirect_uri();
|
|
//String redirectUri = accessTokenVo.getRedirect_uri();
|