GatekeeperTester web service tutorial


Examples

The command line utility curl will be used to illustrate the following examples.


This service exists for testing the Gatekeeper

Intial Authentication Command

curl -c cookiejar.txt --user uid=ucarroll,o=LTER,dc=ecoinformatics,dc=org:mouse -G https://pasta.lternet.edu/test/

Description

This command requests that the Gatekeeper create a new token to be returned as a cookie when the request completes. This will then be written to the cookie store cookiejar.txt for future use. The user is encouraged to use uid=ucarroll,o=LTER,dc=ecoinformatics,dc=org and corresponding password for testing. Should an invalid username or password be used, an appropriate response will be generated indicating such.

The response from the Gatekeeper depends on the nature of the submitted request, but the Set-Cookie: header should show a Base 64 encoded string has been returned.

HTTP/1.1 200 OK
Date: Thu, 22 Dec 2011 19:07:50 GMT
Set-Cookie: auth-token="sz46tDcFxqLby2TtlBARREdqGFSSRFbjSHPvMw0hgXLsG2uGlDWrOzjf/zM7Yd7g4n8pK5qKzohvP9UdYqf/xyx/RBAUU1QYwmUXTA5NnUZ5qHjYCtx3Y+DgwyNsQPoz6dQqR92BWWsWb39BilwfaYGtyAtiztJ0ZK4mx3c94VY9HTXmhfbuMzAErLo437zvX4IZDSHWMWNXYMuxC3eQ+A==";Version=1;Expires=Fri, 12-Dec-2053 14:20:40 GMT;Max-Age=1324581170
Expires: Thu, 01 Jan 1970 00:00:00 GMT
Server: Apache-Coyote/1.1
...

Omission of the --user <username>:<password> will result in public authentication.


Token Authentication Command

curl -b cookiejar.txt -G https://pasta.lternet.edu/test/

Description

This command requests that the Gatekeeper use a previously created token for the request. This token will be retreived from the cookiejar.txt and submitted appropriately.

The response from the Gatekeeper depends on the nature of the submitted request and should not include any headers or content indicating anything other than normal operation. If the token time to live has expired, a response will be generated to indicate so.

HTTP/1.1 200 OK
Date: Thu, 22 Dec 2011 19:07:50 GMT
Server: Apache-Coyote/1.1
...