Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/reactjs/26.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Reactjs 谷歌登录firebase,在React中进行chrome扩展_Reactjs_Firebase_Google Signin - Fatal编程技术网

Reactjs 谷歌登录firebase,在React中进行chrome扩展

Reactjs 谷歌登录firebase,在React中进行chrome扩展,reactjs,firebase,google-signin,Reactjs,Firebase,Google Signin,使用Firebase for Google登录,并使用React创建Chrome扩展。我已经使用GoogleConsole设置了oauth,并且能够使用chrome扩展成功登录 chrome.identity.getAuthToken({ interactive: true }, function (token) { if (chrome.runtime.lastError) { console.log('It was not possible to get a token progra

使用Firebase for Google登录,并使用React创建Chrome扩展。我已经使用
GoogleConsole
设置了oauth,并且能够使用chrome扩展成功登录

chrome.identity.getAuthToken({ interactive: true }, function (token) {
if (chrome.runtime.lastError) {
    console.log('It was not possible to get a token programmatically.');
} else if (chrome.runtime.lastError) {
    console.error(chrome.runtime.lastError);
} else if (token) {
    // Authorize Firebase with the OAuth Access Token.
    var credential = firebase.auth.GoogleAuthProvider.credential(null, token);
    firebase.auth().signInWithCredential(credential).catch(function (error) {
        // The OAuth token might have been invalidated. Lets' remove it from cache.
        if (error.code === 'auth/invalid-credential') {
            chrome.identity.removeCachedAuthToken({ token: token }, function () {
                signInWithGoogle();
            });
        }
    });
} else {
    console.error('The OAuth Token was null');
}
});
现在,我想使用react、redux、webext redux来构造我的代码

在firebase的配置中,包含了
apiKey、databaseUrl、storageBucket和authDomain作为chrome-extension://key_name.

在Firebase中的Firebase->auth->SignIn->auth Domains下定义了相同的auth域。 扩展抛出错误
Uncaught错误:新iframe-https://chrome-extension/:auth/iframe?apiKey=secretKeys
关于尝试使用谷歌登录


如果需要更多信息,请告诉我。

chrome.identity
代码从
popup.js
转换为
background.js
,以便在浏览器中为用户维护单一登录

Popup.js
->
background.js
->
使用google执行singin

使用
webext-redux
redux
redux-thunk
firebase
实现
谷歌登录与React