Skip to content

Commit

Permalink
修复服务间调用(feign)鉴权问题
Browse files Browse the repository at this point in the history
  • Loading branch information
kzy77 committed Jun 13, 2018
1 parent ba6dfeb commit a231522
Show file tree
Hide file tree
Showing 30 changed files with 37 additions and 38 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ private void handleLog(final JoinPoint joinPoint, final Object result) {

getControllerMethodDescription(relog, operationLogDto, result, joinPoint);
threadLocal.remove();
taskExecutor.execute(() -> this.restTemplate.postForObject("http://paascloud-provider-uac/uac/auth/saveLog", operationLogDto, Integer.class));
taskExecutor.execute(() -> this.restTemplate.postForObject("http://paascloud-provider-uac/auth/saveLog", operationLogDto, Integer.class));
} catch (Exception ex) {
log.error("获取注解类出现异常={}", ex.getMessage(), ex);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ public boolean config(ExpressionUrlAuthorizationConfigurer<HttpSecurity>.Express
SecurityConstants.DEFAULT_SIGN_IN_PROCESSING_URL_MOBILE,
SecurityConstants.DEFAULT_SIGN_IN_PROCESSING_URL_OPENID,
SecurityConstants.DEFAULT_SOCIAL_USER_INFO_URL,
SecurityConstants.DEFAULT_VALIDATE_CODE_URL_PREFIX + "/*", "/uac/pay/alipayCallback",
"/druid/**", "/uac/auth/**", "/swagger-ui.html", "/swagger-resources/**", "/v2/api-docs").permitAll();
SecurityConstants.DEFAULT_VALIDATE_CODE_URL_PREFIX + "/*", "/pay/alipayCallback",
"/druid/**", "/auth/**", "/swagger-ui.html", "/swagger-resources/**", "/v2/api-docs").permitAll();
return false;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,24 +11,24 @@ public interface SecurityConstants {
/**
* 默认的处理验证码的url前缀
*/
String DEFAULT_VALIDATE_CODE_URL_PREFIX = "/uac/auth/code";
String DEFAULT_VALIDATE_CODE_URL_PREFIX = "/auth/code";

/**
* 当请求需要身份认证时,默认跳转的url
*/
String DEFAULT_UNAUTHENTICATION_URL = "/uac/auth/require";
String DEFAULT_UNAUTHENTICATION_URL = "/auth/require";
/**
* 默认的用户名密码登录请求处理url
*/
String DEFAULT_SIGN_IN_PROCESSING_URL_FORM = "/uac/auth/form";
String DEFAULT_SIGN_IN_PROCESSING_URL_FORM = "/auth/form";
/**
* 默认的手机验证码登录请求处理url
*/
String DEFAULT_SIGN_IN_PROCESSING_URL_MOBILE = "/uac/auth/mobile";
String DEFAULT_SIGN_IN_PROCESSING_URL_MOBILE = "/auth/mobile";
/**
* 默认的OPENID登录请求处理url
*/
String DEFAULT_SIGN_IN_PROCESSING_URL_OPENID = "/uac/auth/openid";
String DEFAULT_SIGN_IN_PROCESSING_URL_OPENID = "/auth/openid";
/**
* 验证图片验证码时,http请求中默认的携带图片验证码信息的参数的名称
*/
Expand Down Expand Up @@ -62,5 +62,5 @@ public interface SecurityConstants {
/**
* 获取第三方用户信息的url
*/
String DEFAULT_SOCIAL_USER_INFO_URL = "/uac/social/user";
String DEFAULT_SOCIAL_USER_INFO_URL = "/social/user";
}
1 change: 0 additions & 1 deletion paascloud-gateway/src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ zuul:
uac-route:
path: /uac/**
sensitiveHeaders:
strip-prefix: false
service-id: paascloud-provider-uac
ribbon:
eager-load:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ security:
access-token-uri: http://paascloud-gateway:7979/uac/oauth/token
user-authorization-uri: http://paascloud-gateway:7979/uac/oauth/authorize
resource:
user-info-uri: http://paascloud-provider-uac:7979/uac/user
user-info-uri: http://paascloud-gateway:7979/uac/user
prefer-token-info: false
jwt:
key-uri: http://paascloud-provider-uac:8000/oauth/token_key
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ security:
access-token-uri: http://paascloud-gateway:7979/uac/oauth/token
user-authorization-uri: http://paascloud-gateway:7979/uac/oauth/authorize
resource:
user-info-uri: http://paascloud-provider-uac:7979/uac/user
user-info-uri: http://paascloud-gateway:7979/uac/user
prefer-token-info: false
jwt:
key-uri: http://paascloud-provider-uac:8000/oauth/token_key
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ security:
access-token-uri: http://paascloud-gateway:7979/uac/oauth/token
user-authorization-uri: http://paascloud-gateway:7979/uac/oauth/authorize
resource:
user-info-uri: http://paascloud-provider-uac:7979/uac/user
user-info-uri: http://paascloud-gateway:7979/uac/user
prefer-token-info: false
jwt:
key-uri: http://paascloud-provider-uac:8000/oauth/token_key
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
* @author paascloud.net @gmail.com
*/
@RestController
@RequestMapping(value = "/uac/auth")
@RequestMapping(value = "/auth")
@Api(value = "Web-AuthRestController", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public class AuthRestController extends BaseController {
@Resource
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
* @author [email protected]
*/
@RestController
@RequestMapping(value = "/uac/action", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
@RequestMapping(value = "/action", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
@Api(value = "Web - UacActionCommonController", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public class UacActionCommonController extends BaseController {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
* @author paascloud.net @gmail.com
*/
@RestController
@RequestMapping(value = "/uac/action", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
@RequestMapping(value = "/action", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
@Api(value = "Web - UacActionMainController", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public class UacActionMainController extends BaseController {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
* @author paascloud.net @gmail.com
*/
@RestController
@RequestMapping(value = "/uac/role", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
@RequestMapping(value = "/role", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
@Api(value = "Web - UacGrantAuth4RoleController", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public class UacGrantAuth4RoleController extends BaseController {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
* @author paascloud.net @gmail.com
*/
@RestController
@RequestMapping(value = "/uac/group", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
@RequestMapping(value = "/group", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
@Api(value = "Web - UacGroupBindUserController", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public class UacGroupBindUserController extends BaseController {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
* @author paascloud.net @gmail.com
*/
@RestController
@RequestMapping(value = "/uac/group", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
@RequestMapping(value = "/group", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
@Api(value = "Web - UacGroupCommonController", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public class UacGroupCommonController extends BaseController {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
* @author paascloud.net @gmail.com
*/
@RestController
@RequestMapping(value = "/uac/group", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
@RequestMapping(value = "/group", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
@Api(value = "Web - UacGroupMainController", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public class UacGroupMainController extends BaseController {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
* @author [email protected]
*/
@RestController
@RequestMapping(value = "/uac/log", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
@RequestMapping(value = "/log", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
@Api(value = "Web - UacLogMainController", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public class UacLogMainController extends BaseController {
@Resource
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
* @author paascloud.net @gmail.com
*/
@RestController
@RequestMapping(value = "/uac/menu", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
@RequestMapping(value = "/menu", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
@Api(value = "Web - UacMenuCommonController", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public class UacMenuCommonController extends BaseController {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
* @author paascloud.net @gmail.com
*/
@RestController
@RequestMapping(value = "/uac/menu", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
@RequestMapping(value = "/menu", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
@Api(value = "Web - UacMenuMainController", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public class UacMenuMainController extends BaseController {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
* @author paascloud.net @gmail.com
*/
@RestController
@RequestMapping(value = "/uac/role", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
@RequestMapping(value = "/role", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
@Api(value = "Web - UacRoleBindUserController", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public class UacRoleBindUserController extends BaseController {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
* @author paascloud.net @gmail.com
*/
@RestController
@RequestMapping(value = "/uac/role", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
@RequestMapping(value = "/role", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
@Api(value = "Web - UacRoleCommonController", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public class UacRoleCommonController extends BaseController {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
* @author paascloud.net @gmail.com
*/
@RestController
@RequestMapping(value = "/uac/role", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
@RequestMapping(value = "/role", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
@Api(value = "Web - UacRoleMainController", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public class UacRoleMainController extends BaseController {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
* @author paascloud.net @gmail.com
*/
@RestController
@RequestMapping(value = "/uac/token", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
@RequestMapping(value = "/token", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
@Api(value = "Web - UacTokenMainController", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public class UacTokenMainController extends BaseController {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
* @author [email protected]
*/
@RestController
@RequestMapping(value = "/uac/user", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
@RequestMapping(value = "/user", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
@Api(value = "Web - UacUserCommonController", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public class UacUserCommonController extends BaseController {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
* @author paascloud.net @gmail.com
*/
@RestController
@RequestMapping(value = "/uac", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
@RequestMapping(value = "", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
@Api(value = "Web - UacUserLoginController", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public class UacUserLoginController extends BaseController {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
* @author paascloud.net @gmail.com
*/
@RestController
@RequestMapping(value = "/uac/user", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
@RequestMapping(value = "/user", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
@Api(value = "Web - UacUserMainController", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public class UacUserMainController extends BaseController {
@Resource
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
* @author [email protected]
*/
@RestController
@RequestMapping(value = "/uac/user", produces = {"application/json;charset=UTF-8"})
@RequestMapping(value = "/user", produces = {"application/json;charset=UTF-8"})
@Api(value = "Web - UacUserPasswordController", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public class UacUserPasswordController extends BaseController {
@Resource
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
* @author paascloud.net @gmail.com
*/
@RestController
@RequestMapping(value = "/uac/email", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
@RequestMapping(value = "/email", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
@Api(value = "WEB - EmailController", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public class EmailController extends BaseController {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
* @author paascloud.net @gmail.com
*/
@RestController
@RequestMapping(value = "/uac/auth", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
@RequestMapping(value = "/auth", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
@Api(value = "WEB - MallAuthRestController", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public class MallAuthRestController extends BaseController {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
* @author paascloud.net @gmail.com
*/
@RestController
@RequestMapping(value = "/uac/cart", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
@RequestMapping(value = "/cart", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
@Api(value = "WEB - MallCartController", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public class MallCartController extends BaseController {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
* @author [email protected]
*/
@RestController
@RequestMapping(value = "/uac/user", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
@RequestMapping(value = "/user", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
@Api(value = "WEB - MallUserController", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
public class MallUserController extends BaseController {
@Resource
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ paascloud:
clientAuthenticationScheme: header
security:
social:
filterProcessesUrl: /uac/auth/callback
filterProcessesUrl: /auth/callback
qq:
app-id: 101431061
app-secret: 0154c848f45fc705412462d4f99a592c
Expand All @@ -105,10 +105,10 @@ paascloud:
code:
image:
expireIn: 180
url: /uac/auth/register,/uac/auth/submitResetPwdEmail,/uac/auth/code/sms
url: /auth/register,/auth/submitResetPwdEmail,/auth/code/sms
sms:
expireIn: 600
url: /uac/auth/submitResetPwdPhone
url: /auth/submitResetPwdPhone
mobileMaxSendCount: 1
ipMaxSendCount: 2
totalMaxSendCount: 3
Expand Down

0 comments on commit a231522

Please sign in to comment.