diff options
author | jsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68> | 2010-11-03 16:39:53 +0000 |
---|---|---|
committer | jsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68> | 2010-11-03 16:39:53 +0000 |
commit | 034b527d25626a4812fc696c3878744695c23a0b (patch) | |
tree | 5d7d9c3dfadba189d359f5ef4e12e135ad3a7317 /sca-cpp/trunk/modules/oauth/oauth.hpp | |
parent | d63c8ad1885acb086a2947502a3beeded8f5dd05 (diff) |
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
Diffstat (limited to 'sca-cpp/trunk/modules/oauth/oauth.hpp')
-rw-r--r-- | sca-cpp/trunk/modules/oauth/oauth.hpp | 7 |
1 files changed, 6 insertions, 1 deletions
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<string> sessionID(const list<string> c) { if (isNil(c)) return maybe<string>(); - const list<string> kv = tokenize("=", car(c)); + const list<string> kv = tokenize("=", cookieName(c_str(car(c)))); if (!isNil(kv) && !isNil(cdr(kv))) { if (car(kv) == "TuscanyOpenAuth") return cadr(kv); |