make PortalUser sample Info template work with google and facebook

94
1
05-26-2022 11:14 AM
LabrecqueBruno
New Contributor

I am trying to implement arcgis portal login (allowing facebook, google and apple identity) to my ArcGIS AppStudio app.  I first start with PortalUser sample out of the box template (New, Model, search for PortalUser)

in the settings (licence), i add a licence and i register the apps

i check the client id on line 291 of MyApp.qml have the same id as the regitered apps on my ArcGIS OnLine Account.

I then publish the application to my arcgis online account and search for «clientid» in the parameter tab.  I found also that the redirect url is set to urn:ietf:wg:oauth:2.0:oob as it supposed to according to AppStudio doc.  

I even try do compile the app to apk and install the apk on an android device.

in both case (players or apk), when i run it, if i connect to a pure ArcGIS OnLine accout, everything is working as it should.

But if i try to connect to ArcGIS OnLine via third authentication (apple, GitHub, Google), it does not work, I got a 403 error or a Denied error=invalid_request

I am based on the latest AppStudio 5.3

When i run the apps into the appstudio simulator on my computer, everything is working well even with third party authentication, so i can authenticate with google or apple account and recover email adress of the authenticated user.  

Since i am running a unmodified template send with Appstudio installation, the sample should work and the configuration step should be detailed. Am i missing a step? why this simple template does not work when published or compiled to apk

 

Tags (2)
0 Kudos
1 Reply
TrevorFrame
Esri Contributor

Hi @LabrecqueBruno,

Thank you for bringing this to our attention. After further investigation, I found this is an issue with the ArcGIS Runtime Toolkit AuthenticationView component used within the sample you're referring. The AuthenticationView is using an embedded webview which Google and Facebook are now blocking. An issue has been submitted regarding this. 

In the meantime, you may refer to some of our other templates such as Map Viewer (5.3) which uses our AppStudio AppFramework WebView component which works with Google and Facebook OAuth 2.0. If viewing Map Viewer template, navigate into the /MapView/views/AuthenticationView.qml file to start which will use other views in the same directory such as OAuth2Views.qml.

Best,

Trevor

0 Kudos