Hi NatarajanTulasi-6244,
Welcome to our Microsoft Q&A platform!
I tested the demo you provided, but did not get the error "File /outh2redirect does not exist". Besides, to redirect the url to the app, try to override OpenUrl in AppDelegate.cs.
public override bool OpenUrl(UIApplication application, NSUrl url, NSDictionary options)
{
var uri = new Uri(url.AbsoluteString);
var googleDriveInstance = GoogleDriveSingelton.GetInstance;
googleDriveInstance.auth?.OnPageLoading(uri);
return true;
}
Then you modify the scope in GoogleConfig as follows:
public static string scope = "https://www.googleapis.com/auth/userinfo.email";
Now you can get the account logged in.
private async void Auth_Completed(object sender, AuthenticatorCompletedEventArgs e)
{
if (e.IsAuthenticated)
{
var request = new OAuth2Request("GET", new Uri("https://www.googleapis.com/oauth2/v2/userinfo"), null, e.Account);
var response = await request.GetResponseAsync();
string account_info = await response.GetResponseTextAsync();
}
}
Regards,
Kyle
If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.