Pete Zaitcev wrote:
Guys:
Below is what I have now for 2-legged OAuth in iwhd. It actually works,
with oauthtest2 from liboauth.
The patch is only a small piece, since it has no client, which we need
to run the tests, has no documentation, and no user list. However, it
retires most of the risk. We know that it can be done, this way.
The biggest risk left is interoperability with Aeolus.
BTW, the OAuth header looks like this:
Authorization: OAuth
realm="http://example.org/",
oauth_consumer_key="chiaki",
oauth_nonce="mitPzrhrCMHABJiYava_",
oauth_signature_method="HMAC-SHA1",
oauth_timestamp="1317182031", oauth_version="1.0",
oauth_signature="Ya36%2FkXTG5YATRx%2BWAXK9NXzZCg%3D"
-- Pete
diff --git a/configure.ac b/configure.ac
index e23d1fa..8b115cb 100644
--- a/configure.ac
+++ b/configure.ac
@@ -70,6 +70,9 @@ AC_CHECK_LIB([uuid], [uuid_generate_random],
[AC_MSG_ERROR([Missing required uuid lib])])
AC_SUBST([UUID_LIB])
+dnl How to check properly?
+LIBS="$LIBS -loauth"
Thanks a lot, Pete.
I've only just started looking through this, but will
go ahead and send these suggested changes already.
You are welcome to merge these into yours.
From 563a727b770f1a16390a3538492741278ebe31c4 Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering(a)redhat.com>
Date: Thu, 29 Sep 2011 18:52:50 +0200
Subject: [PATCH 1/2] build-req
* iwhd.spec.in (BuildRequires): Add liboauth-devel
---
iwhd.spec.in | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
diff --git a/iwhd.spec.in b/iwhd.spec.in
index 24d97d6..6b9d1cd 100644
--- a/iwhd.spec.in
+++ b/iwhd.spec.in
@@ -21,6 +21,7 @@ BuildRequires: hail-devel
BuildRequires: jansson-devel
BuildRequires: libcurl-devel
BuildRequires: libmicrohttpd-devel
+BuildRequires: liboauth-devel
BuildRequires: libxml2-devel
BuildRequires: libuuid-devel
BuildRequires: mongodb-devel
--
1.7.7.rc0.362.g5a14
From ce5aa582f9435dd6201bb0ff6732c15d0faa67b8 Mon Sep 17 00:00:00 2001
From: Jim Meyering <meyering(a)redhat.com>
Date: Thu, 29 Sep 2011 19:01:41 +0200
Subject: [PATCH 2/2] add configure-time check for liboauth
* configure.ac (OAUTH_LIB): Check for liboauth.
* Makefile.am (iwhd_LDADD): Use it.
---
Makefile.am | 1 +
configure.ac | 6 ++++--
2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/Makefile.am b/Makefile.am
index 7cf2e54..94510ed 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -154,6 +154,7 @@ iwhd_LDADD = \
$(BOOST_THREAD_LIB) \
$(CURL_LIB) \
$(JANSSON_LIB) \
+ $(OAUTH_LIB) \
$(UHTTPD_LIB) \
$(PTHREAD_LIB) \
$(HAIL_LIBS)
diff --git a/configure.ac b/configure.ac
index 8b115cb..2cd667a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -70,8 +70,10 @@ AC_CHECK_LIB([uuid], [uuid_generate_random],
[AC_MSG_ERROR([Missing required uuid lib])])
AC_SUBST([UUID_LIB])
-dnl How to check properly?
-LIBS="$LIBS -loauth"
+AC_CHECK_LIB([oauth], [oauth_init_nss],
+ [OAUTH_LIB=-loauth],
+ [AC_MSG_ERROR([Missing required oauth lib])])
+AC_SUBST([OAUTH_LIB])
PKG_CHECK_MODULES([HAIL],[libhail >= 0.8])
AC_SUBST([HAIL_LIBS])
--
1.7.7.rc0.362.g5a14