Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] print proxy blog post #369

Merged
merged 4 commits into from Feb 6, 2017
Merged

[WIP] print proxy blog post #369

merged 4 commits into from Feb 6, 2017

Conversation

stdavis
Copy link
Member

@stdavis stdavis commented Feb 2, 2017

This is just the first draft. Feedback is welcome.

This is most commonly used as a print service for web applications allowing the user to download a PDF of the current map extent.

### The Problem
AGRC's [base map services](https://gis.utah.gov/data/base-map-and-imagery/) (including the [Google imagery](https://gis.utah.gov/data/google-imagery-license/)) are hosted as WMTS services on `discover.agrc.utah.gov`. In order to use them an organization needs to [register](https://gis.utah.gov/data/base-map-and-imagery/) and request a quad word. To prevent unauthorized use they are each locked down to a specific domain or set of domains. So if someone tries to use your quad word from any other domain or server the request is blocked. This all works well until you send a web map to the PrintingTools service in ArcGIS Server. The web map contains URL's to discover services that have quad words locked down to your web app's domain. When the service requests tiles, it does so from the server that is hosting the service not the browser. This causes discover to reject the request because the origin of the request does not match what the quad word is locked down to.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

any link to within gis.utah.gov should use a relative url and the liquid templating with the base url. See the readme for examples.


_Why don't I just use a wide open quad word in the first place?_ That's a great question. I'm glad you asked! Using wide open quad words in web applications would violate the [Organizational Usage Agreement](https://docs.google.com/a/utah.gov/forms/d/e/1FAIpQLScL5uUQIvw7op_ZcF4bijxcoOMGhNF0MXwJNGqSXS6IbjbKhA/viewform). It would be very easy for a savvy web developer to get your quad words and use them on their own site.

AGRC's print proxy service is open source and available for download and deployment to your own servers from: https://github.com/agrc/print-proxy. Feedback and pull requests are welcome.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would make this a hyperlink?

@steveoh
Copy link
Member

steveoh commented Feb 2, 2017

Not bad!
image

Copy link
Member

@steveoh steveoh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fix up the links and if you want to fool with http://www.hemingwayapp.com/ go for it. Otherwise I think this is pretty cool

### The Solution
To work around this issue AGRC developed a [print-proxy geoprocessing service](https://github.com/agrc/print-proxy). This service accepts the same parameters as Export Web Map with the addition of `ExportWebMapService_URL` which defines the Export Web Map Service that you want to proxy to. Then within the service, it simply switches out your locked down quad-word for a wide open one and passes the request onto the URL defined in `ExportWebMapService_URL`.

_Why don't I just use a wide open quad word in the first place?_ That's a great question. I'm glad you asked! Using wide open quad words in web applications would violate the [Organizational Usage Agreement](https://docs.google.com/a/utah.gov/forms/d/e/1FAIpQLScL5uUQIvw7op_ZcF4bijxcoOMGhNF0MXwJNGqSXS6IbjbKhA/viewform). It would be very easy for a savvy web developer to get your quad words and use them on their own site.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it is a good idea to not tell people what they can do with the unregulated quad word. We don't need to give people ideas but this benign use case seems acceptable.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So I'm not clear; should I remove this sentence?

layout: post
status: publish
published: true
title: 'Using discover.agrc.utah.gov Services PrintingTools/Export Web Map Service'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should shorten this title to something like 'Printing Web Maps with Discover Services'

email: stdavis@utah.gov
date: 2017-02-02 21:04:30
categories:

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add the - Developer category

change title
add category
fix relative links
if at first you don't succeed...
@stdavis
Copy link
Member Author

stdavis commented Feb 3, 2017

OK. This looks good to me. I'd just like to get this reviewed by @rkelson before it gets merged...

@steveoh steveoh merged commit c4ad8b7 into master Feb 6, 2017
@steveoh steveoh deleted the print-proxy branch February 6, 2017 20:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants