From 034b527d25626a4812fc696c3878744695c23a0b Mon Sep 17 00:00:00 2001 From: jsdelfino Date: Wed, 3 Nov 2010 16:39:53 +0000 Subject: Improvements to OAuth and OpenID modules. Store client app in an environment variable. Add support for more OAuth providers. Fix a cookie parsing bug. git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1030524 13f79535-47bb-0310-9956-ffa450edef68 --- sca-cpp/trunk/modules/oauth/oauth.hpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'sca-cpp/trunk/modules/oauth/oauth.hpp') diff --git a/sca-cpp/trunk/modules/oauth/oauth.hpp b/sca-cpp/trunk/modules/oauth/oauth.hpp index ab92cbd381..cea16e035f 100644 --- a/sca-cpp/trunk/modules/oauth/oauth.hpp +++ b/sca-cpp/trunk/modules/oauth/oauth.hpp @@ -43,10 +43,15 @@ namespace oauth { /** * Return the session id from a request. */ +const char* cookieName(const char* cs) { + if (*cs != ' ') + return cs; + return cookieName(cs + 1); +} const maybe sessionID(const list c) { if (isNil(c)) return maybe(); - const list kv = tokenize("=", car(c)); + const list kv = tokenize("=", cookieName(c_str(car(c)))); if (!isNil(kv) && !isNil(cdr(kv))) { if (car(kv) == "TuscanyOpenAuth") return cadr(kv); -- cgit v1.2.3