<?xml version="1.0" encoding="utf-8"?>
<!-- generator="FeedCreator 1.7.2-ppt DokuWiki" -->
<?xml-stylesheet href="http://rg42.org/lib/exe/css.php?s=feed" type="text/css"?>
<rdf:RDF
    xmlns="http://purl.org/rss/1.0/"
    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
    xmlns:dc="http://purl.org/dc/elements/1.1/">
    <channel rdf:about="http://rg42.org/feed.php">
        <title>rg42.org aka. Robin Gareus oss:oauth</title>
        <description></description>
        <link>http://rg42.org/</link>
        <image rdf:resource="http://rg42.org/lib/images/favicon.ico" />
       <dc:date>2010-09-07T02:23:19+00:00</dc:date>
        <items>
            <rdf:Seq>
                <rdf:li rdf:resource="http://rg42.org/oss/oauth/osx-static"/>
                <rdf:li rdf:resource="http://rg42.org/oss/oauth/start"/>
            </rdf:Seq>
        </items>
    </channel>
    <image rdf:about="http://rg42.org/lib/images/favicon.ico">
        <title>rg42.org aka. Robin Gareus</title>
        <link>http://rg42.org/</link>
        <url>http://rg42.org/lib/images/favicon.ico</url>
    </image>
    <item rdf:about="http://rg42.org/oss/oauth/osx-static">
        <dc:format>text/html</dc:format>
        <dc:date>2010-06-24T20:28:42+00:00</dc:date>
        <title>Statically link applications with liboauth on Darwin/OSX</title>
        <link>http://rg42.org/oss/oauth/osx-static</link>
        <description>


&lt;div class=&quot;level1&quot;&gt;

&lt;p&gt;

The result of the &lt;a href=&quot;http://groups.google.com/group/oauth/browse_thread/thread/a29bca0b08dba656/5b32fa7f12bbc74a?#5b32fa7f12bbc74a&quot; class=&quot;urlextern&quot; target=&quot;_blank&quot; title=&quot;http://groups.google.com/group/oauth/browse_thread/thread/a29bca0b08dba656/5b32fa7f12bbc74a?#5b32fa7f12bbc74a&quot;  rel=&quot;nofollow&quot;&gt;Google Group discussion&lt;/a&gt; on statically linking an application with &lt;a href=&quot;http://sourceforge.net/projects/liboauth&quot; class=&quot;interwiki iw_sf&quot; target=&quot;_blank&quot; title=&quot;http://sourceforge.net/projects/liboauth&quot;&gt;liboauth&lt;/a&gt; (and it&amp;#039;s dependent libraries) here&amp;#039;s a script that does it:
&lt;/p&gt;

&lt;p&gt;
&lt;a href=&quot;http://rg42.org/_media/oss/oauth/heath.sh&quot; class=&quot;media mediafile mf_sh&quot; title=&quot;oss:oauth:heath.sh&quot;&gt;Download script&lt;/a&gt;
&lt;/p&gt;
&lt;pre class=&quot;code&quot;&gt;
#!/bin/bash
TOPDIR=/tmp/oauth-static
test -d $TOPDIR &amp;#38;&amp;#38; rm -rf $TOPDIR
mkdir -p $TOPDIR
cd $TOPDIR

##############################################################################
# download sources
curl -o openssl-1.0.0a.tar.gz http://www.openssl.org/source/openssl-1.0.0a.tar.gz
curl -o curl-7.20.1.tar.gz http://curl.haxx.se/download/curl-7.20.1.tar.gz
curl -o liboauth-0.8.8.tar.gz http://liboauth.sourceforge.net/pool/liboauth-0.8.8.tar.gz

tar xzf openssl-1.0.0a.tar.gz
tar xzf curl-7.20.1.tar.gz
tar xzf liboauth-0.8.8.tar.gz

##############################################################################
# OpenSSL
cd openssl-1.0.0a
./Configure darwin-i386-cc
make

##############################################################################
# libcURL
cd $TOPDIR/curl-7.20.1
CFLAGS=&quot;-arch i386&quot; \
./configure --disable-shared --without-nss --disable-ldap \
            --with-ssl=$TOPDIR/openssl-1.0.0a
make

##############################################################################
# liboauth
cd $TOPDIR/liboauth-0.8.8

####### NOTE: this uses system-wide libz or '/path/to/libz.a'
LIBZ=&quot;-lz&quot;
test -d /Users/hborders/xcode-workspaces/personal/pdk-samples/simple/mac/palm-i386 &amp;#38;&amp;#38; \
LIBZ=&quot;/Users/hborders/xcode-workspaces/personal/pdk-samples/simple/mac/palm-i386/lib/libz.a&quot;

###### NOTE configure wants PKG_CONFIG to be set even if it's N/A
PKG_CONFIG=&quot;`which pkg-config || which true`&quot; \
CFLAGS=&quot;-arch i386&quot; \
CURL_CFLAGS=&quot;-I$TOPDIR/curl-7.20.1/include&quot; \
CURL_LIBS=&quot;$TOPDIR/curl-7.20.1/lib/.libs/libcurl.a $LIBZ&quot; \
HASH_CFLAGS=&quot;-I$TOPDIR/openssl-1.0.0a/include&quot; \
HASH_LIBS=&quot;$TOPDIR/openssl-1.0.0a/libcrypto.a  $TOPDIR/openssl-1.0.0a/libssl.a $LIBZ&quot; \
./configure --disable-shared --disable-curl --enable-libcurl

#build it
make

#run self-tests
make check

##############################################################################
# print some info about the example binary
echo &quot;example binary:&quot;
file tests/oauthexample

echo &quot;example binary's library dependencies:&quot;
LDD=&quot;ldd&quot;
which otool &amp;#62;/dev/null &amp;#38;&amp;#38; LDD=&quot;otool -L&quot;
$LDD tests/oauthexample&lt;/pre&gt;&lt;div class=&quot;tags&quot;&gt;&lt;span&gt;
&lt;a href=&quot;http://rg42.org/wiki/tags/documentation&quot; class=&quot;wikilink1&quot; title=&quot;wiki:tags:documentation&quot; rel=&quot;tag&quot;&gt;documentation&lt;/a&gt;, &lt;a href=&quot;http://rg42.org/wiki/tags/floss&quot; class=&quot;wikilink1&quot; title=&quot;wiki:tags:floss&quot; rel=&quot;tag&quot;&gt;floss&lt;/a&gt;, &lt;a href=&quot;http://rg42.org/wiki/tags/www&quot; class=&quot;wikilink1&quot; title=&quot;wiki:tags:www&quot; rel=&quot;tag&quot;&gt;www&lt;/a&gt;
&lt;/span&gt;&lt;/div&gt;

&lt;/div&gt;
</description>
    </item>
    <item rdf:about="http://rg42.org/oss/oauth/start">
        <dc:format>text/html</dc:format>
        <dc:date>2010-06-24T20:13:57+00:00</dc:date>
        <title>OAuth</title>
        <link>http://rg42.org/oss/oauth/start</link>
        <description>


&lt;h1&gt;&lt;a name=&quot;oauth&quot; id=&quot;oauth&quot;&gt;oAuth&lt;/a&gt;&lt;/h1&gt;
&lt;div class=&quot;level1&quot;&gt;

&lt;p&gt;

&lt;a href=&quot;http://oauth.net&quot; class=&quot;urlextern&quot; target=&quot;_blank&quot; title=&quot;http://oauth.net&quot;  rel=&quot;nofollow&quot;&gt;oAuth&lt;/a&gt; is an open protocol to allow secure &lt;acronym title=&quot;Application Programming Interface&quot;&gt;API&lt;/acronym&gt; authorization in a simple and standard method from desktop and web applications.
&lt;/p&gt;

&lt;p&gt;
&lt;strong&gt;liboauth&lt;/strong&gt; provides functionality to encode URLs and sign requests according to the &lt;a href=&quot;http://oauth.net&quot; class=&quot;urlextern&quot; target=&quot;_blank&quot; title=&quot;http://oauth.net&quot;  rel=&quot;nofollow&quot;&gt;oAuth&lt;/a&gt; standard, implemented in compatible POSIX-C.
&lt;/p&gt;

&lt;p&gt;
&lt;strong&gt;oauth-utils&lt;/strong&gt; is &lt;em&gt;a collection&lt;/em&gt;&lt;sup&gt;&lt;a href=&quot;#fn__1&quot; name=&quot;fnt__1&quot; id=&quot;fnt__1&quot; class=&quot;fn_top&quot;&gt;1)&lt;/a&gt;&lt;/sup&gt; of command-line tools implementing an oAuth consumer. 
&lt;/p&gt;

&lt;/div&gt;
&lt;!-- SECTION &quot;oAuth&quot; [1-654] --&gt;
&lt;h2&gt;&lt;a name=&quot;documentation&quot; id=&quot;documentation&quot;&gt;Documentation&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;
&lt;ul&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;a href=&quot;http://mir.dnsalias.com/dox/oauth/&quot; class=&quot;urlextern&quot; target=&quot;_blank&quot; title=&quot;http://mir.dnsalias.com/dox/oauth/&quot;  rel=&quot;nofollow&quot;&gt;liboauth doxygen&lt;/a&gt; - Source Code Documentation&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; oauth-tools has a built-in &lt;code&gt;–help&lt;/code&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;

&lt;em&gt;man&lt;/em&gt;ual pages are available for both 
&lt;/p&gt;

&lt;/div&gt;
&lt;!-- SECTION &quot;Documentation&quot; [655-854] --&gt;
&lt;h2&gt;&lt;a name=&quot;download&quot; id=&quot;download&quot;&gt;Download&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;

&lt;div class=&quot;noter9&quot;&gt;liboauth is now maintained at &lt;a href=&quot;http://liboauth.sf.net/&quot; class=&quot;urlextern&quot; target=&quot;_blank&quot; title=&quot;http://liboauth.sf.net/&quot;  rel=&quot;nofollow&quot;&gt;http://liboauth.sf.net/&lt;/a&gt; - Thanks to sourceforge.&lt;br/&gt;
and &lt;a href=&quot;http://oauth.googlecode.com/svn/code/c/liboauth/&quot; class=&quot;urlextern&quot; target=&quot;_blank&quot; title=&quot;http://oauth.googlecode.com/svn/code/c/liboauth/&quot;  rel=&quot;nofollow&quot;&gt;http://oauth.googlecode.com/svn/code/c/liboauth/&lt;/a&gt; - Thanks to google.
&lt;/div&gt;

&lt;p&gt;
&lt;strong&gt;Source&lt;/strong&gt;
&lt;/p&gt;
&lt;ul&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;a href=&quot;http://mir.dnsalias.com/gitweb/?p=liboauth.git;a=summary&quot; class=&quot;urlextern&quot; target=&quot;_blank&quot; title=&quot;http://mir.dnsalias.com/gitweb/?p=liboauth.git;a=summary&quot;  rel=&quot;nofollow&quot;&gt;liboauth&lt;/a&gt; browse git repository&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;a href=&quot;http://mir.dnsalias.com/gitweb/?p=oauth-utils.git;a=summary&quot; class=&quot;urlextern&quot; target=&quot;_blank&quot; title=&quot;http://mir.dnsalias.com/gitweb/?p=oauth-utils.git;a=summary&quot;  rel=&quot;nofollow&quot;&gt;oauth-utils&lt;/a&gt; browse git repository&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;a href=&quot;http://rg42.org/_media/oss/oauth/oauth-utils-0.3.2.tar.gz&quot; class=&quot;media mediafile mf_gz&quot; title=&quot;oss:oauth:oauth-utils-0.3.2.tar.gz&quot;&gt;oauth-utils-0.3.2.tar.gz&lt;/a&gt; oauth-utils source (incl. &lt;code&gt;configure&lt;/code&gt; script, without &lt;code&gt;debian&lt;/code&gt; folder)&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;a href=&quot;http://mir.dnsalias.com/gitweb/?p=oauth-utils.git;a=snapshot;h=HEAD&quot; class=&quot;urlextern&quot; target=&quot;_blank&quot; title=&quot;http://mir.dnsalias.com/gitweb/?p=oauth-utils.git;a=snapshot;h=HEAD&quot;  rel=&quot;nofollow&quot;&gt;devel snapshot&lt;/a&gt; latest version of oauth-utils source (including &lt;code&gt;debian&lt;/code&gt;, requires autotools)&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;

&lt;strong&gt;Build debian packages&lt;/strong&gt;
&lt;/p&gt;
&lt;pre class=&quot;code&quot;&gt;git clone git://mir.dnsalias.com/liboauth
cd liboauth
git branch upstream 
#make maintainer-clean
git-buildpackage
#make check
cd .. &amp;amp;&amp;amp; sudo dpkg -i liboauth*.deb

git clone git://mir.dnsalias.com/oauth-utils
cd oauth-utils
git branch upstream
#make maintainer-clean
git-buildpackage
#make check # connects to http://term.ie/oauth/example !
cd .. &amp;amp;&amp;amp; sudo dpkg -i oauth-utils*.deb&lt;/pre&gt;

&lt;/div&gt;
&lt;!-- SECTION &quot;Download&quot; [855-2008] --&gt;
&lt;h2&gt;&lt;a name=&quot;oauthsign_usage_and_example&quot; id=&quot;oauthsign_usage_and_example&quot;&gt;oauthsign usage and example&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;

&lt;p&gt;

Both &lt;em&gt;oauthsign&lt;/em&gt; and &lt;em&gt;oauthverify&lt;/em&gt; are documented in un*x manual pages. You may want to &lt;del&gt;consult&lt;/del&gt; proof-read &lt;code&gt;man oauth-utils&lt;/code&gt; as well.
&lt;br/&gt;

&lt;br/&gt;

&lt;strong&gt; usage examples &lt;/strong&gt;&lt;br/&gt;

perform requests with fixed tokens
&lt;/p&gt;
&lt;pre class=&quot;code&quot;&gt;oauthsign -c consumer-key -C &amp;quot;&amp;quot; -t access-token -T token-secret &amp;#039;http://example.org/?do=admin&amp;#039;
oauthsign -X -d &amp;quot;do=requesttoken&amp;quot; &amp;#039;http://example.org/&amp;#039; consumer-key &amp;quot;&amp;quot;&lt;/pre&gt;

&lt;p&gt;

&lt;em&gt;debug oAuth parameters&lt;/em&gt; - print oauth base-string:
&lt;/p&gt;
&lt;pre class=&quot;code&quot;&gt;oauthsign -b -c consumer-key -C &amp;quot;&amp;quot; -t access-token -T token-secret &amp;#039;http://example.org/?do=admin&amp;#039;&lt;/pre&gt;

&lt;p&gt;
&lt;br/&gt;

&lt;br/&gt;

&lt;strong&gt; test server walk-through &lt;/strong&gt;&lt;br/&gt;

see also &lt;code&gt;example.sh&lt;/code&gt; below.
&lt;/p&gt;

&lt;p&gt;
Get a request-token for the consumer &lt;code&gt;key&lt;/code&gt; with consumer-secret &lt;code&gt;secret&lt;/code&gt; from the server and save it to &lt;code&gt;/tmp/test.oaf&lt;/code&gt;:
&lt;/p&gt;
&lt;pre class=&quot;code&quot;&gt;oauthsign -X -f /tmp/test.oaf -w -e -c key -C secret http://term.ie/oauth/example/request_token.php&lt;/pre&gt;

&lt;p&gt;
&lt;br/&gt;

Exchange this request-token for an access token and replace the token+secret in &lt;code&gt;/tmp/test.oaf&lt;/code&gt;:
&lt;/p&gt;
&lt;pre class=&quot;code&quot;&gt;oauthsign -X -f /tmp/test.oaf -w http://term.ie/oauth/example/access_token.php&lt;/pre&gt;

&lt;p&gt;
&lt;br/&gt;

Perform some requests with the consumer and access token/secrets in same file:
&lt;/p&gt;
&lt;pre class=&quot;code&quot;&gt;oauthsign -x -f /tmp/test.oaf &amp;quot;http://term.ie/oauth/example/echo_api.php?method=foo%20bar&amp;amp;bar=baz&amp;quot;
oauthsign -x -f /tmp/test.oaf -d method=foo%20bar -d &amp;quot;bar=baz &amp;amp;test%&amp;quot; --post http://term.ie/oauth/example/echo_api.php&lt;/pre&gt;

&lt;p&gt;
&lt;br/&gt;

&lt;br/&gt;

&lt;strong&gt;output of oauthsign –help &lt;/strong&gt;&lt;br/&gt;


&lt;/p&gt;
&lt;pre class=&quot;code&quot;&gt;
oauthsign - command line utilities for oauth
Usage: ./src/oauthsign [OPTION]... URL [CKey] [CSec] [TKey] [Tsec]
Options:
  -h, --help                  display this help and exit
  -V, --version               output version information and exit
  -q, --quiet, --silent       inhibit usual output
  -v, --verbose               print more information
  --no-warn                   dont print any warnings.

  -b, --base-string           print OAuth base-string and exit
  -B, --base-url              print OAuth base-URL and exit
  -r, --request &amp;#60;type&amp;#62;        HTTP request type (HEAD, PUT, POST, GET [default],..)
  -p, --post                  same as -r POST
  -d, --data &amp;#60;key&amp;#62;[=&amp;#60;val&amp;#62;]    add url query parameters.
  -m, --signature-method &amp;#60;m&amp;#62;  oauth signature method (PLAINTEXT,
                              RSA-SHA1, HMAC-SHA1 [default])

  -c, --CK, --consumer-key    &amp;#60;text&amp;#62;
  -C, --CS, --consumer-secret &amp;#60;text&amp;#62;
  -t, --TK, --token-key       &amp;#60;text&amp;#62;
  -T, --TS, --token-secret    &amp;#60;text&amp;#62;

  -a, --callback &amp;#60;url&amp;#62;        specify oauth_callback url (or 'oob') // 1.0 Rev A
  -A, --verifier &amp;#60;text&amp;#62;       specify oauth_verifier // 1.0 Rev A

  -f, --file &amp;#60;filename&amp;#62;       read tokens and secrets from config-file
  -w                          write tokens to config-file
  -F &amp;#60;filename&amp;#62;               set config-file name w/o reading the file.
  -x                          make HTTP request and return the replied content
  -X                          make HTTP request and parse the reply for tokens
                              use '-X -w' to request and store tokens.
  --dry-run                   take no real actions (with -x, -w or -X)
  -e, --erase-tokens          clear [access|request] tokens.
  -E, --erase-all             wipe all tokens and reset method to HMAC-SHA1.
  --erase-consumer-key        unset consumer-key
  --erase-consumer-secret     unset consumer-secret
  --erase-token-key           unset token-key
  --erase-token-secret        unset token-secret

  The position of parameters -d, -f, -F, -e, -E and all tokens matters!

  Tokens are read from file at the moment the -f option is parsed overriding
  the current value(s). Optional trailing key/secret params are parsed last.
  eg.
    '-f config.txt -e -C secret -F out.txt -w' reads the settings from file,
  then deletes the access/request tokens and finally overrides the consumer-
  secret. Only the consumer-key is left from config.txt and will be saved
  to out.txt along with the new secret. If -X is given and the HTTP request
  succeeds, the received token and secret will be stored as well.

  The request URL is constructed by first parsing all query-parameters from
  the URL; then -d parameters are added, and finally oauth_XYZ params
  appended.&lt;/pre&gt;&lt;div class=&quot;code&quot;&gt;&lt;p class=&quot;codehead HideOnInit&quot;&gt;&lt;a name=&quot;docexamplesh_from_oauth-utils&quot;&gt;doc/example.sh from oauth-utils&lt;/a&gt;&lt;/p&gt;&lt;pre class=&quot;code&quot;&gt;
#!/bin/bash

CONFIGFILE=${1:-&quot;./oauthconf&quot;}

OAUTHSIGN=./src/oauthsign
if ! test -x $OAUTHSIGN; then
  OAUTHSIGN=../src/oauthsign
fi
if ! test -x $OAUTHSIGN; then
  OAUTHSIGN=$(which oauthsign)
fi
if ! test -x $OAUTHSIGN; then
  echo &quot; oauthsign executable not found.&quot;
  exit 1
fi

# default config
OPT=&quot;&quot;
CONKEY=&quot;key&quot;
CONSEC=&quot;secret&quot;
BASEURL=&quot;http://term.ie/oauth/example/&quot;
DOPARAM=&quot;&quot;
RQT=&quot;request_token.php&quot;
ACT=&quot;access_token.php&quot;
#AUT=&quot;authenticate.php?&quot;
TST=&quot;echo_api.php&quot;
TSQ=&quot;?method=foo%20bar&amp;#38;bar=baz&quot;

#TODO: make these into config files and different tests.
if [ 1 == 0 ]; then     # test PLAINTEXT signature
  OPT=&quot;-m PLAINTEXT&quot;
elif [ 1 == 0 ]; then   # test RSA-SHA1 signature
# NOTE: the way RSA-keys are passed to oauthsign
# will change in the future.
# so far oauthsign want a public key as CONSUMER SECRET
# and oauthverfiy expects a private key..
  OPT=&quot;-v -m RSA-SHA1&quot;
  CONSEC=&quot;-----BEGIN PRIVATE KEY-----
MIICdgIBADANBgkqhkiG9w0BAQEFAASCAmAwggJcAgEAAoGBALRiMLAh9iimur8V
A7qVvdqxevEuUkW4K+2KdMXmnQbG9Aa7k7eBjK1S+0LYmVjPKlJGNXHDGuy5Fw/d
7rjVJ0BLB+ubPK8iA/Tw3hLQgXMRRGRXXCn8ikfuQfjUS1uZSatdLB81mydBETlJ
hI6GH4twrbDJCR2Bwy/XWXgqgGRzAgMBAAECgYBYWVtleUzavkbrPjy0T5FMou8H
X9u2AC2ry8vD/l7cqedtwMPp9k7TubgNFo+NGvKsl2ynyprOZR1xjQ7WgrgVB+mm
uScOM/5HVceFuGRDhYTCObE+y1kxRloNYXnx3ei1zbeYLPCHdhxRYW7T0qcynNmw
rn05/KO2RLjgQNalsQJBANeA3Q4Nugqy4QBUCEC09SqylT2K9FrrItqL2QKc9v0Z
zO2uwllCbg0dwpVuYPYXYvikNHHg+aCWF+VXsb9rpPsCQQDWR9TT4ORdzoj+Nccn
qkMsDmzt0EfNaAOwHOmVJ2RVBspPcxt5iN4HI7HNeG6U5YsFBb+/GZbgfBT3kpNG
WPTpAkBI+gFhjfJvRw38n3g/+UeAkwMI2TJQS4n8+hid0uus3/zOjDySH3XHCUno
cn1xOJAyZODBo47E+67R4jV1/gzbAkEAklJaspRPXP877NssM5nAZMU0/O/NGCZ+
3jPgDUno6WbJn5cqm8MqWhW1xGkImgRk+fkDBquiq4gPiT898jusgQJAd5Zrr6Q8
AO/0isr/3aa6O6NLQxISLKcPDk2NOccAfS/xOtfOz4sJYM3+Bs4Io9+dZGSDCA54
Lw03eHTNQghS0A==
-----END PRIVATE KEY-----&quot;
fi

# read config file - override above settings
if [ -e $CONFIGFILE ]; then
 . $CONFIGFILE
fi

echo &quot; --- oauthsign test and example&quot;
echo &quot; --- connecting to $BASEURL&quot;

TOKENFILE=`mktemp /tmp/oauth.XXXXXXXXXX` || exit 1

function cleanup {
  rm $TOKENFILE
}
trap cleanup EXIT

echo &quot; +++ getting request token..&quot;
$OAUTHSIGN -X $OPT -f $TOKENFILE -w -e -c &quot;$CONKEY&quot; -C &quot;$CONSEC&quot; \
    &quot;${BASEURL}${DOPARAM}${RQT}&quot; \
    || ( echo &quot; !!! no request token returned.&quot;; exit 1;) || exit 1;

if [ -n &quot;$AUT&quot; ]; then
  REQTOK=$(cat $TOKENFILE | awk '/oauth_token_key=(.*)/{ print substr($1,17);}')
  echo &quot; +++ Authorization.&quot;
  echo &quot;visit: ${BASEURL}${DOPARAM}${AUT}&amp;#38;oauth_token=${REQTOK}&quot;
  echo -n &quot;to authorize this request token and press enter..&quot;
  read
  echo
fi

echo &quot; +++ exchanging request token for access token&quot;
$OAUTHSIGN -X $OPT -f $TOKENFILE -w --quiet &quot;${BASEURL}${DOPARAM}${ACT}&quot; \
    || ( echo &quot; !!! token exchange failed&quot;; exit 1;) || exit 1;

echo &quot; +++ making test request..&quot;
$OAUTHSIGN -x $OPT -f $TOKENFILE &quot;${BASEURL}${TST}${TSQ}&quot; \
    || ( echo &quot; !!! test request failed&quot;; exit 1;) || exit 1

#echo &quot; +++ and another one with parameter-arrays&quot;
#$OAUTHSIGN -x -f $TOKENFILE -d &quot;foo=bar bar&quot; \
#    -d 'bar[1]=foo&amp;#38;%bar' -d 'bar[0]=bar#+b a r' --post \
#    &quot;${BASEURL}${TST}&quot; \
#    || ( echo &quot; !!! test request failed&quot;; exit 1;) || exit 1

exit 0&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;
Note: As shown in above example RSA-keys can currently be given instead of a consumer-secret (public-key for &lt;code&gt;oauthsign&lt;/code&gt;, private-key for &lt;code&gt;oauthverify&lt;/code&gt;). This is going to change. Future versions may use &lt;code&gt;–rsa-private&lt;/code&gt;, &lt;code&gt;–rsa-public&lt;/code&gt; and also provide for reading the key from file.
&lt;/p&gt;

&lt;/div&gt;
&lt;!-- SECTION &quot;oauthsign usage and example&quot; [2009-6629] --&gt;
&lt;h2&gt;&lt;a name=&quot;oauthverify_usage_and_example&quot; id=&quot;oauthverify_usage_and_example&quot;&gt;oauthverify usage and example&lt;/a&gt;&lt;/h2&gt;
&lt;div class=&quot;level2&quot;&gt;

&lt;p&gt;

&lt;em&gt;oauthverify&lt;/em&gt; is the counter-part and very similar to &lt;em&gt;oauthsign&lt;/em&gt;: It parses all request-parameters (those appended to the &lt;acronym title=&quot;Uniform Resource Locator&quot;&gt;URL&lt;/acronym&gt; after a &amp;#039;?&amp;#039; and the ones given to &lt;em&gt;oauthverify&lt;/em&gt; with &lt;code&gt;-d&lt;/code&gt; command line option) one of which must be the oauth_signature to verify. 
&lt;/p&gt;

&lt;p&gt;
To recalculate the signature the consumer (and token) &lt;strong&gt;secrets&lt;/strong&gt; must be specified (fi. &lt;code&gt;-C&lt;/code&gt; and &lt;code&gt;-T&lt;/code&gt;) or read from file.  If a consumer-&lt;strong&gt;key&lt;/strong&gt;, token-&lt;strong&gt;key&lt;/strong&gt; or signature-method is set (eg. &lt;code&gt;-c&lt;/code&gt; or &lt;code&gt;-t&lt;/code&gt;, &lt;code&gt;-m&lt;/code&gt;), they&amp;#039;re required to match the ones in the parsed request-parameters. You can use &lt;code&gt;–erase-consumer-key&lt;/code&gt; etc. to relax such a requirement when reading tokens along with the secrets from a file.
&lt;/p&gt;

&lt;p&gt;
If the signature is correct and if the consumer/token key matches the given parameters (if any) oauthverify exits with a status code indicating success and prints the parsed request-parameters formatted as POST parameters (more output options to come: &lt;code&gt;–print0&lt;/code&gt; or &lt;code&gt;-0&lt;/code&gt;, JSON is the contender)
&lt;/p&gt;

&lt;p&gt;
Note that &lt;em&gt;oauthverify&lt;/em&gt; does &lt;strong&gt;not&lt;/strong&gt; keep track of consumers, token-mappings, timestamps and nonce (never more than once) identifiers. If the signature matches it prints them for others to use.
&lt;/p&gt;

&lt;p&gt;
  oauthverify -C secret `oauthsign -c key -C secret &lt;a href=&quot;http://example.org&quot; class=&quot;urlextern&quot; target=&quot;_blank&quot; title=&quot;http://example.org&quot;  rel=&quot;nofollow&quot;&gt;http://example.org&lt;/a&gt;`
&lt;/p&gt;

&lt;/div&gt;
&lt;!-- SECTION &quot;oauthverify usage and example&quot; [6630-7931] --&gt;
&lt;h1&gt;&lt;a name=&quot;resources&quot; id=&quot;resources&quot;&gt;Resources&lt;/a&gt;&lt;/h1&gt;
&lt;div class=&quot;level1&quot;&gt;
&lt;ul&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;a href=&quot;http://rg42.org/wiki/dokuoauth&quot; class=&quot;wikilink1&quot; title=&quot;wiki:dokuoauth&quot;&gt;dokuoauth&lt;/a&gt; - DokuWiki OAuth plugin&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;a href=&quot;http://tools.ietf.org/html/rfc5849&quot; class=&quot;urlextern&quot; target=&quot;_blank&quot; title=&quot;http://tools.ietf.org/html/rfc5849&quot;  rel=&quot;nofollow&quot;&gt;RFC 5849&lt;/a&gt; – OAuth specs &lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;a href=&quot;http://www.marcworrell.com/article-2943-en.html&quot; class=&quot;urlextern&quot; target=&quot;_blank&quot; title=&quot;http://www.marcworrell.com/article-2943-en.html&quot;  rel=&quot;nofollow&quot;&gt;http://www.marcworrell.com/article-2943-en.html&lt;/a&gt; - OAuth &lt;acronym title=&quot;Uniform Resource Identifier&quot;&gt;URI&lt;/acronym&gt; encoding&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;del&gt;&lt;a href=&quot;http://oauth-sandbox.mediamatic.nl/&quot; class=&quot;urlextern&quot; target=&quot;_blank&quot; title=&quot;http://oauth-sandbox.mediamatic.nl/&quot;  rel=&quot;nofollow&quot;&gt;http://oauth-sandbox.mediamatic.nl/&lt;/a&gt; - testsandbox&lt;/del&gt;&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; &lt;a href=&quot;http://term.ie/oauth/example/&quot; class=&quot;urlextern&quot; target=&quot;_blank&quot; title=&quot;http://term.ie/oauth/example/&quot;  rel=&quot;nofollow&quot;&gt;http://term.ie/oauth/example/&lt;/a&gt; - test server&lt;/div&gt;
&lt;/li&gt;
&lt;li class=&quot;level1&quot;&gt;&lt;div class=&quot;li&quot;&gt; How to &lt;a href=&quot;http://rg42.org/oss/oauth/osx-static&quot; class=&quot;wikilink1&quot; title=&quot;oss:oauth:osx-static&quot;&gt;statically link liboauth&lt;/a&gt; with your app.&lt;/div&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class=&quot;tags&quot;&gt;&lt;span&gt;
&lt;a href=&quot;http://rg42.org/wiki/tags/floss&quot; class=&quot;wikilink1&quot; title=&quot;wiki:tags:floss&quot; rel=&quot;tag&quot;&gt;FLOSS&lt;/a&gt;, &lt;a href=&quot;http://rg42.org/wiki/tags/www&quot; class=&quot;wikilink1&quot; title=&quot;wiki:tags:www&quot; rel=&quot;tag&quot;&gt;WWW&lt;/a&gt;
&lt;/span&gt;&lt;/div&gt;

&lt;/div&gt;
&lt;!-- SECTION &quot;Resources&quot; [7932-] --&gt;&lt;div class=&quot;footnotes&quot;&gt;
&lt;div class=&quot;fn&quot;&gt;&lt;sup&gt;&lt;a href=&quot;#fnt__1&quot; id=&quot;fn__1&quot; name=&quot;fn__1&quot; class=&quot;fn_bot&quot;&gt;1)&lt;/a&gt;&lt;/sup&gt; 
so far there&amp;#039;s only &lt;code&gt;oauthsign&lt;/code&gt;, &lt;code&gt;oauthverify&lt;/code&gt; and an example shell script. other utils eg. &lt;code&gt;oauthrawpost&lt;/code&gt; are in the making. see also &lt;a href=&quot;http://trac.mediamatic.nl/picnic/browser/tools/anymeta&quot; class=&quot;urlextern&quot; target=&quot;_blank&quot; title=&quot;http://trac.mediamatic.nl/picnic/browser/tools/anymeta&quot;  rel=&quot;nofollow&quot;&gt;mediamatic-picnic oAuth tools&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
</description>
    </item>
</rdf:RDF>
