My SignIn method is as follows:
public void SignIn()
{
Debug.WriteLine("In SignIn");
if (GdAuthenticator == null)
{
(App.GdClientId, App.GdRedirectUrl, App.GdClientSecret) = App.SetIDs4GoogleDrive();
Debug.WriteLine($"GdRedirectUrl: {App.GdRedirectUrl}");
GdAuthenticator = new OAuth2Authenticator(
App.GdClientId,
App.GdClientSecret,
App.GdScope,
new Uri("https://accounts.google.com/o/oauth2/v2/auth"),
new Uri(App.GdRedirectUrl),
new Uri("https://www.googleapis.com/oauth2/v4/token"),
isUsingNativeUI: true);
GdAuthenticator.Completed += Auth_Completed;
AuthenticatorHelper.OAuth2Authenticator = GdAuthenticator;
}
// This flag is set here as for iOS, AppDelegate.OpenUrl is invoked even before
// this.Auth_Completed event is invoked and this flag is needed to redirect
// to this app after authentication
if (Device.RuntimePlatform == Device.iOS)
App.StorageServiceSignedIn = App.StorageServices.GoogleDrive;
OAuthLoginPresenter presenter = new OAuthLoginPresenter();
presenter.Login(GdAuthenticator);
}
GdScope is set as follows:
public static string GdScope = "https://www.googleapis.com/auth/drive https://www.googleapis.com/auth/drive.file";
The error occuring is:
System.UnauthorizedAccessException
Message=Access to the path '/private/var/mobile/Containers/Data/Application/FE509305-6324-4705-B517-DA2A98B18A69/.local/share/google-filedatastore/Google.Apis.Auth' is denied.
I don't find any line containing "FE5" in the device logs.
The Publishing Status of my app on Google API site is "Testing".
Since it is not failing on the simulator I assume that all authentications are in order. The app is run on iPhone 6 in Debug mode.
I published the app to App Store after testing in Debug mode but never tested on device in Release mode. But I found the issue after users facing crash issue while signing into Google Drive services that I am using in the app.
Let me know if you need any further info.
ThanQ...