Google Plus Oauth回调函数如何工作? [英] How does Google Plus Oauth callback function work?

查看:119
本文介绍了Google Plus Oauth回调函数如何工作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Google+ JS文档中,它说,如果指定了回调函数参数,则在身份验证流程完成后Google会调用该函数.

In Google+ JS documentation, it says that if a callback function parameter is specified, Google will call that function when auth flow completes.

那将如何工作?即父窗口中的javascript如何获取访问子窗口(Google Oauth)的状态?

How would that work? i.e. how does javascript in parent window get access child window (Google Oauth)'s state?

推荐答案

JavaScript子窗口可以在其父窗口中调用函数.假设您指定了函数signinCallback(authResult),然后身份验证窗口可以调用parent.signinCallback(authResult)authResult传递到主窗口.

Javascript children windows can call functions in their parent windows. Let's say you specify the function signinCallback(authResult), then the auth window can call parent.signinCallback(authResult) to pass authResult to your main window.

这篇关于Google Plus Oauth回调函数如何工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆