【发布时间】:2022-04-12 22:27:56
【问题描述】:
我正在尝试使用 expo authsession 退出 google,但它总是返回错误消息:无法撤销令牌:RevokeTokenRequest 需要有效的令牌才能撤销。我已经尝试放置 Bearer ${google_access_token} 和 ${google_access_token} 但没有成功。
//LOGOUT GOOGLE
const handleLogoutGoogle = async () => {
let config = {
issuer: "https://accounts.google.com/o/oauth2/v2/logout",
scopes: ["openid", "profile"],
/* This is the CLIENT_ID generated from a Firebase project */
clientId: "cccccccccc-aio1fviva82o78umts2k4uvsn1val515.apps.googleusercontent.com",
};
const google_access_token = await AsyncStorage.getItem("@myApp:googleAccessToken");
if (google_access_token) {
console.log(`Bearer ${google_access_token}`);
try {
await AuthSession.revokeAsync(config, {
token: `${google_access_token}`,
isClientIdProvided: true,
});
await AsyncStorage.removeItem("@myApp:googleAccessToken");
return null;
} catch (e) {
console.log(`Failed to revoke token: ${e.message}`);
}
}
};
//LOGOUT GOOGLE
【问题讨论】:
-
嘿,艾迪!你有没有熬过这个?
-
嗨,伙计!不,我不能
-
您是否尝试过将 Firebase 与身份验证会话集成?
-
事实上,我什至无法使用 Expo 实现 Google 登录以正常工作
-
所以没有身份验证流程与 expo-auth-session 一起使用?
标签: react-native oauth-2.0 expo