xamarinアンドロイドアプリでGoogle認証を実装しようとしています。私はOAuth2Authenticatorを使用してユーザーを認証しています。認証後、access_token.Howを返すだけで、ユーザーがアプリケーションを開くたびにログインする必要がないようにrefresh_tokenを取得できますか?私は、ユーザーGoogleの更新トークンを取得できませんxauth2 with xamarin android
var auth = new OAuth2Authenticator(
clientId: "***************************.apps.googleusercontent.com",
scope: "https://www.googleapis.com/auth/userinfo.profile",
authorizeUrl: new Uri("https://accounts.google.com/o/oauth2/auth"),
redirectUrl: new Uri("https://www.googleapis.com/plus/v1/people/me"),
accessTokenUrl: newUri("https://www.googleapis.com/oauth2/v4/token"),
clientSecret: "*********************",
getUsernameAsync: null);
auth.Completed += async (sender, e) =>
{
if (!e.IsAuthenticated)
{
Toast.MakeText(this, "Fail to authenticate!", ToastLength.Short).Show();
return;
}
string access_token;
e.Account.Properties.TryGetValue("access_token", out access_token);
}
あなたは問題を解決するために何を試しましたか?目標を達成するために使用しているコードを追加してください。 – Demitrian
@Demitrian私は上記のaccesstokenとリフレッシュトークンを要求するために使用しているコードを追加しました!どうぞよろしくお願いします。 – Ginna
@Ginna、あなたは応答に応答トークンがない、または応答をどのように抽出したのか分からないと言いますか? – Nkosi