Hi all
I am currently developping a MFC application that loads html and javascript code, using the Arcgis javascript api (4.17), to display a map, where I am adding feature and graphic layers. I must as well add that I am not using the ArcGIS Web AppBuilder. All good until now and I want now to upload these data/feature layers on a specific proprietary Arcgis portal. The authentication pattern I am trying to develop is the named user login workflow.
I tried thus to follow this tutorial and use the code provided by it: https://developers.arcgis.com/javascript/latest/sample-code/identity-oauth-basic/index.html
My application is registered on the proprietary Arcgis account and I have its client/application ID.
As many, I have this "redirect_uri" error displayed when I am launching my application and try to sign in, and even when I am naively double click on the unmodified identity-oauth-basic.html file provided by the aforementioned tutorial. Following that, I got a bit confused with what I can find on the net to solve this problem.
From what I gathered from the net, I understand that I need to specify on the Arcgis portal the URL of the page users of my app are redirected to after they successfully log in.
But in my case, everything is local and I am basically embedding a html file through my application. Thus I don't know what to specify as a "redirect url" in the "Authentication" pane of the registered application on the Arcgis account.
I tried to add "http://localhost/" and "https://localhost/" as some tutorials and forum posts may specify it, but the problem is still here. I wouldn't actually know what I should type in a web browser to point to my html file, except from its absolute path.
I added as well as a "redirect url" the address I am specifying in my OAuthInfo instance. Here as well I am getting confused about the different specified urls. The proprietary portal url I am trying to work with has the following format: https://<company name>.maps.arcgis.com. But some urls are specified with the '/arcgis' (redirects to a non-found page in my case) at the end and the aforementioned tutorial is even adding the '/sharing' extension (redirects to a page where I can be redirected to the Arcgis API reference). What are the conventions here and what should I use in my OAuthInfo instance and on the application authentication settings?
Can someone clarify these different points and help move forward with this authentication problem? Thanks a lot in advance.