IAM
This commit is contained in:
@ -20,7 +20,7 @@ public interface IamClient {
|
|||||||
* @return
|
* @return
|
||||||
* {"statusCodeValue":0,"msg":null,"data":"http://10.11.4.13:9999/#/digital?code=501679ca-f036-4ed1-9414-585315d8627d"}
|
* {"statusCodeValue":0,"msg":null,"data":"http://10.11.4.13:9999/#/digital?code=501679ca-f036-4ed1-9414-585315d8627d"}
|
||||||
*/
|
*/
|
||||||
@GetMapping("/authz/oauth/v20/authorize")
|
@GetMapping("/sign/authz/oauth/v20/authorize")
|
||||||
IamAuthResponseDTO<String> authorize(@SpringQueryMap IamAuthRequestDTO request);
|
IamAuthResponseDTO<String> authorize(@SpringQueryMap IamAuthRequestDTO request);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -52,7 +52,7 @@ public interface IamClient {
|
|||||||
* }
|
* }
|
||||||
* }
|
* }
|
||||||
*/
|
*/
|
||||||
@GetMapping("/login/jwt/employee")
|
@GetMapping("/sign/login/jwt/employee")
|
||||||
IamAuthResponseDTO<IamEmployee> employee(@RequestParam("jwt") String jwt);
|
IamAuthResponseDTO<IamEmployee> employee(@RequestParam("jwt") String jwt);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -60,7 +60,7 @@ public interface IamClient {
|
|||||||
* @param authorization Bearer Token
|
* @param authorization Bearer Token
|
||||||
* @return IamUserDTO 用户信息
|
* @return IamUserDTO 用户信息
|
||||||
*/
|
*/
|
||||||
@GetMapping("/api/oauth/v20/me")
|
@GetMapping("/sign/api/oauth/v20/me")
|
||||||
IamUser me(@RequestHeader("Authorization") String authorization);
|
IamUser me(@RequestHeader("Authorization") String authorization);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -79,7 +79,7 @@ public interface IamClient {
|
|||||||
* "scope": "read all"
|
* "scope": "read all"
|
||||||
* }
|
* }
|
||||||
*/
|
*/
|
||||||
@GetMapping("/authz/oauth/v20/token")
|
@GetMapping("/sign/authz/oauth/v20/token")
|
||||||
IamToken token(@RequestHeader("Authorization") String authorization, IamTokenRequestDTO request);
|
IamToken token(@RequestHeader("Authorization") String authorization, IamTokenRequestDTO request);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -9,6 +9,7 @@ import com.chinaunicom.mall.ebtp.extend.iam.entity.data.IamUser;
|
|||||||
import com.chinaunicom.mall.ebtp.extend.iam.service.IamAuthService;
|
import com.chinaunicom.mall.ebtp.extend.iam.service.IamAuthService;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
@ -18,6 +19,9 @@ import java.util.Objects;
|
|||||||
@RequestMapping("/iam/auth")
|
@RequestMapping("/iam/auth")
|
||||||
public class IamAuthController {
|
public class IamAuthController {
|
||||||
|
|
||||||
|
@Value("${spring.iam.url}")
|
||||||
|
String iamUrl;
|
||||||
|
|
||||||
private final IamAuthService iamAuthService;
|
private final IamAuthService iamAuthService;
|
||||||
private final BidRatioClient bidRatioClient;
|
private final BidRatioClient bidRatioClient;
|
||||||
|
|
||||||
@ -56,7 +60,8 @@ public class IamAuthController {
|
|||||||
if (Objects.equals(authorize.getStatusCodeValue(), IamEnum.IAM_RESP_SUCCESS_CODE.getCode())) {
|
if (Objects.equals(authorize.getStatusCodeValue(), IamEnum.IAM_RESP_SUCCESS_CODE.getCode())) {
|
||||||
return BaseResponse.success(authorize.getMsg(), authorize.getData());
|
return BaseResponse.success(authorize.getMsg(), authorize.getData());
|
||||||
} else {
|
} else {
|
||||||
return BaseResponse.fail(authorize.getMsg(), authorize.getData());
|
// 如果未认证,返回IAM登录页面
|
||||||
|
return new BaseResponse<>(authorize.getStatusCodeValue(), true, authorize.getMsg(), iamUrl + "/login");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -111,8 +111,8 @@ spring:
|
|||||||
|
|
||||||
# iam测试环境配置
|
# iam测试环境配置
|
||||||
iam:
|
iam:
|
||||||
# url: http://all-new-gateway.hngh.test.local
|
url: https://sso.bj.internal.coscoshipping.com
|
||||||
url: https://sso.bj.internal.coscoshipping.com/sign/
|
|
||||||
|
|
||||||
mybatis-plus:
|
mybatis-plus:
|
||||||
configuration:
|
configuration:
|
||||||
|
Reference in New Issue
Block a user