0
Xamarin.Android로 응용 프로그램을 개발 중이며 로그인 시스템이 필요했습니다. 따라서 저는 Xamarin을 사용하고 있습니다 .Auth. OAuth2Authenticator를 만들었지 만 auth.completed는 작동하지 않습니다. auth.completed가 성공한 이유는 무엇입니까?Xamarin.Auth가 완료되지 않았습니다.
public void LoginToSabis()
{
var auth = new OAuth2Authenticator(
clientId: "example_android",
scope: "read",
authorizeUrl: new Uri("example/authorize"),
redirectUrl: new Uri("ex/callback"));
auth.AllowCancel = true;
// If authorization succeeds or is canceled, .Completed will be fired. BUT WHEN SUCCEEDS NOT WORKING, WHEN CANCELED WORKING...
auth.Completed += async (s, ee) =>
{
if (!ee.IsAuthenticated)
{
var builder = new Android.Support.V7.App.AlertDialog.Builder(this);
builder.SetMessage("Not Authenticated");
builder.SetPositiveButton("Ok", (o, e) => { });
builder.Create().Show();
return;
}
AccountStore.Create(Application.Context).Save(ee.Account, "cg");
StartActivity(typeof(LoginRedirectActivity));
};
}