<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic IWA Portal Login and Feature Service Access in .NET Maps SDK Questions</title>
    <link>https://community.esri.com/t5/net-maps-sdk-questions/iwa-portal-login-and-feature-service-access/m-p/141656#M1596</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;We've got an IWA Portal setup in house and we are working on getting our iOS Runtime Xamarin Forms application to work properly with it.&amp;nbsp; We have been using oAuth based authentication for years and now have customers implementing IWA based Portals and need to support that.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To get the login going I am using the ArcGISNetworkCredential.&amp;nbsp; When the authentication challenge is issued against our IWA portal we pop up a home grown username/password form, take that information, create the ArcGISNetworkCredential and login to the portal accordingly.&amp;nbsp; I've got that all working well.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We have a couple of tools that utilize feature services to create offline geodatabases to support field work.&amp;nbsp; When I try to generate those offline geodatabases using the ArcGISNetworkCredential I am getting an error that a token is required.&amp;nbsp; Makes sense.&amp;nbsp; Problem is the ArcGISNetworkCredential does not have a token associated with it.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I then switched gears and attempted to use the ArcGISTokenCredential for everything - logging into the portal and generating geodatabases from feature services.&amp;nbsp; No luck there - could not get that to work for logging in.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've been through the multitude of online documents referring to integrated windows authentication implementation and have used a lot of code examples in there within our app.&amp;nbsp; I have not found anything that addresses our particular scenario though.&amp;nbsp; I feel like I'm close on this and am missing a small piece of the puzzle.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can someone point me in the right direction?&amp;nbsp; Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 14 Mar 2019 18:26:48 GMT</pubDate>
    <dc:creator>AndyWright</dc:creator>
    <dc:date>2019-03-14T18:26:48Z</dc:date>
    <item>
      <title>IWA Portal Login and Feature Service Access</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/iwa-portal-login-and-feature-service-access/m-p/141656#M1596</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;We've got an IWA Portal setup in house and we are working on getting our iOS Runtime Xamarin Forms application to work properly with it.&amp;nbsp; We have been using oAuth based authentication for years and now have customers implementing IWA based Portals and need to support that.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;To get the login going I am using the ArcGISNetworkCredential.&amp;nbsp; When the authentication challenge is issued against our IWA portal we pop up a home grown username/password form, take that information, create the ArcGISNetworkCredential and login to the portal accordingly.&amp;nbsp; I've got that all working well.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;We have a couple of tools that utilize feature services to create offline geodatabases to support field work.&amp;nbsp; When I try to generate those offline geodatabases using the ArcGISNetworkCredential I am getting an error that a token is required.&amp;nbsp; Makes sense.&amp;nbsp; Problem is the ArcGISNetworkCredential does not have a token associated with it.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I then switched gears and attempted to use the ArcGISTokenCredential for everything - logging into the portal and generating geodatabases from feature services.&amp;nbsp; No luck there - could not get that to work for logging in.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I've been through the multitude of online documents referring to integrated windows authentication implementation and have used a lot of code examples in there within our app.&amp;nbsp; I have not found anything that addresses our particular scenario though.&amp;nbsp; I feel like I'm close on this and am missing a small piece of the puzzle.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can someone point me in the right direction?&amp;nbsp; Thanks!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Mar 2019 18:26:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/iwa-portal-login-and-feature-service-access/m-p/141656#M1596</guid>
      <dc:creator>AndyWright</dc:creator>
      <dc:date>2019-03-14T18:26:48Z</dc:date>
    </item>
    <item>
      <title>Re: IWA Portal Login and Feature Service Access</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/iwa-portal-login-and-feature-service-access/m-p/141657#M1597</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'd be curious how you get the Windows user name from an iOS device, but that is another question.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;When you use the Windows user name I have found that the user name needs to be in the form:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="mailto:user@DOMAIN"&gt;user@DOMAIN&lt;/A&gt;&amp;nbsp;where domain is in all caps.&amp;nbsp; If using Windows authentication and the domain is not in CAPS it fails&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Mar 2019 20:19:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/iwa-portal-login-and-feature-service-access/m-p/141657#M1597</guid>
      <dc:creator>JoeHershman</dc:creator>
      <dc:date>2019-03-14T20:19:37Z</dc:date>
    </item>
    <item>
      <title>Re: IWA Portal Login and Feature Service Access</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/iwa-portal-login-and-feature-service-access/m-p/141658#M1598</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;We pop up a homegrown login page for the user to enter their creds.&amp;nbsp; That works fine.&amp;nbsp; My issue is with accessing a feature service on our portal and making a request to that service.&amp;nbsp; It is complaining about a token when I make that request to the service.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Mar 2019 22:07:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/iwa-portal-login-and-feature-service-access/m-p/141658#M1598</guid>
      <dc:creator>AndyWright</dc:creator>
      <dc:date>2019-03-14T22:07:06Z</dc:date>
    </item>
    <item>
      <title>Re: IWA Portal Login and Feature Service Access</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/iwa-portal-login-and-feature-service-access/m-p/141659#M1599</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you post the code?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 14 Mar 2019 23:38:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/iwa-portal-login-and-feature-service-access/m-p/141659#M1599</guid>
      <dc:creator>JoeHershman</dc:creator>
      <dc:date>2019-03-14T23:38:07Z</dc:date>
    </item>
    <item>
      <title>Re: IWA Portal Login and Feature Service Access</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/iwa-portal-login-and-feature-service-access/m-p/141660#M1600</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That's a little tough as we've got pieces of all this all over the place, but I'll get you the basics here in no specific order.&amp;nbsp; What I was after with this post was a recipe.&amp;nbsp; There has to be a set of steps that has to be taken to log into an IWA portal and be able to make requests against feature services in that portal.&amp;nbsp; It seems like the ArcGISNetworkCredential gets me in the front door, but doesn't allow me to drink any beers in the fridge if you know what I mean.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;AuthenticationManager&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Current&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;ChallengeHandler &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;new&lt;/SPAN&gt; &lt;SPAN class="token class-name"&gt;IwaChallengeHandler&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt; AllowSaveCredentials &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; saveCredentials &lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;

&lt;SPAN class="keyword token"&gt;await&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;CreateIwaCredentialAsync&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="keyword token"&gt;new&lt;/SPAN&gt; &lt;SPAN class="token class-name"&gt;CredentialRequestInfo&lt;/SPAN&gt;
 &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
     ServiceUri &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;new&lt;/SPAN&gt; &lt;SPAN class="token class-name"&gt;Uri&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;_serviceUri&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
     AuthenticationType &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; AuthenticationType&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;NetworkCredential
 &lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;

ArcGISNetworkCredential credential &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;await&lt;/SPAN&gt; 
    AuthenticationManager&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Current&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;ChallengeHandler&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;CreateCredentialAsync&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;credRequestInfo&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; 
    &lt;SPAN class="keyword token"&gt;as&lt;/SPAN&gt; ArcGISNetworkCredential&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;

&lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;credRequestInfo&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Response &lt;SPAN class="operator token"&gt;==&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;null&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
       AuthenticationManager&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Current&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;AddCredential&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;credential&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
‍‍‍‍‍‍‍‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;using&lt;/SPAN&gt; EFCloud&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Events&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;using&lt;/SPAN&gt; EFCloud&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Security&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Managers&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;using&lt;/SPAN&gt; EFCloud&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;ViewModels&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;using&lt;/SPAN&gt; EFCloud&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Views&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;using&lt;/SPAN&gt; Esri&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;ArcGISRuntime&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Security&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;using&lt;/SPAN&gt; System&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;using&lt;/SPAN&gt; System&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Collections&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Generic&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;using&lt;/SPAN&gt; System&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Threading&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Tasks&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;using&lt;/SPAN&gt; Xamarin&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Forms&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;

&lt;SPAN class="keyword token"&gt;namespace&lt;/SPAN&gt; EFCloud&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Security&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Handlers
&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
	&lt;SPAN class="keyword token"&gt;internal&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;class&lt;/SPAN&gt; &lt;SPAN class="token class-name"&gt;IwaChallengeHandler&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt; IChallengeHandler
	&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
		&lt;SPAN class="token preprocessor"&gt;#region Variable/property declaration&lt;/SPAN&gt;

		&lt;SPAN class="keyword token"&gt;private&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;bool&lt;/SPAN&gt; _allowSaveCredentials&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
		&lt;SPAN class="keyword token"&gt;private&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;bool&lt;/SPAN&gt; _areCredentialsRestored&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
		&lt;SPAN class="keyword token"&gt;private&lt;/SPAN&gt; LoginPage _loginPage &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;new&lt;/SPAN&gt; &lt;SPAN class="token class-name"&gt;LoginPage&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;


		&lt;SPAN class="comment token"&gt;// A TaskCompletionSource to store the result of a login task.&lt;/SPAN&gt;
		&lt;SPAN class="keyword token"&gt;private&lt;/SPAN&gt; TaskCompletionSource&lt;SPAN class="operator token"&gt;&amp;lt;&lt;/SPAN&gt;Credential&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; _loginTaskCompletionSrc&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;


		&lt;SPAN class="keyword token"&gt;public&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;bool&lt;/SPAN&gt; AllowSaveCredentials
		&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
			&lt;SPAN class="comment token"&gt;//  The first time AllowSaveCredentials is set to true, the cached credentials are added to the AuthenticationManager&lt;/SPAN&gt;
			&lt;SPAN class="comment token"&gt;//  The default value is false&lt;/SPAN&gt;

			&lt;SPAN class="keyword token"&gt;get&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;return&lt;/SPAN&gt; _allowSaveCredentials&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;

			&lt;SPAN class="keyword token"&gt;set&lt;/SPAN&gt;
			&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
                &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;_allowSaveCredentials &lt;SPAN class="operator token"&gt;!=&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;value&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
                &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
                    _allowSaveCredentials &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;value&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;

                    &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;_allowSaveCredentials &lt;SPAN class="operator token"&gt;&amp;amp;&amp;amp;&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;!&lt;/SPAN&gt;_areCredentialsRestored&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
                    &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
                        &lt;SPAN class="comment token"&gt;//  The first time AllowSaveCredentials is set to true, add the cached credentials to AuthenticationManager&lt;/SPAN&gt;

                        _areCredentialsRestored &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;true&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;

                        &lt;SPAN class="keyword token"&gt;foreach&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; crd &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;RetrieveAllSavedCredentials&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
                        &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
                            AuthenticationManager&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Current&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;AddCredential&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;crd&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
                        &lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;
                    &lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;
                &lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;
            &lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;
		&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;

		&lt;SPAN class="token preprocessor"&gt;#endregion&lt;/SPAN&gt;

		&lt;SPAN class="token preprocessor"&gt;#region Constructor and Initialize&lt;/SPAN&gt;

		&lt;SPAN class="keyword token"&gt;public&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;IwaChallengeHandler&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
		&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
			&lt;SPAN class="token function"&gt;Initialize&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
		&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;

		&lt;SPAN class="keyword token"&gt;private&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;void&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;Initialize&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
		&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
			&lt;SPAN class="comment token"&gt;// Set up event handlers for when the user completes the login entry or cancels&lt;/SPAN&gt;
			LoginPageViewModel loginPageViewModel &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; _loginPage&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;BindingContext &lt;SPAN class="keyword token"&gt;as&lt;/SPAN&gt; LoginPageViewModel&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
			loginPageViewModel&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;OnLoginInfoEntered &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; LoginInfoEntered&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
			loginPageViewModel&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;OnCanceled &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; LoginCanceled&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
		&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;

        &lt;SPAN class="token preprocessor"&gt;#endregion&lt;/SPAN&gt;


        &lt;SPAN class="comment token"&gt;/// &amp;lt;summary&amp;gt;&lt;/SPAN&gt;
        &lt;SPAN class="comment token"&gt;/// Retrieves all EpochField credentials&lt;/SPAN&gt;
        &lt;SPAN class="comment token"&gt;/// &amp;lt;/summary&amp;gt;&lt;/SPAN&gt;
        &lt;SPAN class="comment token"&gt;/// &amp;lt;returns&amp;gt;IEnumerable&amp;lt;Credential&amp;gt;&amp;lt;/returns&amp;gt;&lt;/SPAN&gt;
        &lt;SPAN class="keyword token"&gt;internal&lt;/SPAN&gt; IEnumerable&lt;SPAN class="operator token"&gt;&amp;lt;&lt;/SPAN&gt;Credential&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;RetrieveAllSavedCredentials&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
        &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
            &lt;SPAN class="keyword token"&gt;return&lt;/SPAN&gt; CredentialManager&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;RetrieveAll&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
        &lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;

        &lt;SPAN class="keyword token"&gt;public&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;async&lt;/SPAN&gt; Task&lt;SPAN class="operator token"&gt;&amp;lt;&lt;/SPAN&gt;Credential&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;CreateCredentialAsync&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;CredentialRequestInfo info&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
		&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
			&lt;SPAN class="comment token"&gt;// Ignore challenges for OAuth (might come from secured layers in public web maps, for example).&lt;/SPAN&gt;
			&lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;info&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;AuthenticationType &lt;SPAN class="operator token"&gt;!=&lt;/SPAN&gt; AuthenticationType&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;NetworkCredential&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
			&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
				Console&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;WriteLine&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;"Authentication for "&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; info&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;ServiceUri&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Host &lt;SPAN class="operator token"&gt;+&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;" skipped."&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
				&lt;SPAN class="keyword token"&gt;return&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;null&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
			&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;

			&lt;SPAN class="comment token"&gt;// Return if authentication is already in process&lt;/SPAN&gt;
			&lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;_loginTaskCompletionSrc &lt;SPAN class="operator token"&gt;!=&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;null&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;&amp;amp;&amp;amp;&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;!&lt;/SPAN&gt;_loginTaskCompletionSrc&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Task&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;IsCanceled&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
			&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
				&lt;SPAN class="keyword token"&gt;return&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;null&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
			&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;

			&lt;SPAN class="comment token"&gt;// Create a new TaskCompletionSource for the login operation&lt;/SPAN&gt;
			&lt;SPAN class="comment token"&gt;// (passing the CredentialRequestInfo object to the constructor will make it available from its AsyncState property)&lt;/SPAN&gt;
			_loginTaskCompletionSrc &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;new&lt;/SPAN&gt; &lt;SPAN class="token class-name"&gt;TaskCompletionSource&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;lt;&lt;/SPAN&gt;Credential&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;info&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;

            &lt;SPAN class="comment token"&gt;// Show the login controls on the UI thread&lt;/SPAN&gt;
            &lt;SPAN class="comment token"&gt;// OnLoginInfoEntered event will return the values entered (username, password, and domain)&lt;/SPAN&gt;

            ArcGISNetworkCredential iwaCred &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; AuthenticationManager&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Current&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;FindCredential&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;info&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;ServiceUri&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; AuthenticationType&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;NetworkCredential&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;as&lt;/SPAN&gt; ArcGISNetworkCredential&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;

            &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;iwaCred &lt;SPAN class="operator token"&gt;!=&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;null&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
            &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
                _loginTaskCompletionSrc&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;TrySetResult&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;iwaCred&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
            &lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;
			&lt;SPAN class="keyword token"&gt;else&lt;/SPAN&gt;
            &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
                Device&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;BeginInvokeOnMainThread&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="keyword token"&gt;async&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;await&lt;/SPAN&gt; App&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Current&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;MainPage&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Navigation&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;PushAsync&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;_loginPage&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
            &lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;

			&lt;SPAN class="comment token"&gt;// Return the login task, the result will be ready when completed (user provides login info and clicks the "Login" button)&lt;/SPAN&gt;
			&lt;SPAN class="keyword token"&gt;return&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;await&lt;/SPAN&gt; _loginTaskCompletionSrc&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Task&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
		&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;

		&lt;SPAN class="token preprocessor"&gt;#region Event Handlers&lt;/SPAN&gt;

		&lt;SPAN class="comment token"&gt;// Handle the OnLoginEntered event from the login UI&lt;/SPAN&gt;
		&lt;SPAN class="comment token"&gt;// LoginEventArgs contains the username, password, and domain that were entered&lt;/SPAN&gt;
		&lt;SPAN class="keyword token"&gt;private&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;void&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;LoginInfoEntered&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="keyword token"&gt;object&lt;/SPAN&gt; sender&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; LoginDialogEventArgs e&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
		&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
			&lt;SPAN class="comment token"&gt;// Make sure the task completion source has all the information needed&lt;/SPAN&gt;
			&lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;_loginTaskCompletionSrc &lt;SPAN class="operator token"&gt;==&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;null&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;||&lt;/SPAN&gt;
				_loginTaskCompletionSrc&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Task &lt;SPAN class="operator token"&gt;==&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;null&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;||&lt;/SPAN&gt;
				_loginTaskCompletionSrc&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Task&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;AsyncState &lt;SPAN class="operator token"&gt;==&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;null&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
			&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
				&lt;SPAN class="keyword token"&gt;return&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
			&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;

			&lt;SPAN class="keyword token"&gt;try&lt;/SPAN&gt;
			&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
				&lt;SPAN class="comment token"&gt;// Get the associated CredentialRequestInfo (will need the URI of the service being accessed)&lt;/SPAN&gt;
				CredentialRequestInfo requestInfo &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; _loginTaskCompletionSrc&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Task&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;AsyncState &lt;SPAN class="keyword token"&gt;as&lt;/SPAN&gt; CredentialRequestInfo&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;

				&lt;SPAN class="comment token"&gt;// Create a new network credential using the values entered by the user&lt;/SPAN&gt;
				&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; networkCredential &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;new&lt;/SPAN&gt; &lt;SPAN class="token class-name"&gt;System&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Net&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;NetworkCredential&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;e&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Username&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; e&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Password&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; e&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Domain&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;

				&lt;SPAN class="comment token"&gt;// Create a new ArcGIS network credential to hold the network credential and service URI&lt;/SPAN&gt;
				&lt;SPAN class="keyword token"&gt;var&lt;/SPAN&gt; arcgisCredential &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;new&lt;/SPAN&gt; &lt;SPAN class="token class-name"&gt;ArcGISNetworkCredential&lt;/SPAN&gt;
				&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
					Credentials &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; networkCredential&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;
					ServiceUri &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; requestInfo&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;ServiceUri
				&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;

                &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;AllowSaveCredentials&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
                &lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
                    CredentialManager&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;AddCredential&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;arcgisCredential&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
                &lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;

                &lt;SPAN class="comment token"&gt;// Set the task completion source result with the ArcGIS network credential&lt;/SPAN&gt;
                &lt;SPAN class="comment token"&gt;// AuthenticationManager is waiting for this result and will add it to its Credentials collection&lt;/SPAN&gt;
                _loginTaskCompletionSrc&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;TrySetResult&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;arcgisCredential&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
			&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;
			&lt;SPAN class="keyword token"&gt;catch&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="token class-name"&gt;Exception&lt;/SPAN&gt; ex&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
			&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
				&lt;SPAN class="comment token"&gt;// Unable to create credential, set the exception on the task completion source&lt;/SPAN&gt;
				_loginTaskCompletionSrc&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;TrySetException&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;ex&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
			&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;
			&lt;SPAN class="keyword token"&gt;finally&lt;/SPAN&gt;
			&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
				&lt;SPAN class="comment token"&gt;// Dismiss the login controls&lt;/SPAN&gt;
				App&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Current&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;MainPage&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Navigation&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;PopAsync&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
			&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;
		&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;

		&lt;SPAN class="keyword token"&gt;private&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;void&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;LoginCanceled&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="keyword token"&gt;object&lt;/SPAN&gt; sender&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; EventArgs e&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
		&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
			&lt;SPAN class="comment token"&gt;// Dismiss the login controls&lt;/SPAN&gt;
			App&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Current&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;MainPage&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Navigation&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;PopAsync&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;

			&lt;SPAN class="comment token"&gt;// Cancel the task completion source task&lt;/SPAN&gt;
			_loginTaskCompletionSrc&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;TrySetCanceled&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
		&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;

		&lt;SPAN class="token preprocessor"&gt;#endregion&lt;/SPAN&gt;

		&lt;SPAN class="keyword token"&gt;public&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;void&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;Reset&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
		&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
			_loginTaskCompletionSrc &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;null&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
		&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;
	&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;
&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&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PAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 07:48:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/iwa-portal-login-and-feature-service-access/m-p/141660#M1600</guid>
      <dc:creator>AndyWright</dc:creator>
      <dc:date>2021-12-11T07:48:11Z</dc:date>
    </item>
    <item>
      <title>Re: IWA Portal Login and Feature Service Access</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/iwa-portal-login-and-feature-service-access/m-p/141661#M1601</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Certainly a lot more involved than what I have ever done.&amp;nbsp; This is the very basic approach when I save a User/Password in configuration so things work on machines not attached to the domain (mainly because my test environment is often not on the domain of the Portal but the Portal uses Windows Auth)&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;private&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;async&lt;/SPAN&gt; Task&lt;SPAN class="operator token"&gt;&amp;lt;&lt;/SPAN&gt;TokenCredential&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;GetWindowsCredential&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
	Uri sharingUri &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;new&lt;/SPAN&gt; &lt;SPAN class="token class-name"&gt;Uri&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;$&lt;SPAN class="string token"&gt;"{Settings.PortalUrl}/sharing/rest"&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
	TokenCredential credential&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;

	&lt;SPAN class="keyword token"&gt;try&lt;/SPAN&gt;
	&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
		&lt;SPAN class="comment token"&gt;//Assume that IWA is turned on on machine&lt;/SPAN&gt;
		credential &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;await&lt;/SPAN&gt; AuthenticationManager&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Current&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;GenerateCredentialAsync&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;sharingUri&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;""&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;""&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
	&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;
	&lt;SPAN class="keyword token"&gt;catch&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="token class-name"&gt;Exception&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
	&lt;SPAN class="punctuation token"&gt;{&lt;/SPAN&gt;
		&lt;SPAN class="comment token"&gt;//if failed then use provided user and password - testing also requires&lt;/SPAN&gt;
		&lt;SPAN class="comment token"&gt;// user name muust be in form: user@DOMAINNAME&lt;/SPAN&gt;
		credential &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;await&lt;/SPAN&gt; AuthenticationManager&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Current&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;GenerateCredentialAsync&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;sharingUri&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; Settings&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;WindowsUser&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; Settings&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;WindowsPwd&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
	&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;

	&lt;SPAN class="keyword token"&gt;return&lt;/SPAN&gt; credential&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="punctuation token"&gt;}&lt;/SPAN&gt;‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I do the same in another app (it is WPF not Xamarin though) that uses a form to get user input.&amp;nbsp; All done basically the same except for a little ditty to get the password:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="comment token"&gt;// _securePassword is SecureString&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;string&lt;/SPAN&gt; password &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;new&lt;/SPAN&gt; &lt;SPAN class="token class-name"&gt;NetworkCredential&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="keyword token"&gt;string&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Empty&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; _securePassword&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Password&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In WPF when the user enters into a password text box it gives you a&amp;nbsp;SecureString type.&amp;nbsp; I don't know if Xamarin is the same, but that's a way I figured to get a plain text string from the&amp;nbsp;SecureString object.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also there are some things that don't directly ask for Credential or have as a parameter but it is required.&amp;nbsp; The following does the trick for me in those cases&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;AuthenticationManager&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Current&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;AddCredential&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="keyword token"&gt;await&lt;/SPAN&gt; &lt;SPAN class="token function"&gt;GetWindowsCredential&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have never had issue with this.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;As a general rule I&amp;nbsp;will call into&amp;nbsp;GetWindowsCredential anytime I need a credential unless there is a significant performance concern and I am sure that I am using the saved Credential&amp;nbsp;over a short time.&amp;nbsp; But the token does expire and so if cached too long will no longer be valid&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hope that helps&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 07:48:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/iwa-portal-login-and-feature-service-access/m-p/141661#M1601</guid>
      <dc:creator>JoeHershman</dc:creator>
      <dc:date>2021-12-11T07:48:14Z</dc:date>
    </item>
    <item>
      <title>Re: IWA Portal Login and Feature Service Access</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/iwa-portal-login-and-feature-service-access/m-p/141662#M1602</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey Joe thanks for the reply.&amp;nbsp; I went ahead and tried the brute force approach and tried to generate a TokenCredential object from my user credentials right before generating an offline geodatabase from the feature service.&amp;nbsp; More or less doing it the same way you are, and I am currently getting a 401 error on that which is really strange.&amp;nbsp; We are now working with our network dude to see if something is wrong outside of our Portal implementation.&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 18 Mar 2019 22:17:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/iwa-portal-login-and-feature-service-access/m-p/141662#M1602</guid>
      <dc:creator>AndyWright</dc:creator>
      <dc:date>2019-03-18T22:17:23Z</dc:date>
    </item>
    <item>
      <title>Re: IWA Portal Login and Feature Service Access</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/iwa-portal-login-and-feature-service-access/m-p/141663#M1603</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Have you tried to log in from the device directly to the sharing web site using Windows credentials?&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Mar 2019 13:52:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/iwa-portal-login-and-feature-service-access/m-p/141663#M1603</guid>
      <dc:creator>JoeHershman</dc:creator>
      <dc:date>2019-03-20T13:52:00Z</dc:date>
    </item>
    <item>
      <title>Re: IWA Portal Login and Feature Service Access</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/iwa-portal-login-and-feature-service-access/m-p/141664#M1604</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I just tried that Joe and it worked fine.&amp;nbsp; Took my windows credentials and logged me in.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 20 Mar 2019 19:04:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/iwa-portal-login-and-feature-service-access/m-p/141664#M1604</guid>
      <dc:creator>AndyWright</dc:creator>
      <dc:date>2019-03-20T19:04:18Z</dc:date>
    </item>
    <item>
      <title>Re: IWA Portal Login and Feature Service Access</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/iwa-portal-login-and-feature-service-access/m-p/141665#M1605</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Just thinking if it was a Portal issue you would also have a problem logging in directly, so scratching my head a bit on what would be wrong&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 21 Mar 2019 16:53:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/iwa-portal-login-and-feature-service-access/m-p/141665#M1605</guid>
      <dc:creator>JoeHershman</dc:creator>
      <dc:date>2019-03-21T16:53:01Z</dc:date>
    </item>
    <item>
      <title>Re: IWA Portal Login and Feature Service Access</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/iwa-portal-login-and-feature-service-access/m-p/141666#M1606</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hey Joe.&amp;nbsp; So I am now able to get a token successfully in a WPF app, but continually get 401 errors with the same code in a Xamarin Forms app.&amp;nbsp; I feel like there is a small piece of the puzzle missing on the Forms side.&amp;nbsp; I believe you are right in saying it is not a Portal issue.&amp;nbsp; I'm wondering if it is something at the IIS level since the creds are passed through automatically in Windows and not in iOS or Android.&amp;nbsp; We've played around with a few settings and have had no luck so far.&amp;nbsp; We also have a Esri support ticket opened on this.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 28 Mar 2019 18:49:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/iwa-portal-login-and-feature-service-access/m-p/141666#M1606</guid>
      <dc:creator>AndyWright</dc:creator>
      <dc:date>2019-03-28T18:49:08Z</dc:date>
    </item>
    <item>
      <title>Re: IWA Portal Login and Feature Service Access</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/iwa-portal-login-and-feature-service-access/m-p/141667#M1607</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am only doing on an iOS emulator on a mac through Xamarin.&amp;nbsp; I am able to create the&amp;nbsp;credential and create a portal object with an IWA configured portal.&amp;nbsp; My portal is setup in AWS so not dealing with any additional security that an internal IT might be adding.&amp;nbsp; What I find really confusing in what you described is you are able to login to&amp;nbsp;the sharing API directly from a browser but not through your app, as far as I know these should both work the same in regards to passing credentials&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Mar 2019 15:46:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/iwa-portal-login-and-feature-service-access/m-p/141667#M1607</guid>
      <dc:creator>JoeHershman</dc:creator>
      <dc:date>2019-03-29T15:46:42Z</dc:date>
    </item>
    <item>
      <title>Re: IWA Portal Login and Feature Service Access</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/iwa-portal-login-and-feature-service-access/m-p/141668#M1608</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;We had a little breakthrough late yesterday.&amp;nbsp; We are now using straight REST API calls to get the token against the feature service and then applying that token to an ArcGISTokenCredential object.&amp;nbsp; We can supply that object to the geodatabase create and sync calls.&amp;nbsp; Seems like a franken-solution, but it's working so we're going with it for now.&amp;nbsp; There has to be a way to accomplish all this through the Runtime API, but we weren't able to put all the puzzle pieces together correctly for an IWA portal.&amp;nbsp; Thanks for all your input though Joe.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 29 Mar 2019 15:51:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/iwa-portal-login-and-feature-service-access/m-p/141668#M1608</guid>
      <dc:creator>AndyWright</dc:creator>
      <dc:date>2019-03-29T15:51:57Z</dc:date>
    </item>
  </channel>
</rss>

