In this post, we will see an example of how to display a SharePoint page in the IOS mobile app using the WebView control using NTLM authentication. For this example, I have used my local SharePoint 2016 environment with a self-signed certificate and the Visual Studio for Mac.


  1. Add a WebView control to the ViewController.
  2. Create a ConnectionDelegate to handle the SSL and Authentication. Please include the below section as a code sample:
    public class ConnectionDelegate : NSUrlConnectionDelegate
        private readonly UIWebView _webView;
        private NSUrlRequest _request;
        public ConnectionDelegate(UIWebView parent, NSUrlRequest request)
            _webView = parent;
            _request = request;
        public override void WillSendRequestForAuthenticationChallenge(NSUrlConnection connection,
                     NSUrlAuthenticationChallenge challenge)
            if (challenge.ProtectionSpace.AuthenticationMethod == NSUrlProtectionSpace.AuthenticationMethodNTLM)
             var credential = new NSUrlCredential("domain\\userid", "password", NSUrlCredentialPersistence.ForSession);
                         challenge.Sender.UseCredential(credential, challenge);
            else if (challenge.ProtectionSpace.AuthenticationMethod == NSUrlProtectionSpace.AuthenticationMethodServerTrust)
               challenge.Sender.UseCredential(NSUrlCredential.FromTrust(challenge.ProtectionSpace.ServerSecTrust), challenge);
  3. Attach the custom delegate class to the WebView to handle the authentication.
    var urlComponents = new NSUrlComponents("https://portal.contoso.com");
    WebView.ShouldStartLoad = (webView, request, navType) =>
                     var urlConnection = NSUrlConnection.FromRequest(request, new ConnectionDelegate(webView, request));
                     return true;
    WebView.LoadRequest(new NSUrlRequest(urlComponents.Url));
  4. Run the application to display the SharePoint page within the webview.


(Visited 353 times, 1 visits today)

About the author 

Balamurugan Kailasam

Summit Bundle

Get 200+ hours of Microsoft 365 Training for 27$!

Master Office 365, Power Platform & SharePoint & Teams With 200+ Hours Of Training Videos and 108 Ebooks in the Collab365 Academy. This offer is insane and is only available for a limited period.