Select to view content in your preferred language

AWS S3 hosted Web AppBuilder app proxy question

1786
2
Jump to solution
04-03-2018 01:51 PM
by Anonymous User
Not applicable

Is it possible to use AWS S3 to host a custom WAB site that automatically authenticates with a logged in AGOL account? I'm not sure how to set up a proxy in the AWS S3 environment (if it is even possible).

I'm afraid that S3 is only for "static" content, and the proxy would need to be running as a .NET, Java, or PHP app, correct? Is there any work around for this, or am I forced to use an AWS EC2-based web server, just to support the proxy requirement?

Ideally, I'd like to host a custom Web AppBuilder site on AWS S3, and allow authenticated AGOL users (who are currently logged in to AGOL) to automatically be granted access to the custom WAB site. Since these are cross-domain sites, the AGOL credentials don't automatically get passed to the WAB site on AWS S3.

The ultimate workflow is to have an AGOL-based story map with links to launch a custom WAB site (hosted elsewhere) and not require a second login (using SSO).

I've reviewed these other similar threads, but nothing exactly like what I'm trying to do with AWS S3.

Authentication through ArcGIS Online for customized Web Apps 

Second login prompts while authenticating arcgis online with oAuth 

This thread seems to have a solution / walk through if I decide to use an EC2 virtual machine as a web server:
https://community.esri.com/thread/121212 

I'd just rather avoid needing a "real" web server at all...

1 Solution

Accepted Solutions
by Anonymous User
Not applicable

Part of my answer may lie here:
Hosting a Static Website on Amazon S3 - Amazon Simple Storage Service 

"Amazon S3 does not support server-side scripting."

I'm thinking that I will at least need to have a small custom proxy script (using the Esri proxy app) running on a small, light-weight server to make this work. I _could_ perhaps still keep my static code logic (HTML, CSS, and JavaScript) on S3 and open a CORS exception to the proxy server location. It is convenient to use the S3 sync CLI command to update content quickly after a successful build...

I looked into using the AGOL cookies or using browser localstorage or sessionstorage objects, but these are tied to the source domain (arcgis.com) and are inaccessible to my custom app S3 location (as it should be for any real security).

So if I _do_ need to integrate with AGOL as the initial entry point of the combined application (from a project overview Story Map on AGOL), then I will need to use a server proxy app running on a .NET, Java, or PHP enabled server. S3 alone cannot do this. I'm leaning toward trying a simple Linux/Apache server to make this happen.

I'd love to be proven wrong if there is any alternative...

 

View solution in original post

2 Replies
by Anonymous User
Not applicable

And to be clear, the AWS S3 custom WAB content _does_ work, but it just prompts for an AGOL credential (even if a user is already logged into AGOL in another browser tab, or if the user routes from an AGOL story map app URL link to the custom (cross-domain) S3-hosted WAB site.

The proxy is the key, I'm sure, but I'm just not certain if this is possible with AWS S3-hosted web content.

0 Kudos
by Anonymous User
Not applicable

Part of my answer may lie here:
Hosting a Static Website on Amazon S3 - Amazon Simple Storage Service 

"Amazon S3 does not support server-side scripting."

I'm thinking that I will at least need to have a small custom proxy script (using the Esri proxy app) running on a small, light-weight server to make this work. I _could_ perhaps still keep my static code logic (HTML, CSS, and JavaScript) on S3 and open a CORS exception to the proxy server location. It is convenient to use the S3 sync CLI command to update content quickly after a successful build...

I looked into using the AGOL cookies or using browser localstorage or sessionstorage objects, but these are tied to the source domain (arcgis.com) and are inaccessible to my custom app S3 location (as it should be for any real security).

So if I _do_ need to integrate with AGOL as the initial entry point of the combined application (from a project overview Story Map on AGOL), then I will need to use a server proxy app running on a .NET, Java, or PHP enabled server. S3 alone cannot do this. I'm leaning toward trying a simple Linux/Apache server to make this happen.

I'd love to be proven wrong if there is any alternative...