Pass credentials to WebView?

299
1
09-28-2022 05:16 PM
GeneVaatveit
New Contributor

My app embeds a WebView which is used to open an ArcGIS Hub.  Hub requires the user to sign in.  The first step in the app is for the user to enter name and password, which are then authenticated with AGOL, returning a token.  Is it possible to supply these credentials to the WebView showing Hub, so that the user is automatically signed in to Hub without having to AGAIN enter name and password?

0 Kudos
1 Reply
TrevorFrame
Esri Contributor

Hi @GeneVaatveit ,

It is possible with some effort. Take a look at the Sidebar template and under /utility/Portal see how OAuth2View.qml uses a WebView and AuthenticationController that uses AuthenticationManager. You may need to store username and password locally during first authentication and use it for the second one. 

Best,

Trevor

0 Kudos