Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

企业微信授权后,回调地址中原有的参数丢失 #114

Closed
3 tasks
dwhgygzt opened this issue Apr 7, 2021 · 2 comments
Closed
3 tasks

企业微信授权后,回调地址中原有的参数丢失 #114

dwhgygzt opened this issue Apr 7, 2021 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@dwhgygzt
Copy link

dwhgygzt commented Apr 7, 2021

Pre-submission checklist:

  • I have searched the relevant information in the existing list of Issues.
  • I have searched the developer documentation for that information: https://justauth.wiki
  • I have read the relevant Q&A: https://justauth.wiki

Issue description

Environment

  • JustAuth version(e.g. 1.15.9):

Minimal test code / Steps to reproduce the issue

redirectUri = https://xxxxxx?a=1&b=2&c=3 类似这样的格式

生成的扫描URL连接 redirectUri 是否需要encode ?,目前看代码无法encode

  request = new AuthWeChatEnterpriseQrcodeRequest(AuthConfig.builder()
                        .clientId(sysDictDataMap.get("clientId").get(0).getDictKey())
                        .clientSecret(sysDictDataMap.get("clientSecret").get(0).getDictKey())
                        .redirectUri(redirectUri)
                        .agentId(sysDictDataMap.get("agentId").get(0).getDictKey())
                        .build(), authStateRedisCache);

如果encode了会报异常
主要是 AuthChecker.java:60 做了校验 必须含有 http://

me.zhyd.oauth.exception.AuthException: Illegal redirect uri [WECHAT_ENTERPRISE]
	at me.zhyd.oauth.utils.AuthChecker.checkConfig(AuthChecker.java:60) ~[JustAuth-1.15.9.jar:na]
	at me.zhyd.oauth.request.AuthDefaultRequest.<init>(AuthDefaultRequest.java:43) ~[JustAuth-1.15.9.jar:na]
	at me.zhyd.oauth.request.AbstractAuthWeChatEnterpriseRequest.<init>(AbstractAuthWeChatEnterpriseRequest.java:33) ~[JustAuth-1.15.9.jar:na]
	at me.zhyd.oauth.request.AuthWeChatEnterpriseQrcodeRequest.<init>(AuthWeChatEnterpriseQrcodeRequest.java:24) ~[JustAuth-1.15.9.jar:na]
	at com.middol.colburn.hr.model.oauth.web.controller.OauthLoginController.getAuthRequest(OauthLoginController.java:239) ~[classes/:na]
	at com.middol.colburn.hr.model.oauth.web.controller.OauthLoginController.authorizeUrl(OauthLoginController.java:106) ~[classes/:na]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.8.0_151]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[na:1.8.0_151]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.8.0_151]
	at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_151]
	at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:190) ~[spring-web-5.2.12.RELEASE.jar:5.2.12.RELEASE]
	at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:138) ~[spring-web-5.2.12.RELEASE.jar:5.2.12.RELEASE]
	at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:105) ~[spring-webmvc-5.2.12.RELEASE.jar:5.2.12.RELEASE]
	at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:878) ~[spring-webmvc-5.2.12.RELEASE.jar:5.2.12.RELEASE]
	at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:792) ~[spring-webmvc-5.2.12.RELEASE.jar:5.2.12.RELEASE]
	at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87) ~[spring-webmvc-5.2.12.RELEASE.jar:5.2.12.RELEASE]
	at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1040) ~[spring-webmvc-5.2.12.RELEASE.jar:5.2.12.RELEASE]
	at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:943) ~[spring-webmvc-5.2.12.RELEASE.jar:5.2.12.RELEASE]
	at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1006) [spring-webmvc-5.2.12.RELEASE.jar:5.2.12.RELEASE]
	at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:909) [spring-webmvc-5.2.12.RELEASE.jar:5.2.12.RELEASE]
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:652) [tomcat-embed-core-9.0.41.jar:4.0.FR]
	at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883) [spring-webmvc-5.2.12.RELEASE.jar:5.2.12.RELEASE]
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:733) [tomcat-embed-core-9.0.41.jar:4.0.FR]
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231) [tomcat-embed-core-9.0.41.jar:9.0.41]
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [tomcat-embed-core-9.0.41.jar:9.0.41]
	at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53) [tomcat-embed-websocket-9.0.41.jar:9.0.41]
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) [tomcat-embed-core-9.0.41.jar:9.0.41]
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) [tomcat-embed-core-9.0.41.jar:9.0.41]
	at org.apache.shiro.web.servlet.ProxiedFilterChain.doFilter(ProxiedFilterChain.java:61) [shiro-web-1.7.0.jar:1.7.0]
	at org.apache.shiro.web.servlet.AdviceFilter.executeChain(AdviceFilter.java:108) [shiro-web-1.7.0.jar:1.7.0]

What's the actual result? (including assertion message & call stack if applicable)

最后 redirectUri 时候只要一个参数,其他参数丢失了

Be sure to provide a complete and detailed exception stack.

What's the expected result?

希望的结果是全部参数都携带进来

@dwhgygzt dwhgygzt added the bug Something isn't working label Apr 7, 2021
@zhangyd-c
Copy link
Member

已经验证并确认问题,下个版本将会修复该问题

@zhangyd-c zhangyd-c self-assigned this Apr 8, 2021
@zhangyd-c
Copy link
Member

1.16.1已发布,请注意升级。https://github.com/justauth/JustAuth/releases/tag/v1.16.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants