NutzCN Logo
问答 nutz-book-project 5.x 登录github跳转不见了
发布于 9天前 作者 ftqiao 100 次浏览 复制 上一个帖子 下一个帖子
标签:

根据之前的帖子,贴士在github上注册了一个应用。、
在oauth.properties 内配置
oauth.api.github.com.consumer_key=“申请的Client ID”
oauth.api.github.com.consumer_secret=“申请的Client Secret”
启动应用程序后,点击使用github登录,跳转页面提示-------:尝试运行 Windows 网络诊断。ERR_SSL_PROTOCOL_ERROR
是哪里设置漏了吗

11 回复

我是可以用github登录nutz社区的,这咋还需要翻墙哩

仔细看url

变https了,而且跟github上设置的url也不符合

Homepage URL ---- http://127.0.0.1:8080/yvr/list 设置成了https:错误!!(/捂脸··)
Authorization callback URL-----http://127.0.0.1:8080/oauth/github/callback (也不要https的s)
配置正常,可以跳转到主页;
然鹅:登录没有显示状态

16:08:15.506 DEBUG (LogTimeProcessor.java:24) process - [GET ]URI=/oauth/github/callback 200 7ms
16:08:15.506 WARN  (FailProcessor.java:28) process - Error@/oauth/github/callback :
org.brickred.socialauth.exception.SocialAuthException: Verification code is null
	at org.brickred.socialauth.oauthstrategy.OAuth2.verifyResponse(OAuth2.java:148) ~[socialauth-4.9.jar:?]
	at org.brickred.socialauth.provider.GitHubImpl.doVerifyResponse(GitHubImpl.java:139) ~[socialauth-4.9.jar:?]
	at org.brickred.socialauth.provider.GitHubImpl.verifyResponse(GitHubImpl.java:129) ~[socialauth-4.9.jar:?]
	at org.brickred.socialauth.SocialAuthManager.connect(SocialAuthManager.java:184) ~[socialauth-4.9.jar:?]
	at net.wendal.nutzbook.oauth.module.OauthModule.callback(OauthModule.java:97) ~[classes/:?]
	at net.wendal.nutzbook.oauth.module.OauthModule$FM$callback$f7b8158c976d53589a5a260f16491068.invoke(OauthModule.java) ~[nutz-1.r.67-20181202.152049-50.jar:?]
	at org.nutz.mvc.impl.processor.MethodInvokeProcessor.process(MethodInvokeProcessor.java:31) ~[nutz-1.r.67-20181202.152049-50.jar:1.r.67-SNAPSHOT]
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44) ~[nutz-1.r.67-20181202.152049-50.jar:1.r.67-SNAPSHOT]
	at org.nutz.mvc.impl.processor.AdaptorProcessor.process(AdaptorProcessor.java:38) ~[nutz-1.r.67-20181202.152049-50.jar:1.r.67-SNAPSHOT]
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44) ~[nutz-1.r.67-20181202.152049-50.jar:1.r.67-SNAPSHOT]
	at org.nutz.mvc.impl.processor.ActionFiltersProcessor.process(ActionFiltersProcessor.java:58) ~[nutz-1.r.67-20181202.152049-50.jar:1.r.67-SNAPSHOT]
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44) ~[nutz-1.r.67-20181202.152049-50.jar:1.r.67-SNAPSHOT]
	at org.nutz.integration.shiro.NutShiroProcessor.process(NutShiroProcessor.java:126) ~[nutz-integration-shiro-1.r.67-20181202.142648-32.jar:?]
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44) ~[nutz-1.r.67-20181202.152049-50.jar:1.r.67-SNAPSHOT]
	at org.nutz.mvc.impl.processor.ModuleProcessor.process(ModuleProcessor.java:123) ~[nutz-1.r.67-20181202.152049-50.jar:1.r.67-SNAPSHOT]
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44) ~[nutz-1.r.67-20181202.152049-50.jar:1.r.67-SNAPSHOT]
	at org.nutz.mvc.impl.processor.EncodingProcessor.process(EncodingProcessor.java:27) ~[nutz-1.r.67-20181202.152049-50.jar:1.r.67-SNAPSHOT]
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44) ~[nutz-1.r.67-20181202.152049-50.jar:1.r.67-SNAPSHOT]
	at org.nutz.mvc.impl.processor.UpdateRequestAttributesProcessor.process(UpdateRequestAttributesProcessor.java:15) ~[nutz-1.r.67-20181202.152049-50.jar:1.r.67-SNAPSHOT]
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44) ~[nutz-1.r.67-20181202.152049-50.jar:1.r.67-SNAPSHOT]
	at net.wendal.nutzbook.common.mvc.DailyUniqueUsersProcessor.process(DailyUniqueUsersProcessor.java:45) ~[classes/:?]
	at org.nutz.mvc.impl.processor.AbstractProcessor.doNext(AbstractProcessor.java:44) ~[nutz-1.r.67-20181202.152049-50.jar:1.r.67-SNAPSHOT]
	at net.wendal.nutzbook.common.mvc.LogTimeProcessor.process(LogTimeProcessor.java:19) ~[classes/:?]
	at org.nutz.mvc.impl.NutActionChain.doChain(NutActionChain.java:44) [nutz-1.r.67-20181202.152049-50.jar:1.r.67-SNAPSHOT]
	at org.nutz.mvc.impl.ActionInvoker.invoke(ActionInvoker.java:67) [nutz-1.r.67-20181202.152049-50.jar:1.r.67-SNAPSHOT]
	at org.nutz.mvc.ActionHandler.handle(ActionHandler.java:31) [nutz-1.r.67-20181202.152049-50.jar:1.r.67-SNAPSHOT]
	at org.nutz.mvc.NutFilter.doFilter(NutFilter.java:202) [nutz-1.r.67-20181202.152049-50.jar:1.r.67-SNAPSHOT]
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1610) [jetty-servlet-9.4.14.v20181114.jar:9.4.14.v20181114]
	at org.apache.shiro.web.servlet.AbstractShiroFilter.executeChain(AbstractShiroFilter.java:449) [shiro-web-1.3.2.jar:1.3.2]
	at org.apache.shiro.web.servlet.AbstractShiroFilter$1.call(AbstractShiroFilter.java:365) [shiro-web-1.3.2.jar:1.3.2]
	at org.apache.shiro.subject.support.SubjectCallable.doCall(SubjectCallable.java:90) [shiro-core-1.3.2.jar:1.3.2]
	at org.apache.shiro.subject.support.SubjectCallable.call(SubjectCallable.java:83) [shiro-core-1.3.2.jar:1.3.2]
	at org.apache.shiro.subject.support.DelegatingSubject.execute(DelegatingSubject.java:383) [shiro-core-1.3.2.jar:1.3.2]
	at org.apache.shiro.web.servlet.AbstractShiroFilter.doFilterInternal(AbstractShiroFilter.java:362) [shiro-web-1.3.2.jar:1.3.2]
	at org.apache.shiro.web.servlet.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:125) [shiro-web-1.3.2.jar:1.3.2]
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1610) [jetty-servlet-9.4.14.v20181114.jar:9.4.14.v20181114]
	at com.alibaba.druid.support.http.WebStatFilter.doFilter(WebStatFilter.java:123) [druid-1.1.12.jar:1.1.12]
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1610) [jetty-servlet-9.4.14.v20181114.jar:9.4.14.v20181114]
	at org.nutz.mvc.WhaleFilter.doFilter(WhaleFilter.java:171) [nutz-1.r.67-20181202.152049-50.jar:1.r.67-SNAPSHOT]
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1602) [jetty-servlet-9.4.14.v20181114.jar:9.4.14.v20181114]
	at org.eclipse.jetty.websocket.server.WebSocketUpgradeFilter.doFilter(WebSocketUpgradeFilter.java:214) [websocket-server-9.4.14.v20181114.jar:9.4.14.v20181114]
	at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1610) [jetty-servlet-9.4.14.v20181114.jar:9.4.14.v20181114]
	at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:540) [jetty-servlet-9.4.14.v20181114.jar:9.4.14.v20181114]
	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:146) [jetty-server-9.4.14.v20181114.jar:9.4.14.v20181114]
	at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:548) [jetty-security-9.4.14.v20181114.jar:9.4.14.v20181114]
	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132) [jetty-server-9.4.14.v20181114.jar:9.4.14.v20181114]
	at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:257) [jetty-server-9.4.14.v20181114.jar:9.4.14.v20181114]
	at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:1588) [jetty-server-9.4.14.v20181114.jar:9.4.14.v20181114]
	at org.eclipse.jetty.server.handler.ScopedHandler.nextHandle(ScopedHandler.java:255) [jetty-server-9.4.14.v20181114.jar:9.4.14.v20181114]
	at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1345) [jetty-server-9.4.14.v20181114.jar:9.4.14.v20181114]
	at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:203) [jetty-server-9.4.14.v20181114.jar:9.4.14.v20181114]
	at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:480) [jetty-servlet-9.4.14.v20181114.jar:9.4.14.v20181114]
	at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:1557) [jetty-server-9.4.14.v20181114.jar:9.4.14.v20181114]
	at org.eclipse.jetty.server.handler.ScopedHandler.nextScope(ScopedHandler.java:201) [jetty-server-9.4.14.v20181114.jar:9.4.14.v20181114]
	at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1247) [jetty-server-9.4.14.v20181114.jar:9.4.14.v20181114]
	at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:144) [jetty-server-9.4.14.v20181114.jar:9.4.14.v20181114]
	at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:132) [jetty-server-9.4.14.v20181114.jar:9.4.14.v20181114]
	at org.eclipse.jetty.server.Server.handle(Server.java:502) [jetty-server-9.4.14.v20181114.jar:9.4.14.v20181114]
	at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:364) [jetty-server-9.4.14.v20181114.jar:9.4.14.v20181114]
	at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:260) [jetty-server-9.4.14.v20181114.jar:9.4.14.v20181114]
	at org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:305) [jetty-io-9.4.14.v20181114.jar:9.4.14.v20181114]
	at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:103) [jetty-io-9.4.14.v20181114.jar:9.4.14.v20181114]
	at org.eclipse.jetty.io.ChannelEndPoint$2.run(ChannelEndPoint.java:118) [jetty-io-9.4.14.v20181114.jar:9.4.14.v20181114]
	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.runTask(EatWhatYouKill.java:333) [jetty-util-9.4.14.v20181114.jar:9.4.14.v20181114]
	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.doProduce(EatWhatYouKill.java:310) [jetty-util-9.4.14.v20181114.jar:9.4.14.v20181114]
	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.tryProduce(EatWhatYouKill.java:168) [jetty-util-9.4.14.v20181114.jar:9.4.14.v20181114]
	at org.eclipse.jetty.util.thread.strategy.EatWhatYouKill.run(EatWhatYouKill.java:126) [jetty-util-9.4.14.v20181114.jar:9.4.14.v20181114]
	at org.eclipse.jetty.util.thread.ReservedThreadExecutor$ReservedThread.run(ReservedThreadExecutor.java:366) [jetty-util-9.4.14.v20181114.jar:9.4.14.v20181114]
	at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:765) [jetty-util-9.4.14.v20181114.jar:9.4.14.v20181114]
	at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:683) [jetty-util-9.4.14.v20181114.jar:9.4.14.v20181114]
	at java.lang.Thread.run(Thread.java:745) [?:1.8.0_112]
16:08:15.516 DEBUG (UrlMappingImpl.java:101) get - Found mapping for [GET] path=/yvr/list : YvrModule.list(YvrModule.java:135)
16:08:15.516 DEBUG (NutIoc.java:166) get - Get 'yvrModule'<class net.wendal.nutzbook.yvr.module.YvrModule>

要github跳转过来,不是在地址栏随便改改就行的

点击使用github登录,自动跳到git登录页面,然后自动跳会得我配置的主页。没有在地址栏手动输入。(额~毕竟也是通过qq,github登录过其他网站呢嘛)
然后出现的错误如上面日志。OauthModule.callback(OauthModule.java:97) ,debug进去,是出错的~

97行入参paramsMap:三条数据:
0:key--error_description value--The redirect_uri MUST match the registered callback URL for this application.
1:key--error value--redirect_uri_mismatch
2:key--error_uri value--https://developer.github.com/apps/managing-oauth-apps/troubleshooting-authorization-request-errors/#redirect-uri-mismatch
我理解是,虽然跳转到指定页面,但是错误和之前贴出来的还是差不多。我先去谷歌下

你在github上设置的回调url是什么,没对上呢

额~日志上面的那段回复,是给出来了的,http://127.0.0.1:8080/oauth/github/callback

结贴:经大神指点,最后问题定位在跳转的路径上,是基础配置 website.urlbase=http://127.0.0.1:8080,源代码默认为(https://nutz.cn),更改为自己项目地址,即可实现使用github登录效果。
总结:配置路径的时候http要不要带,到底是https还是http。
其实之前的回帖能定位到回调的url问题,debug的时候并没有想到到底使用的是哪个url。应该多看一步,多想一点。

添加回复
请先登陆
回到顶部