Skip to main content

 

OCLC Support

Create search widgets to proxied resources

Use these instructions to create search widgets to proxied resources in EZproxy.

Overview

The /form URL allows you to place search forms on public web pages. It is similar to /login, except it expects to receive additional form variables which need to be sent to the remote database. When using the /form URL, the requests of local users are sent directly on to the remote database unproxied, whereas unauthenticated remote users are required to log in first, then their requests are sent on proxied to the database.

This method only works with remote search pages that support the get method for form processing, not the post method.

This document describes how to construct such a form for use with Google Scholar. It assumes that that Google Scholar has already been used to configure EZproxy for use with Google Scholar.

An example that does not work

At first glance, it might seem that this example would allow you to place a search form on a public page and it would operate in the manner described in the overview.

<form method="get"  action="http://ezproxy.yourlib.org:2048/login?url=http://scholar.google.com/scholar"> 
<input maxlength="256" size="40" name="q" value="">
<input type="submit" value="Search">
</form>

However, the EZproxy /login URL makes very specific assumptions about the information it will receive, and receiving arbitrary form variables such as "q" in this form is not one of these assumptions, causing that variable to be discarded and preventing this form from working as desired.

An example that does work

<form method="post"  action="http://ezproxy.yourlib.org:2048/form?qurl=http%3a%2f%2fscholar.google.com%2fscholar"> 
<input maxlength="256" size="40" name="q" value="">
<input type="submit" value="Search">
</form>

The HTML form tag in this new version has three key differences.

  1. The method has been changed from get to post. /form will only work correctly if you specify the post method. Even though you specify post here, when the request is finally sent to the remote server, it will always be sent to that server using the get method.
  2. In action, /login has been replaced by /form.
  3. The destination URL is no longer specified using url=http://scholar.google.com/scholar but instead is specified as qurl=http%3a%2f%2fscholar.google.com%2fscholar, using qurl= in place of url= and specifying the destination URL with URL escaped encoding. To apply URL escaped encoding to an arbitrary URL, EZproxy provides a /encodeurl URL that you can access with a URL similar to:
    http://ezproxy.yourlib.org:2048/encodeurl

    On the /encodeurl page, you provide the original URL, press enter, then you receive the escaped version to use following qurl=.

  4. Once you place this version of the form on a public page, both your local and remote users should be able to use it to perform searches, with local users required to authenticate but then proxied through to perform the search.

 

  • Was this article helpful?
https://help.oclc.org/Library_Management/EZproxy/EZproxy_configuration/Create_search_widgets_to_proxied_resources
help.oclc.org
crawl=CC-MAIN-2020-16
49157
application/http; msgtype=response
sha1:LHKKLH55OXGG3V3ZI3TEHEQEIOCJAKOC
<urn:uuid:c87419b9-3afe-4dfb-8a1b-d2c1b593b4af>
2020-04-09T23:22:43Z
52.85.151.74
text/html
sha1:CIUTFHNTJ4FXW3J6UDNTEQV7FYSYH4KX
<urn:uuid:f3af2c86-7fb7-439d-a3e1-b7fabd8ab810>
https://help.oclc.org/Library_Management/EZproxy/EZproxy_configuration/Create_search_widgets_to_proxied_resources
response
<urn:uuid:16d8ba2a-2dab-4823-852c-a8869ad20a4e>
isPartOf: CC-MAIN-2020-16
publisher: Common Crawl
description: Wide crawl of the web for March/April 2020
operator: Common Crawl Admin (info@commoncrawl.org)
hostname: ip-10-67-67-235.ec2.internal
software: Apache Nutch 1.16 (modified, https://github.com/commoncrawl/nutch/)
robots: checked via crawler-commons 1.1-SNAPSHOT (https://github.com/crawler-commons/crawler-commons)
format: WARC File Format 1.1
conformsTo: http://iipc.github.io/warc-specifications/specifications/warc-format/warc-1.1/