-rw-r--r-- | lib/consumer.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/consumer.cc b/lib/consumer.cc index 3c3b4f8..ebda262 100644 --- a/lib/consumer.cc +++ b/lib/consumer.cc | |||
@@ -145,25 +145,25 @@ namespace opkele { | |||
145 | retrieve_links(iurl,server,delegate); | 145 | retrieve_links(iurl,server,delegate); |
146 | p["identity"] = delegate.empty()?iurl:delegate; | 146 | p["identity"] = delegate.empty()?iurl:delegate; |
147 | if(!trust_root.empty()) | 147 | if(!trust_root.empty()) |
148 | p["trust_root"] = trust_root; | 148 | p["trust_root"] = trust_root; |
149 | p["return_to"] = return_to; | 149 | p["return_to"] = return_to; |
150 | try { | 150 | try { |
151 | string ah = find_assoc(server)->handle(); | 151 | string ah = find_assoc(server)->handle(); |
152 | p["assoc_handle"] = ah; | 152 | p["assoc_handle"] = ah; |
153 | }catch(failed_lookup& fl) { | 153 | }catch(failed_lookup& fl) { |
154 | string ah = associate(server)->handle(); | 154 | string ah = associate(server)->handle(); |
155 | p["assoc_handle"] = ah; | 155 | p["assoc_handle"] = ah; |
156 | } | 156 | } |
157 | if(ext) ext->checkid_hook(p,identity); | 157 | if(ext) ext->checkid_hook(p); |
158 | return p.append_query(server); | 158 | return p.append_query(server); |
159 | } | 159 | } |
160 | 160 | ||
161 | void consumer_t::id_res(const params_t& pin,const string& identity,extension_t *ext) { | 161 | void consumer_t::id_res(const params_t& pin,const string& identity,extension_t *ext) { |
162 | if(pin.has_param("openid.user_setup_url")) | 162 | if(pin.has_param("openid.user_setup_url")) |
163 | throw id_res_setup(OPKELE_CP_ "assertion failed, setup url provided",pin.get_param("openid.user_setup_url")); | 163 | throw id_res_setup(OPKELE_CP_ "assertion failed, setup url provided",pin.get_param("openid.user_setup_url")); |
164 | string server,delegate; | 164 | string server,delegate; |
165 | retrieve_links(identity.empty()?pin.get_param("openid.identity"):canonicalize(identity),server,delegate); | 165 | retrieve_links(identity.empty()?pin.get_param("openid.identity"):canonicalize(identity),server,delegate); |
166 | params_t ps; | 166 | params_t ps; |
167 | try { | 167 | try { |
168 | assoc_t assoc = retrieve_assoc(server,pin.get_param("openid.assoc_handle")); | 168 | assoc_t assoc = retrieve_assoc(server,pin.get_param("openid.assoc_handle")); |
169 | if(assoc->is_expired()) | 169 | if(assoc->is_expired()) |
@@ -213,25 +213,25 @@ namespace opkele { | |||
213 | p["openid.sig"] = pin.get_param("openid.sig"); | 213 | p["openid.sig"] = pin.get_param("openid.sig"); |
214 | p["openid.signed"] = pin.get_param("openid.signed"); | 214 | p["openid.signed"] = pin.get_param("openid.signed"); |
215 | try { | 215 | try { |
216 | string ih = pin.get_param("openid.invalidate_handle"); | 216 | string ih = pin.get_param("openid.invalidate_handle"); |
217 | p["openid.invalidate_handle"] = ih; | 217 | p["openid.invalidate_handle"] = ih; |
218 | }catch(failed_lookup& fl) { } | 218 | }catch(failed_lookup& fl) { } |
219 | try { | 219 | try { |
220 | check_authentication(server,p); | 220 | check_authentication(server,p); |
221 | }catch(failed_check_authentication& fca) { | 221 | }catch(failed_check_authentication& fca) { |
222 | throw id_res_failed(OPKELE_CP_ "failed to check_authentication()"); | 222 | throw id_res_failed(OPKELE_CP_ "failed to check_authentication()"); |
223 | } | 223 | } |
224 | } | 224 | } |
225 | if(ext) ext->id_res_hook(pin,ps,identity); | 225 | if(ext) ext->id_res_hook(pin,ps); |
226 | } | 226 | } |
227 | 227 | ||
228 | void consumer_t::check_authentication(const string& server,const params_t& p) { | 228 | void consumer_t::check_authentication(const string& server,const params_t& p) { |
229 | string request = "openid.mode=check_authentication"; | 229 | string request = "openid.mode=check_authentication"; |
230 | for(params_t::const_iterator i=p.begin();i!=p.end();++i) { | 230 | for(params_t::const_iterator i=p.begin();i!=p.end();++i) { |
231 | if(i->first!="openid.mode") { | 231 | if(i->first!="openid.mode") { |
232 | request += '&'; | 232 | request += '&'; |
233 | request += i->first; | 233 | request += i->first; |
234 | request += '='; | 234 | request += '='; |
235 | request += util::url_encode(i->second); | 235 | request += util::url_encode(i->second); |
236 | } | 236 | } |
237 | } | 237 | } |