/*
* Perform authentication using OpenID
- * assemble the checkid_immediate request and then redirect to the user's identity provider
+ * assemble the checkid_setup request and then redirect to the user's identity provider
*/
void do_openid_login(void)
{
snprintf(redirect_string, sizeof redirect_string,
"%s"
- "?openid.mode=checkid_immediate"
+ "?openid.mode=checkid_setup"
"&openid_identity=%s"
"&openid.return_to=%s"
"&openid.trust_root=%s"
,
openid_server, escaped_identity, escaped_return_to, escaped_trust_root
);
+ lprintf(CTDL_DEBUG, "OpenID server contacted; redirecting to %s\n", redirect_string);
http_redirect(redirect_string);
return;
}
}
/*
- * Perform authentication using OpenID
- * assemble the checkid_immediate request and then redirect to the user's identity provider
+ * Complete the authentication using OpenID
+ * This function handles the positive or negative assertion from the user's Identity Provider
*/
void finish_openid_login(void)
{
- if (havebstr("openid.user_setup_url")) {
- http_redirect(bstr("openid.user_setup_url"));
- return;
- }
-
if (havebstr("openid.mode")) {
- if (!strcasecmp(bstr("openid.mode"), "error")) {
- if (havebstr("openid.error")) {
- display_openid_login(bstr("openid.error"));
- }
- else {
- display_openid_login(_("Your password was not accepted."));
- }
- return;
- }
- }
+ if (!strcasecmp(bstr("openid.mode"), "id_res")) {
+ display_openid_login("FIXME id accepted but the code isn't finished");
+ //FIXME finish this
- // FIXME finish this
+ }
+ }
if (WC->logged_in) {
if (WC->need_regi) {
u->url_data[u->url_data_size] = '\0';
up = bptr;
++up;
-/* uncomment the following line to see each parameter in the log
+
+#ifdef DEBUG_URLSTRINGS
lprintf(9, "%s = [%ld] %s\n", u->url_key, u->url_data_size, u->url_data);
-*/
+#endif
}
}