From: Art Cancro Date: Sun, 18 May 2008 04:42:58 +0000 (+0000) Subject: Some more tinkering with OpenID. X-Git-Tag: v7.86~2242 X-Git-Url: https://code.citadel.org/?a=commitdiff_plain;h=a62275f1563cf432ad653995fa83abf79c916d85;p=citadel.git Some more tinkering with OpenID. Also changed webcit.c so that if DEBUG_URLSTRINGS is defined, all urlstrings will be displayed for each transaction, eliminating the need to uncomment that code. --- diff --git a/webcit/auth.c b/webcit/auth.c index e637da46a..f0eed0e6a 100644 --- a/webcit/auth.c +++ b/webcit/auth.c @@ -336,7 +336,7 @@ void extract_link(char *target_buf, int target_size, char *rel, char *source_buf /* * 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) { @@ -386,13 +386,14 @@ 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; } @@ -403,30 +404,19 @@ void do_openid_login(void) } /* - * 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) { diff --git a/webcit/webcit.c b/webcit/webcit.c index 1aea8de37..258bdce15 100644 --- a/webcit/webcit.c +++ b/webcit/webcit.c @@ -141,9 +141,10 @@ void addurls(char *url) 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 } }