Bug 36201 - Webview fails to load long OAuth urls on iOS
Summary: Webview fails to load long OAuth urls on iOS
Status: RESOLVED NOT_REPRODUCIBLE
Alias: None
Product: Forms
Classification: Xamarin
Component: iOS ()
Version: 2.0.0
Hardware: PC Mac OS
: --- normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2015-11-24 05:56 UTC by Prashant Cholachagudda
Modified: 2016-12-21 02:33 UTC (History)
3 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED NOT_REPRODUCIBLE

Description Prashant Cholachagudda 2015-11-24 05:56:12 UTC
Webview fails to load long OAuth urls on iOS. Note that we can load this URL in the Xamarin.iOS Apps

Sample code:
namespace FormsApp
{
	public class App : Application
	{
		public App ()
		{
			string url = "https://kpd-login-tst.azurewebsites.net/core/connect/authorize?response_type=code&redirect_uri=https%3A%2F%2Fkpd-login-tst.azurewebsites.net%2Fapps%2FKpd.Apps.Timesheets.Mobile.Phone.iOS&client_id=Kpd.Apps.Timesheets.Mobile.Phone.iOS&scope=Kpd_Api%20Write_Timesheets_WebAPI%20Read_Timesheets_WebAPI%20offline_access&acr_values=tenant%3Ab9e1983e-52d4-4d13-aff8-6c466caeaeac";


			// The root page of your application
			MainPage = new ContentPage {
				Content = new WebView {
					VerticalOptions = LayoutOptions.Center,
					Source=url
				}
			};

		}
	}
}
Comment 1 Stefan de Vogelaere 2015-11-24 06:02:36 UTC
in iOS, the above scopes (separated with %20) are converted back to spaces once given to NSUrl.

it helps to do:
var url = (NSString)View.Url;
url = url.CreateStringByAddingPercentEscapes(NSStringEncoding.UTF8);
Comment 2 adrianknight89 2016-10-13 04:58:36 UTC
I don't seem to have this issue in iOS 10.
Comment 3 Samantha Houts [MSFT] 2016-12-21 02:33:18 UTC
I am unable to reproduce this issue on iOS 9 or iOS 10 with the latest stable Xamarin.Forms. If you continue to experience this issue, please reopen this issue with a reproduction project and any additional details that may help us diagnose the problem.

Warm regards,
Xamarin Forms Team