AppStudio AuthenticationView using Google authentication causes error

389
3
Jump to solution
02-06-2019 10:24 AM
MattEnglish
Esri Contributor

When deployed to an actual device, the AuthenticationView does not work when a user tries to use Google to authenticate. Below is a screenshot of AppStudio Player working with one of the samples. Is there a workaround?

Thanks,

Matt

Tags (1)
0 Kudos
1 Solution

Accepted Solutions
ErwinSoekianto
Esri Regular Contributor

Hello Matt, 

We found that the AuthenticationView and OAuth2View from ArcGIS Runtime SDK for Qt "import Esri.ArcGISRuntime.Toolkit.Dialogs" is using Qt WebView "import QtWebView 1.1" that does not work with the Google login. 

AppStudio AppFramework WebView has solved this limitation from Qt WebView.  The workaround is to update the source code of the OAuth2View to use AppStudio AppFramework WebView instead of Qt WebView. 

I am showing the way to implement this workaround as if you are using our "OAuth + Biometric Authentication" sample because it can be reproducible on that sample. 

- Grab the source code of the AuthenticationView.qml and OAuth2View.qml from ArcGIS Runtime Toolkit Dialog installation. Under your AppStudio Installation folder.

- Add these to files into your project, I am adding these to the "controls" folder for OAuth sample. I renamed these files, by adding "New" to the file name, so that we can make sure that we are loading the updated files. 

- On OAuth2ViewNew.qml, comment out the "import QtWebView 1.1" statement and add "import ArcGIS.AppFramework.WebView 1.0"

- On AuthenticationViewNew.qml, line 116, change the "OAuth2View.qml" to load the new file "OAuth2ViewNew.qml"

- On the views/Profile.qml, line 274, make sure to load the new qml file AuthenticationViewNew instead

I tested this and it works on my side, let me know if this is working for you.

Thank you,

Erwin

View solution in original post

0 Kudos
3 Replies
ErwinSoekianto
Esri Regular Contributor

Hello Matt, 

We found that the AuthenticationView and OAuth2View from ArcGIS Runtime SDK for Qt "import Esri.ArcGISRuntime.Toolkit.Dialogs" is using Qt WebView "import QtWebView 1.1" that does not work with the Google login. 

AppStudio AppFramework WebView has solved this limitation from Qt WebView.  The workaround is to update the source code of the OAuth2View to use AppStudio AppFramework WebView instead of Qt WebView. 

I am showing the way to implement this workaround as if you are using our "OAuth + Biometric Authentication" sample because it can be reproducible on that sample. 

- Grab the source code of the AuthenticationView.qml and OAuth2View.qml from ArcGIS Runtime Toolkit Dialog installation. Under your AppStudio Installation folder.

- Add these to files into your project, I am adding these to the "controls" folder for OAuth sample. I renamed these files, by adding "New" to the file name, so that we can make sure that we are loading the updated files. 

- On OAuth2ViewNew.qml, comment out the "import QtWebView 1.1" statement and add "import ArcGIS.AppFramework.WebView 1.0"

- On AuthenticationViewNew.qml, line 116, change the "OAuth2View.qml" to load the new file "OAuth2ViewNew.qml"

- On the views/Profile.qml, line 274, make sure to load the new qml file AuthenticationViewNew instead

I tested this and it works on my side, let me know if this is working for you.

Thank you,

Erwin

0 Kudos
ErwinSoekianto
Esri Regular Contributor

Matt, 

Attached are the OAuth2View.qml and AuthenticationView.qml from the Esri ArcGIS Runtime Qt Toolkit.

Thank you,

Erwin

0 Kudos
MattEnglish
Esri Contributor

works like a charm!

Thank you, Matt