Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
520 views
in Technique[技术] by (71.8m points)

SF的第三方登录是如何实现的

像我选github登录,window.open一个github的登录页面,登录成功后,原本的sf页面自动刷新了

这个新打开的github页面是如何通知到sf主页面的呢


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Github 授权后会跳转到这个应用设置好的回调页面来,这个页面就是 SF 自己写的,没样式,但有一段 JS 代码。

窗口 A 打开了窗口 B,在窗口 B 里通过 window.opener 就可以得到窗口 A。

已经得到窗口 A (一个 window 对象)了,你想咋触发里面的方法就咋触发呗。

window.close() 关闭自己这个不用教吧?

https://developer.mozilla.org...

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...