Select to view content in your preferred language

IWA Portal Login and Feature Service Access

3697
12
03-14-2019 11:26 AM
AndyWright
Frequent Contributor

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.  We have been using oAuth based authentication for years and now have customers implementing IWA based Portals and need to support that.  

To get the login going I am using the ArcGISNetworkCredential.  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.  I've got that all working well.

We have a couple of tools that utilize feature services to create offline geodatabases to support field work.  When I try to generate those offline geodatabases using the ArcGISNetworkCredential I am getting an error that a token is required.  Makes sense.  Problem is the ArcGISNetworkCredential does not have a token associated with it. 

I then switched gears and attempted to use the ArcGISTokenCredential for everything - logging into the portal and generating geodatabases from feature services.  No luck there - could not get that to work for logging in.

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.  I have not found anything that addresses our particular scenario though.  I feel like I'm close on this and am missing a small piece of the puzzle.

Can someone point me in the right direction?  Thanks!

0 Kudos
12 Replies
AndyWright
Frequent Contributor

Hey Joe.  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.  I feel like there is a small piece of the puzzle missing on the Forms side.  I believe you are right in saying it is not a Portal issue.  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.  We've played around with a few settings and have had no luck so far.  We also have a Esri support ticket opened on this.  

0 Kudos
JoeHershman
MVP Regular Contributor

I am only doing on an iOS emulator on a mac through Xamarin.  I am able to create the credential and create a portal object with an IWA configured portal.  My portal is setup in AWS so not dealing with any additional security that an internal IT might be adding.  What I find really confusing in what you described is you are able to login to 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

Thanks,
-Joe
0 Kudos
AndyWright
Frequent Contributor

We had a little breakthrough late yesterday.  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.  We can supply that object to the geodatabase create and sync calls.  Seems like a franken-solution, but it's working so we're going with it for now.  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.  Thanks for all your input though Joe.

0 Kudos