1、调整IAM权限
2、新增常用地址模块
This commit is contained in:
@@ -34,8 +34,8 @@ import org.springblade.core.oauth2.provider.OAuth2Response;
|
||||
import org.springblade.core.tool.support.Kv;
|
||||
import org.springblade.core.tool.utils.StringUtil;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMethod;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
/**
|
||||
@@ -59,7 +59,7 @@ public class IamSsoEndpoint {
|
||||
* @param request 请求信息
|
||||
* @return token
|
||||
*/
|
||||
@PostMapping("/token")
|
||||
@RequestMapping(value = "/token", method = {RequestMethod.GET, RequestMethod.POST})
|
||||
@Operation(summary = "IAM统一身份认证登录", description = "使用IAM授权码换取本系统Token")
|
||||
public ResponseEntity<Kv> token(HttpServletRequest request) {
|
||||
String grantType = request.getParameter("grant_type");
|
||||
|
||||
@@ -113,8 +113,8 @@ public class IamSsoTokenGranter extends AuthorizationCodeGranter {
|
||||
|
||||
@Override
|
||||
public OAuth2Client client(OAuth2Request request) {
|
||||
String clientId = request.getClientId();
|
||||
String clientSecret = request.getClientSecret();
|
||||
String clientId = StringUtil.isBlank(request.getClientId()) ? properties.getSystemClientId() : request.getClientId();
|
||||
String clientSecret = StringUtil.isBlank(request.getClientSecret()) ? properties.getSystemClientSecret() : request.getClientSecret();
|
||||
OAuth2Client client = clientService.loadByClientId(clientId);
|
||||
if (!clientService.validateClient(client, clientId, clientSecret)) {
|
||||
throw new UserInvalidException(OAuth2TokenConstant.TOKEN_NOT_CORRECT);
|
||||
|
||||
@@ -57,6 +57,16 @@ public class IamSsoProperties {
|
||||
*/
|
||||
private String clientSecret;
|
||||
|
||||
/**
|
||||
* 本系统发放Token使用的客户端ID。IAM回调入口不要求请求携带客户端认证时使用。
|
||||
*/
|
||||
private String systemClientId = "saber3";
|
||||
|
||||
/**
|
||||
* 本系统发放Token使用的客户端密钥。IAM回调入口不要求请求携带客户端认证时使用。
|
||||
*/
|
||||
private String systemClientSecret = "saber3_secret";
|
||||
|
||||
/**
|
||||
* IAM回调地址
|
||||
*/
|
||||
|
||||
@@ -71,6 +71,8 @@ iam:
|
||||
profile-url: http://172.16.204.83:38000/gwzh/IAM/IAM_SSO_PROFILE
|
||||
client-id: f0b52f23f71b1649c468
|
||||
client-secret: 5b3d8575f0899946623ab86523ac3dd8ee98
|
||||
system-client-id: saber3
|
||||
system-client-secret: saber3_secret
|
||||
redirect-uri: http://172.16.203.228:8000/callback
|
||||
authorization: Z3d6aF90bXMtOVJJU0RVN1U6YW0yYkcwWnBJZ0RQZmtrSjNaZkZjUDBSaGFuSEtxQng=
|
||||
profile-authorization: Z3d6aF90bXMtOVJJU0RVN1U6YW0yYkcwWnBJZ0RQZmtrSjNaZkZjUDBSaGFuSEtxQng=
|
||||
|
||||
Reference in New Issue
Block a user