OAuth Coding Examples

The following sections provide quick start examples of using OAuth in various common programming languages. BOSS is providing this information to help you get up and running quickly with your BOSS Geo implementations. Below are some self-serve samples that have been contributed by the BOSS User Community.

Note

Please make sure to insert the correct value for "ADD YOUR KEY HERE" and "ADD YOUR SECRET HERE" in the appropriate places in the code examples below.

Note

All code samples below are adapted from original contributions. Contributors are noted.

PHP Example

  1. Sign up for OAuth application through http://developer.yahoo.com.
  2. Download the PHP OAuth Library from http://oauth.net/code. This is where you can retrieve the required OAuth.php file displayed below.
  3. Create a php script based on this example updating the $cc_key with your Consumer Key and the $cc_secret with your Consumer Secret:
PlaceFinder Example

These example code snipets are presented here for your use in your code. You can copy and paste from this section. Remember to change the key values, parameters, and any variables to make this snippet work with your BOSS Geo implementations.

PlaceSpotter Example

These example code snipets are presented here for your use in your code. You can copy and paste from this section. Remember to change the key values, parameters, and any variables to make this snippet work with your BOSS Geo implementations.

Perl Example

Perl*

Perl 5.8+

Location: http://www.perl.org/get.html

extra mods:

http://search.cpan.org/dist/Net-OAuth/

http://search.cpan.org/dist/LWP-Protocol-socks/

http://search.cpan.org/~makamaka/JSON-2.53/lib/JSON.pm

* Specific CPAN Modules are required. Please see the code for required modules.

Ruby Example

Example: example.rb

Ruby

oauth_util.rb

Location: https://gist.github.com/383159

License: https://gist.github.com/375593

C# Example

Example: boss_test.cs

C#

Location: http://oauth.googlecode.com/svn/code/csharp/OAuthBase.cs

License: Unknown

Contributor: Bryan Meverovich

Java Example

Example: SignPostTest.java

Example: StHTTPRequest.java

Java

SignPost

Location: http://code.google.com/p/oauth-signpost/

License: http://www.apache.org/licenses/LICENSE-2.0

Contributor: David Hardtke

Apache Logger

Location: http://logging.apache.org/log4j/1.2/download.html

License: http://logging.apache.org/log4j/1.2/license.html

Node.JS Example

Example: Node.JS

BOSS Geo Node.JS Library

Location: - Mikel Cavia has put together a library to use BOSS Geo using Node.JS. Learn more on github.

Contributor: Heber Allred (edited by BOSS Team) and Mikel Cavia

Table of Contents