Select to view content in your preferred language

App authentication for unreal sdk

106
1
Monday
hazemfayyad86
New Contributor

at the moment, to access private content, we need to either use API key, or User Authentication, the API key option is not supported for arc gis enterprise 11.3 and the user authentication required the user to login to arc gis everytime the solution runs, this is quite frustrating for the users in the application, 

there is another option to use app authentication, exchanging client id and client secret for the short lived access token, this is the ideal scenario for us since it happens in the background without requiring the user to login with his username and password, but its not supported by unreal sdk.

we tried multiple things to try and override the login screen but the sdk uses it with private code that exchanges the authorisation key obtained by the login screen for an access code so we cant by pass it, we tried to persist the crediential store and reload it afterwards but aging a lot of private code that we cant access or override,

 

is there a way to use app authentication with unreal sdk, or by pass the login screen and provide the sdk with the access toekn obtained by using the API 

 

https://www.arcgis.com/sharing/rest/oauth2/token?client_id=****&client_secret=****&grant_type=client...

0 Kudos
1 Reply
AShahbaz
Esri Contributor

Hi, 

I am not aware of any immediate plans for adding App Authentication support. But feel free to request it with a post in the ideas page for more visibility. 

You should be able to implement a persist workflow with the currently public code. The `ArcGISCredential` class implements `ToJSON()` and `FromJSON()` methods that you could use for that (added in version 2.1). Note that the generated json is cleartext and you would encrypt and store it based on the security requirements of your project and the utilized platform.  

You could, for example, store all the credentials in the CredentialStore at the end of a session and deserialize them and add them back to the store at the beginning of the next session. You should not be prompted to login if the credential store has a valid credential for the requested service. 

You could also bypass the login page and handle the authentication challenge differently. The handler that we provide for the login prompt is a sample code and you can implement your own class, inheriting from `ArcGISOAuthUserLoginPromptHandler`, and use the `USampleAuthenticationHandlerInitializer` component (or a similar script) to assign it as the handler when the user is supposed to be prompted to login. I haven't tried this, but maybe instead of opening a browser, you are able to obtain an authorization code through some other means and provide it in response to the login prompt. 

Hope this helps. 

0 Kudos