Welcome to my github page!
I'm 子墨
zimoloveshuang / wisedu-unified-login-api Goto Github PK
View Code? Open in Web Editor NEW模拟登陆 金智教务统一登陆系统 的API
Home Page: https://blog.zimo.wiki/posts/6c809f81/
License: MIT License
模拟登陆 金智教务统一登陆系统 的API
Home Page: https://blog.zimo.wiki/posts/6c809f81/
License: MIT License
{
"datas": {
"WEC-REDIRECTURL": "/portal/login",
"WEC-HASLOGIN": false
},
"code": 0,
"message": "successs"
}
安徽师范大学的疫情签到接口
https://ahnu.campusphere.net/wec-counselor-collector-apps/stu/collector/queryCollectorProcessingList
返回内容为
{"msg":"login failed! HTTP error fetching URL","code":1,"cookies":null}
太难了
{'login-url': 'http://auth.hfut.edu.cn/amp-auth-adapter/login?service=https%3A%2F%2Fhfut.campusphere.net%2Fportal%2Flogin', 'host': 'hfut.campusphere.net'}
{'msg': 'login failed! 网页中没有找到casLoginForm,请联系开发者!!!', 'code': 1, 'cookies': None}
在自己搭建的服务上, 短时间内请求2个用户的cookies时, 有比较大的概率抛出一个异常, 然后返回用户名或密码错误.
Yb dP Yb dP Yb dP 8888P 88 8b d8 dP"Yb Yb dP 88 88 dP 88
Yb db dP Yb db dP Yb db dP dP 88 88b d88 dP Yb Yb db dP 88 88odP 88
YbdPYbdP YbdPYbdP YbdPYbdP .o. dP 88 88YbdP88 Yb dP .o. YbdPYbdP 88 88"Yb 88
YP YP YP YP YP YP `"' d8888 88 88 YY 88 YbodP `"' YP YP 88 88 Yb 88
2021-02-11 17:10:26.550 INFO 1 --- [ main] w.z.w.WiseduUnifiedLoginApiApplication : Starting WiseduUnifiedLoginApiApplication v0.0.1-SNAPSHOT on d747ab39b636 with PID 1 (/home/server/wisedu-unified-login-api-v1.0.jar started by root in /)
2021-02-11 17:10:26.557 INFO 1 --- [ main] w.z.w.WiseduUnifiedLoginApiApplication : The following profiles are active: dev
2021-02-11 17:10:28.280 INFO 1 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8080 (http)
2021-02-11 17:10:28.305 INFO 1 --- [ main] o.apache.catalina.core.StandardService : Starting service [Tomcat]
2021-02-11 17:10:28.305 INFO 1 --- [ main] org.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/9.0.36]
2021-02-11 17:10:28.392 INFO 1 --- [ main] o.a.c.c.C.[.[.[.0] : Initializing Spring embedded WebApplicationContext
2021-02-11 17:10:28.393 INFO 1 --- [ main] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 1771 ms
2021-02-11 17:10:28.987 INFO 1 --- [ main] pertySourcedRequestMappingHandlerMapping : Mapped URL path [/v2/api-docs] onto method [springfox.documentation.swagger2.web.Swagger2Controller#getDocumentation(String, HttpServletRequest)]
2021-02-11 17:10:29.087 INFO 1 --- [ main] o.s.s.concurrent.ThreadPoolTaskExecutor : Initializing ExecutorService 'applicationTaskExecutor'
2021-02-11 17:10:29.353 INFO 1 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port(s): 8080 (http) with context path '/wisedu-unified-login-api-v1.0'
2021-02-11 17:10:29.354 INFO 1 --- [ main] d.s.w.p.DocumentationPluginsBootstrapper : Context refreshed
2021-02-11 17:10:29.382 INFO 1 --- [ main] d.s.w.p.DocumentationPluginsBootstrapper : Found 1 custom documentation plugin(s)
2021-02-11 17:10:29.418 INFO 1 --- [ main] s.d.s.w.s.ApiListingReferenceScanner : Scanning for api listing references
2021-02-11 17:10:29.570 INFO 1 --- [ main] w.z.w.WiseduUnifiedLoginApiApplication : Started WiseduUnifiedLoginApiApplication in 3.634 seconds (JVM running for 4.159)
2021-02-11 17:11:04.372 INFO 1 --- [nio-8080-exec-1] o.a.c.c.C.[.[.[.0] : Initializing Spring DispatcherServlet 'dispatcherServlet'
2021-02-11 17:11:04.372 INFO 1 --- [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet : Initializing Servlet 'dispatcherServlet'
2021-02-11 17:11:04.381 INFO 1 --- [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet : Completed initialization in 9 ms
Warning: Invalid resolution 0 dpi. Using 70 instead.
Warning: Invalid resolution 0 dpi. Using 70 instead.
java.lang.RuntimeException: ?????????????
at wiki.zimo.wiseduunifiedloginapi.process.CasLoginProcess.casSendLoginData(CasLoginProcess.java:208)
at wiki.zimo.wiseduunifiedloginapi.process.CasLoginProcess.login(CasLoginProcess.java:156)
at wiki.zimo.wiseduunifiedloginapi.service.impl.LoginServiceImpl.login(LoginServiceImpl.java:66)
at wiki.zimo.wiseduunifiedloginapi.controller.ApiController.login(ApiController.java:38)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.web.method.support.InvocableHandlerMethod.doInvoke(InvocableHandlerMethod.java:190)
at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:138)
at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:105)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:879)
at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:793)
at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:87)
at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1040)
at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:943)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1006)
at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:909)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:660)
at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:883)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:741)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:100)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:93)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:201)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:119)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:202)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:541)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)
at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:373)
at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:65)
at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:868)
at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1590)
at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:748)
Warning: Invalid resolution 0 dpi. Using 70 instead.
Warning: Invalid resolution 0 dpi. Using 70 instead.
Warning: Invalid resolution 0 dpi. Using 70 instead.
Warning: Invalid resolution 0 dpi. Using 70 instead.
Warning: Invalid resolution 0 dpi. Using 70 instead.
Warning: Invalid resolution 0 dpi. Using 70 instead.
Warning: Invalid resolution 0 dpi. Using 70 instead.
Warning: Invalid resolution 0 dpi. Using 70 instead.
Warning: Invalid resolution 0 dpi. Using 70 instead.
Warning: Invalid resolution 0 dpi. Using 70 instead.
rt。
获取不到cookie啊,一直302重定向,直接post返回200
api网页测试时,
Request URL
http://server:8080/wisedu-unified-login-api-v1.0/api/login?login_url=https%3A%2F%2Fcqmu.campusphere.net%2Fiap%2Flogin%3Fservice%3Dhttps%253A%252F%252Fcqmu.campusphere.net%252Fportal%252Flogin&password=PASSWORD&username=USERNAME
后,回报URL无效,报文为
{
"msg": "login failed! Must supply a valid URL",
"code": 1,
"cookies": null
}
{
"msg": "login failed! 网页中没有找到casLoginForm,请联系开发者!!!",
"code": 1,
"cookies": null
}
请随机user-agent登录(Yun盾)
应为登录
,而不是登陆
Using wrong captcha
to login too much times returns HTTP 401 Unauthorized
every time , which will cause account to be locked(in my case in whpu
). I think we can reduce MAX_TRY_TIMES
and prompt to api's user like:
验证码识别多次尝试失败,手动登录后可避免 API 的验证码识别过程
'msg': 'login failed! HTTP error fetching URL', 'code': 1, 'cookies': None
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.