Open less0 opened 4 years ago
I have the same problem! Any solution or work around?
Same issue!
`Warning: Attempt to present <UINavigationController: 0x7f9da004b200> on <Xamarin_Forms_Platform_iOS_PlatformRenderer: 0x7f9d96d017e0> whose view is not in the window hierarchy! [unspecified] container_system_group_path_for_identifier: error = (container_error_t)53 WF: === Starting WebFilter logging for process ClassifappNew.iOS WF: _WebFilterIsActive returning: NO [ProcessSuspension] 0x122495720 - ProcessAssertion::processAssertionWasInvalidated() [ProcessSuspension] 0x1224956c0 - ProcessAssertion::processAssertionWasInvalidated()`
Any progress on fixing this issue???
My application is not showing the OAuth login page to authenticate the user with the app either. Any solution or work around?
I experienced a similar problem, but with another warning. The problem originated in the Presenter choosing the wrong ViewController. Fortunately I was able to inject my own Presenter:
public class MyPresenter
{
UIKit.UIViewController rootViewController;
public void Login(Authenticator authenticator)
{
authenticator.Completed += AuthenticatorCompleted;
rootViewController = GetCurrentUIController();
rootViewController.PresentViewController(authenticator.GetUI(), true, null);
}
void AuthenticatorCompleted(object sender, AuthenticatorCompletedEventArgs e)
{
rootViewController?.DismissViewController(true, null);
((Authenticator)sender).Completed -= AuthenticatorCompleted;
// always think of the GC ;)
rootViewController = null;
}
private UIViewController GetCurrentUIController()
{
UIViewController viewController;
var window = UIApplication.SharedApplication.KeyWindow;
if (window == null)
{
throw new InvalidOperationException("There's no current active window");
}
viewController = window.RootViewController;
while (viewController.PresentedViewController != null)
{
viewController = viewController.PresentedViewController;
}
return viewController;
}
}
and in AppDelegate I changed:
//global::Xamarin.Auth.Presenters.XamarinIOS.AuthenticationConfiguration.Init();
global::Xamarin.Auth.Presenters.OAuthLoginPresenter.PlatformLogin = (authenticator) =>
{
var oauthLogin = new MyPresenter();
oauthLogin.Login(authenticator);
};
Currently I still have a error dialog popping up (cannot open URL), but authentication works. I will post an update as soon as I got rid of the error dialog.
UPDATE The "Cannot open URL"-error dialog was due to a configuration error (wrong URL scheme in info.plist).
Bump. I'm stuck on the same thing. What's crazy is this used to work, from what I can tell, in earlier versions of iOS (before iOS 14.x).
I have a code base which was tested and working with Xamarin.Auth 1.6.x on iOS 12 and this wasn't an issue. Now I try to run the code on newer phones and it doesn't work.
@AlexSchuetz I've tried your solution with no luck. Can you please give us some more information about how to work around this? My browser never appears to do the login.
@andygikling I am sorry. I recently moved away from Xamarin.Auth since it hasn't seen updates for 2 years now. This means, that it still uses the old android-support packages and not the new androidx ones.
I first started my own fork of this and removed the old android-support dependencies. But finally I dropped this and implemented it on my own. There were too many issues, too many usages of deprecated apis and the code was very complex and filled with features that are unneccessary for my usecases.
Xamarin.Essentials now has a Webauthenticator you could use as replacement to some degree. But probably you'd have to implement your used flow on top. I decided not to use Xamarin.Essetials Webauthenticator for now as it has IMHO still some issues. I.e. if you use it on iOS you will always see a confirmation-dialog first asking you if you agree to authenticate against the given server (not only on first authentication).
Thank you for the info!
Sent from my iPhone
On Apr 28, 2021, at 2:09 AM, Alexander Schuetz @.***> wrote:
@andygikling I am sorry. I recently moved away from Xamarin.Auth since it hasn't seen updates for 2 years now. This means, that it still uses the old android-support packages and not the new androidx ones.
I first started my own fork of this and removed the old android-support dependencies. But finally I dropped this and implemented it on my own. There were too many issues, too many usages of deprecated apis and the code was very complex and filled with features that are unneccessary for my usecases.
Xamarin.Essentials now has a Webauthenticator you could use as replacement to some degree. But probably you'd have to implement your used flow on top. I decided not to use Xamarin.Essetials Webauthenticator for now as it has IMHO still some issues. I.e. if you use it on iOS you will always see a confirmation-dialog first asking you if you agree to authenticate against the given server (not only on first authentication).
— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.
Yes @AlexSchuetz thank you for the insight. I might have to step back and rethink this a bit here.
Xamarin.Auth Issue
Version
Steps to reproduce
OAuth2Authenticator
OAuthLoginPresenter
OAuthLoginPresenter.Login
from the modal pageI've attached a MCVE that reproduces the issue:
ModalAuthTest.zip
Platform:
(I am using the Visual Studio 16.4 P2 because debugging failed with 16.3, but the issue occurred when using 16.3 with Xamarin.iOS 13.2 and mono 6.0, too)
Expected behaviour
The application should show the OAuth login page to authenticate the user with the app.
Actual behaviour
The web view is not shown and a warning is displayed on the debug output