summaryrefslogtreecommitdiffstats
path: root/sca-cpp/trunk/modules/oauth/mod-oauth2.cpp
diff options
context:
space:
mode:
authorjsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68>2011-08-06 05:59:04 +0000
committerjsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68>2011-08-06 05:59:04 +0000
commit96659f703781c4223a9db5013cac10b850daa46b (patch)
treefed109b192a9d4d8c9f1358fd289fff45318f9a8 /sca-cpp/trunk/modules/oauth/mod-oauth2.cpp
parent9bc3767bab48bbd5897441a36d90f5b7daa8e321 (diff)
Make authentication work with wildcard domains and increase authentication cookie max-age.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1154445 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-cpp/trunk/modules/oauth/mod-oauth2.cpp')
-rw-r--r--sca-cpp/trunk/modules/oauth/mod-oauth2.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/sca-cpp/trunk/modules/oauth/mod-oauth2.cpp b/sca-cpp/trunk/modules/oauth/mod-oauth2.cpp
index 61f242a80e..2e4b2e5b80 100644
--- a/sca-cpp/trunk/modules/oauth/mod-oauth2.cpp
+++ b/sca-cpp/trunk/modules/oauth/mod-oauth2.cpp
@@ -203,7 +203,7 @@ const failable<int> access_token(const list<list<value> >& args, request_rec* r,
if (!hasContent(tr))
return mkfailure<int>(reason(tr));
debug(tr, "modoauth2::access_token::response");
- const list<value> tv = assoc<value>("access_token", httpd::queryArgs(join("", convertValues<string>(content(tr)))));
+ const list<value> tv = assoc<value>("access_token", httpd::queryArgs(join("", convertValues<string>(cadr<value>(content(tr))))));
if (isNil(tv) || isNil(cdr(tv)))
return mkfailure<int>("Couldn't retrieve access_token");
debug(tv, "modoauth2::access_token::token");
@@ -230,6 +230,7 @@ const failable<int> access_token(const list<list<value> >& args, request_rec* r,
return mkfailure<int>(reason(prc));
// Send session ID to the client in a cookie
+ debug(c_str(openauth::cookie(sid, httpd::hostName(sc.server))), "modoauth2::access_token::setcookie");
apr_table_set(r->err_headers_out, "Set-Cookie", c_str(openauth::cookie(sid, httpd::hostName(sc.server))));
return httpd::externalRedirect(httpd::url(r->uri, r), r);
}