Amazon web services 使用AWS Cognito响应本地google登录
我正在开发一个react本地应用程序,我想让我的用户能够登录google。但是,当我向googleapi发出请求时,它返回Amazon web services 使用AWS Cognito响应本地google登录,amazon-web-services,react-native,google-signin,Amazon Web Services,React Native,Google Signin,我正在开发一个react本地应用程序,我想让我的用户能够登录google。但是,当我向googleapi发出请求时,它返回错误的登录错误:DEVELOPER\u Error 我正在使用AWS Cognito,希望将Google登录与之集成。我看到一些问题,说生成我的“webClientId”的SHA-1蓝图,但它们都使用firebase。在Cognito上,没有字段添加相应的SHA-1蓝图 我的代码如下: componentWillMount() { GoogleSignin
错误的登录错误:DEVELOPER\u Error
我正在使用AWS Cognito,希望将Google登录与之集成。我看到一些问题,说生成我的“webClientId”的SHA-1蓝图,但它们都使用firebase。在Cognito上,没有字段添加相应的SHA-1蓝图
我的代码如下:
componentWillMount() {
GoogleSignin.configure({
webClientId: googleConfig.clientId
});
}
...
googleSignIn() {
GoogleSignin.signIn()
.then((user) => {
console.log(user);
this.setState({user: user});
})
.catch((err) => {
console.log('WRONG SIGNIN', err);
})
.done();
}
...
<GoogleSigninButton
style={{ height: 48 }}
size={GoogleSigninButton.Size.Standard}
color={GoogleSigninButton.Color.Light}
onPress={this.googleSignIn.bind(this)}/>
componentWillMount(){
谷歌签名({
webClientId:googleConfig.clientId
});
}
...
谷歌签名{
谷歌签名
。然后((用户)=>{
console.log(用户);
this.setState({user:user});
})
.catch((错误)=>{
console.log('错误登录',错误);
})
.完成();
}
...
提前谢谢你的帮助
GoogleAuthUtil.GetTokenGoogleAuthUtil.GetToken(this,googleAccount,scopes)
的作用域字符串时,请使用在Google开发者控制台中生成的“Google WebApp客户端ID”。这就是scopes=“受众:服务器:客户端\u id:”+“webClientId”
signingConfigs {
debug {
if (project.hasProperty('MYAPP_RELEASE_STORE_FILE')) {
storeFile file(MYAPP_RELEASE_STORE_FILE)
storePassword MYAPP_RELEASE_STORE_PASSWORD
keyAlias MYAPP_RELEASE_KEY_ALIAS
keyPassword MYAPP_RELEASE_KEY_PASSWORD
}
}
release {
if (project.hasProperty('MYAPP_RELEASE_STORE_FILE')) {
storeFile file(MYAPP_RELEASE_STORE_FILE)
storePassword MYAPP_RELEASE_STORE_PASSWORD
keyAlias MYAPP_RELEASE_KEY_ALIAS
keyPassword MYAPP_RELEASE_KEY_PASSWORD
}
}
}
那是我的
我也在github上找到了它。您看过这个示例(react native cognito登录示例)了吗?它似乎涵盖了所有基础: