Viewing 15 replies - 1 through 15 (of 32 total)
  • Thread Starter michaeltyson

    (@michaeltyson)

    I also noticed the xrds seems to have the /author/Michael url as the ID, which isn’t what I want – I want to use my blog URL as the ID; I don’t want to advertise the /author/Michael address as mine is a single user blog.

    Can I change this?

    <!-- OpenID Provider Service (0) -->
    		<Service priority="0">
    			<Type>https://specs.openid.net/auth/2.0/signon</Type>
    			<URI>https://michael.tyson.id.au/?openid_server=1</URI>
    			<LocalID>https://michael.tyson.id.au/author/Michael/</LocalID>
    		</Service>
    Thread Starter michaeltyson

    (@michaeltyson)

    Answering my own question (the auxiliary question, not my main problem). This fixes the identity thing, so that it uses the blog URL instead of the author URL for the owner.

    Still busted at blogger.com, though.

    --- ../Downloads/openid/server.php	2008-10-27 19:07:18.000000000 +1100
    +++ server.php	2008-11-03 20:50:56.000000000 +1100
    @@ -57,12 +57,12 @@
     				0 => array(
     					'Type' => array(array('content' => 'https://specs.openid.net/auth/2.0/signon')),
     					'URI' => trailingslashit(get_option('siteurl')) . '?openid_server=1',
    -					'LocalID' => get_author_posts_url($user->ID),
    +					'LocalID' => openid_server_user_url($user)
     				),
     				1 => array(
     					'Type' => array(array('content' => 'https://openid.net/signon/1.1')),
     					'URI' => trailingslashit(get_option('siteurl')) . '?openid_server=1',
    -					'openid:Delegate' => get_author_posts_url($user->ID),
    +					'openid:Delegate' => openid_server_user_url($user)
     				),
     			);
     		}
    @@ -112,6 +112,21 @@
    
     /**
    + * Obtain the user URL
    + *
    + * @param user The user object, as returned by openid_server_requested_user(), etc
    + * @return The URL of the user - either the author URL, or the blog URL if the user is the blog owner
    + */
    +function openid_server_user_url($user) {
    +	if ( $user->user_login == get_option('openid_blog_owner') ) {
    +		return get_bloginfo('url');
    +	} else {
    +		return get_author_posts_url($user->ID);
    +	}
    +}
    +
    +
    +/**
      * Process an OpenID Server request.
      *
      * @uses apply_filters() Calls 'openid_server_auth_response' before sending the authentication response.
    @@ -166,7 +181,7 @@
    
     	// get some user data
     	$user = wp_get_current_user();
    -	$author_url = get_author_posts_url($user->ID);
    +	$author_url = openid_server_user_url($user);
     	$id_select = ($request->identity == 'https://specs.openid.net/auth/2.0/identifier_select');
    
     	// bail if user does not have access to OpenID provider
    @@ -254,7 +269,7 @@
     	$user = wp_get_current_user();
     	if (!$user) return false;
    
    -	$identifier = get_author_posts_url($user->ID);
    +	$identifier = openid_server_user_url($user);
     	return ($claimed == $identifier);
     }
    
    @@ -338,7 +353,7 @@
     			}
     		} else  {
     			$server = trailingslashit(get_option('siteurl')) . '?openid_server=1';
    -			$identifier = get_author_posts_url($user->ID);
    +			$identifier = openid_server_user_url($user);
    
     			echo '
     			<link rel="openid2.provider" href="'.$server.'" />

    You don’t want to do those changes in server.php… it’s supposed to list your author URL when you’re the blog owner (it’s delegating to your personal OpenID URL). You’ll notice that when you set no blog owner, it lists something different in the XRDS document.

    I can’t seem to replicate the problem you had on blogger… I just left a comment on the same post without any problem, using the same configuration with the OpenID plugin. Were you getting that error message on WordPress or Blogger?

    Thread Starter michaeltyson

    (@michaeltyson)

    Hi!

    Thanks for the reply =)

    Hmm.. I may very well be missing a fundamental point here. Does a ‘provider’ like this WP plugin provide the OpenID, or do I need to sign up for one at myopenid.com first, and then specify that somewhere? I was under the impression that my blog now provides my id, and I don’t need to use another provider, but perhaps I misunderstood.

    As for the blogger problem – the error was on blogger. So, the steps I took were:

    1. open https://www.blogger.com/comment.g?blogID=1504961872775281277&postID=1449318644434822126
    2. type some text, and fill in the captcha
    3. select ‘openid’, and enter ‘https://michael.tyson.id.au&#8217; in the field
    4. click ‘publish your comment’

    The blogger page reloads, then just beneath the openid input is an exclamation-mark symbol and “Incorrect OpenID url”.

    However, if I enter the author address as the openid, it goes through to my site, where I confirm, then the comment is posted successfully.

    This suggests to me that the WP plugin is definitely providing the OpenID… But with the author URL, which is definitely not what I want (hence my changes to server.php, which didn’t actually work at blogger, but worked on the official openID test page)

    Same for me – only works with /author/name, but not with blog url itself.
    Trying to authorisate on livejournal.com
    The error:
    * no_identity_server: The provided URL doesn’t declare its OpenID identity server.

    On Blogger, when I try to post with openid “https://jehy.ru/articles/&#8221;, I see error
    Incorrect OpenID url

    @michael: that is definitely odd. This may not make a difference, but it’s worth a shot…. go to your WP options page here. Find the three options that start with “openid_xrds_” and change all of their values to 0 (the number zero). That will just cause the plugin to include less stuff in your XRDS document which certain OpenID libraries sometimes choke on. Then try commenting on Blogger and let me know if that causes any change.

    @jehy: For some reason the plugin isn’t actually advertising the OpenID authentication services on your “/articles/”. I’ll have to look into that.

    Thread Starter michaeltyson

    (@michaeltyson)

    Damn, nope, Blogger is still reporting ‘Incorrect OpenID url’ after changing and saving those values.

    So, Blogger works for you? It seems odd that the OpenID test suite passes my OpenID, but Blogger fails on it.

    Thank you, wnorris, please do.
    Yeah, I just tried deactivating all other plugins – it didn’r help so it’s not a conflict.
    OPENID test reports all ok…

    Hm. I played with wordpress and after a little blogger began to authorise me…
    I did’t do anything specially for OPENID…
    So it’s not plugin’s or server’s problem – seems like the reason is some kind of shifting of internal wordpress settings.

    @jehy: that’s very strange, but good that it’s fixed. If you ever figure out exactly what fixed it, please let us all know.

    Same problem again.
    I have wordpress 2.6.5 and I don’t know what caused this bug to appear again. It really annoyed me because I couldn’t use my openid accounts anymore.
    However, server doesn’t declare rel links to openid server, but actually works.

    Adding openid rel links really helped me.
    Here’s a mini-plugin for quick fix: https://jehy.ru/articles/2008/12/14/wordpress-openid-plugin-fix/

    I hope you could discover and fix this bug soon.

    P.S. Anyway, guys, thanks for great work.
    Will you add optional openid settings (name,avatar, birth date and other) to wordpress openid account? It would be nice.

    If you only need that plugin to use your own URL as your opedID, the very simple method I found is to sign up with myOpenID, create a persona in your profile (name and website displayed). Then in header.php of your theme, within the <head></head> tags just add:

    <link rel="openid.server"
            href="https://www.myopenid.com/server" />
      <link rel="openid.delegate"
            href="https://youraccount.myopenid.com/" />
      <link rel="openid2.local_id"
            href="https://youraccount.myopenid.com" />
      <link rel="openid2.provider"
            href="https://www.myopenid.com/server" />
      <meta http-equiv="X-XRDS-Location"
            content="https://www.myopenid.com/xrds?username=youraccount.myopenid.com" />

    putting your username in “youraccount”.

    It works perfectly. Tested while leaving comments on Blogger.

    Easy, and no plugins.

    You misunderstood the situation – this plugin is a fix for openid plugin. Please, at least watch tags careful.
    Code you posted here won’t do any good to people with this problem with openid plugin.

    OFFTOPIC

    By the way – it’s absolutely incorrect to write openid declaration to theme file – it’s almost same as modifying core files. Do you want your openid to disappear when you change theme?
    If you want to the declaration of your own openid server, you can use mini-plugin like this:

    <?
    /*
    Plugin Name: openid-rel
    Plugin URI: https://jehy.ru/articles/2008/12/14/wordpress-openid-plugin-fix
    Description: Mini plugin for displaying of fucken openid rel link
    Version: 0.01
    Author: Jehy
    Author URI: https://jehy.ru*/
    
    function add_openid_rel()
    {?>
    <link rel="openid.server"
            href="https://www.myopenid.com/server" />
      <link rel="openid.delegate"
            href="https://youraccount.myopenid.com/" />
      <link rel="openid2.local_id"
            href="https://youraccount.myopenid.com" />
      <link rel="openid2.provider"
            href="https://www.myopenid.com/server" />
      <meta http-equiv="X-XRDS-Location"
            content="https://www.myopenid.com/xrds?username=youraccount.myopenid.com" />
    <?
    }
    add_action('wp_head', 'add_openid_rel');
    ?>

    It’s absolutely the same as your code, but you don’t have to write it in your theme file. People have some really strange prejudice about plugins. If you can do smth with plugin, do it with plugin – wordpress hooks system will do you no harm ??

Viewing 15 replies - 1 through 15 (of 32 total)
  • The topic ‘Unable to use blog address as openid on Blogger, but …/author/Michael works’ is closed to new replies.