Select to view content in your preferred language

Web AppBuilder with private map ask for login

3047
11
12-07-2018 06:03 AM
GuilhermePigosso
Emerging Contributor

Hello,

I have a WebApp Application that I created using the Web AppBuilder, that point to a private map under my organization.

My goal with this is be able to open the WebApp without login, but I is not working.

My proxy (I'm using the Java implementation) configuration is:

<serverUrl url="https://org.maps.arcgis.com"
   matchAll="true"
   clientId="XXXXXXXXXXX"
   clientSecret="ZZZZZZZZZZZZZZZZZ"
   username="user"
   password="pass"
   tokenServiceUri="https://org.maps.arcgis.com/sharing/rest/generateToken"
/>

The Proxy seems that is working fine, but, when I try to open the WebApp I a box like this before see the WebApp:

Does anyone have any know what I am missing here?

Thank you in advance!

0 Kudos
11 Replies
RobertScheitlin__GISP
MVP Emeritus

Guilherme,

  Did you add your proxy url to your apps main config.json?

Also you normally use username and password OR clientId and clientSecret.

0 Kudos
GuilhermePigosso
Emerging Contributor

Robert,

About the first question, yes, my config.json is like:

"portalUrl": "https://org.maps.arcgis.com",
"appId": "123123123",
"authorizedCrossOriginDomains": [],
"title": "Web App",
"subtitle": "",
"keepAppState": true,
[...]
"map": {
   "3D": false,
   "2D": true,
   "position": {
      "left": 0,
      "top": 40,
      "right": 0,
      "bottom": 0
   },
   "itemId": "0addc56a7a7e488c882f24940a981774",
   "mapOptions": {},
   "id": "map",
   "portalUrl": "https://org.maps.arcgis.com/",
   "appProxy": {
   "mapItemId": "0adtc56a7a7e421c832f24940a981724",
   "proxyItems": []
   }
},
[...]
"httpProxy": {
   "useProxy": true,
   "alwaysUseProxy": false,
   "url": "https://localhost:8080/Proxy/proxy.jsp",
   "rules": []
},

I tried removing user/pass and using only client/secret, and also tried with the opposite, but still same issue.

Thank you.

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

I personally use the .Net version but here is how I always have it:

config.json:

"httpProxy": {
   "useProxy": true,
   "alwaysUseProxy": false,
   "url": "https://machinename/Proxy/proxy.ashx",
   "rules": []
},

I Never use localhost in my development.

In the proxy.config

<serverUrl url="https://blah.maps.arcgis.com" clientId="***" clientSecret="***" matchAll="true" /><serverUrl url="http://blah.maps.arcgis.com" clientId="***" clientSecret="***" matchAll="true" />‍‍‍

Notice I do not use tokenServiceUri and I list https and http

GuilhermePigosso
Emerging Contributor

Hello,

I'm sorry for take so much time to reply. I tested and still the same issue. Also, I followed the link (https://community.esri.com/groups/technical-support/blog/2015/10/28/setting-up-a-proxy-with-web-appb...) and no lucky. After sometime digging the ESRI docs, I found these text about autentication:

Tokens obtained by applications can only read public content and services. Although you cannot use an App login with private content, if your goal is to distribute or sell an app to organizations without ArcGIS Online (no named users), you may control access to your content by using your own login mechanism (I.e. Identity) to the app.

So, I don't have my own ArcGIS server. I'm using ArcGIS Online with my organization trying to show a private map inside a webmap. Do you think that this can be the issue and, maybe, the reason why I have this forced login always?

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Guilherme,

   When accessing your organization (just to see your content, Not a specific secured content) are you asked to login? For example if you gave me your orgs url will it ask me to login before I can view your orgs content?

0 Kudos
GuilhermePigosso
Emerging Contributor

Robert,

No, you can't see my organization if you don't login. It will require you to login.

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Guilherme,

  Can you change your orgs security setting to "Allow anonymous access to your organization's website', just for testing and see if that makes a difference?

0 Kudos
GuilhermePigosso
Emerging Contributor

Robert,

Did not work too, but I guess that is because the map is not sharing public. Sharing it public work as expected, but is not something that we would like to do.

0 Kudos
GuilhermePigosso
Emerging Contributor

Hey Robert,

I did some changes in my Proxy and, at least, changed the error. I'm facing an error 500 when try to get a fresh token for my user. The weird part is that calling the method on Postman works fine. Any idea about it?

Thank you.

0 Kudos