# # openid.rb: Insert OpenID delegation information. $Revision: 1.10 $ # # Copyright (C) 2005, TADA Tadashi # You can redistribute it and/or modify it under GPL2. # @openid_config = (Struct.const_defined?("OpenIdConfig") ? Struct::OpenIdConfig : Struct.new("OpenIdConfig", :openid, :openid2, :x_xrds_location)) if /^(?:latest|conf|saveconf)$/ =~ @mode then @openid_list = { # service => @openid_config.new( # [openid.server, openid.delegate(replace as account name)], # openid # [openid2.provider, openid2.local_id(replace as account name)], # openid2 # 'X-XRDS-Location(replace as account name)'), 'Hatena' => @openid_config.new(['https://www.hatena.ne.jp/openid/server', 'http://www.hatena.ne.jp//']), 'livedoor' => @openid_config.new(['http://auth.livedoor.com/openid/server', 'http://profile.livedoor.com/']), 'LiveJournal' => @openid_config.new(['http://www.livejournal.com/openid/server.bml', 'http://.livejournal.com/']), 'OpenID.ne.jp' => @openid_config.new( ['http://www.openid.ne.jp/user/auth', 'http://.openid.ne.jp'], nil, 'http://.openid.ne.jp/user/xrds'), 'TypeKey' => @openid_config.new(['http://www.typekey.com/t/openid/', 'http://profile.typekey.com//']), 'Vox' => @openid_config.new(['http://www.vox.com/services/openid/server', 'http://.vox.com/']), 'myopenid.com' => @openid_config.new( ['http://www.myopenid.com/server', 'http://.myopenid.com'], # openid ['http://www.myopenid.com/server', 'http://.myopenid.com'], # openid2 "http://www.myopenid.com/xrds?username="), 'claimID.com' => @openid_config.new( ['http://openid.claimid.com/server', 'http://openid.claimid.com/'], nil, #['http://openid.claimid.com/server', 'http://openid.claimid.com/'], 'http://claimid.com//xrds'), 'Personal Identity Provider (PIP)' => @openid_config.new( ['http://pip.verisignlabs.com/server', 'http://.pip.verisignlabs.com/'], ['http://pip.verisignlabs.com/server', 'http://.pip.verisignlabs.com/'], 'http://pip.verisignlabs.com/user//yadisxrds'), 'Yahoo! Japan' => @openid_config.new( nil, ['https://open.login.yahooapis.jp/openid/op/auth', 'https://me.yahoo.co.jp/a/'], 'http://open.login.yahoo.co.jp/openid20/www.yahoo.co.jp/xrds'), 'Yahoo!' => @openid_config.new( nil, ['https://open.login.yahooapis.com/openid/op/auth', 'https://me.yahoo.com/a/'], 'http://open.login.yahooapis.com/openid20/www.yahoo.com/xrds'), 'Launchpad' => @openid_config.new(['https://login.launchpad.net/+openid', 'https://login.launchpad.net/+id/']), } if @conf['openid.service'] and @conf['openid.id'] then openid_service = @openid_list[@conf['openid.service']] openid_id = @conf['openid.id'] result = '' add_header_proc do result = <<-HTML if openid_service.openid HTML result << <<-HTML if openid_service.openid2 HTML result << <<-HTML if openid_service.x_xrds_location HTML result.gsub( /^\t{2}/, '' ) end if openid_service end end add_conf_proc( 'openid', @openid_conf_label ) do if @mode == 'saveconf' then @conf['openid.service'] = @cgi.params['openid.service'][0] @conf['openid.id'] = @cgi.params['openid.id'][0] end options = '' @openid_list.each_key do |key| options << %Q|\n| end <<-HTML

#{@openid_service_label}

#{@openid_service_desc}

#{@openid_id_label}

#{@openid_id_desc}

HTML end