GoogleアカウントのOpenID
OP Identifier
https://www.google.com/accounts/o8/id
Claimed Identifier
https://www.google.com/accounts/o8/id?id=xxxxxxxxx
ちなみにGoogle Apps
OP Identifier
https://www.google.com/accounts/o8/site-xrds?hd=example.com
OP Identifier
https://www.google.com/accounts/o8/id
Claimed Identifier
https://www.google.com/accounts/o8/id?id=xxxxxxxxx
ちなみにGoogle Apps
OP Identifier
https://www.google.com/accounts/o8/site-xrds?hd=example.com
ただし、Premier、Educationのみで、デフォルトでは無効になっている。
Note: The Federated Login Service is disabled by default for Google Apps Premier and Education Editions. The domain admin can enable it from the Control Panel at http://www.google.com/a/cpanel//SetupIdp.
Google Apps ? Google Code
やりたかったこと。
SVNParentPathを設定すると、下位のディレクトリを個別に設定しなくて楽なのですが、SVNParentPath自体にアクセスすると403になる。
SVNListParentPathを設定すると下位ディレクトリ一覧を表示できる。
しかし、AuthzSVNAccessFileと相性が悪くLocationを「/」で終わらせないとダメ。
そうなると、/reposでアクセスした際に404となるので、Redirectさせる。
以上、こんな感じになりました。
/etc/httpd/conf.d/subversion.conf
LoadModule dav_svn_module modules/mod_dav_svn.so LoadModule authz_svn_module modules/mod_authz_svn.so
/etc/httpd/conf.d/vhosts-example.com.conf
<VirtualHost *:80>
# 省略
<Location /repos>
DAV svn
SVNParentPath /var/www/repos
AuthzSVNAccessFile /var/www/repos/http.access
</Location>
</VirtualHost>
<VirtualHost *:443>
# 省略
RedirectMatch ^(/repos)$ $1/
<Location /repos/>
DAV svn
SVNParentPath /var/www/repos
SVNListParentPath On
AuthzSVNAccessFile /var/www/repos/ssl.access
AuthType Basic
AuthName "example.com Subversion Repository"
AuthUserFile /var/www/htpasswd
AuthGroupFile /dev/null
Require valid-user
</Location>
</VirtualHost>
/var/www/repos/http.access
[/] * = r [hoge:/] * =
/var/www/repos/ssl.access
[groups] admin = cockok devel = cockok,abc system = redmine [/] @admin = rw @system = r * = [hoge:/] @devel = rw
0.9以降で利用できるOpenID。
trunk版を使っているので利用できるはずなのですが、チェックボックスが有効にならない。
ruby-openidが必要らしい。
# gem install ruby-openid
OpenIDでのアカウント登録は許可しないので、パスワード空のアカウントを作成し、OpenID URLを指定。
直で自分のOpenID URLを指定しないとダメそうです。
xAuthの申請が通ったので試してみた。
via:ウノウラボ Unoh Labs: PECL::oauthでxAuth
require_once 'HTTP/Request2.php';
require_once 'HTTP/OAuth/Consumer.php';
$consumer_key = 'YOUR-CONSUMER-KEY';
$consumer_secret = 'YOUR-CONSUMER-SECRET';
$username = 'YOUR-USER-NAME';
$password = 'YOUR-PASSWORD';
$xauth_access_token_url = 'https://api.twitter.com/oauth/access_token';
$params = array(
'x_auth_username' => $username,
'x_auth_password' => $password,
'x_auth_mode' => 'client_auth',
);
try {
$request = new HTTP_Request2();
$request->setConfig('ssl_verify_peer', false);
$consumerRequest = new HTTP_OAuth_Consumer_Request();
$consumerRequest->accept($request);
$oauth = new HTTP_OAuth_Consumer($consumer_key, $consumer_secret);
$oauth->accept($consumerRequest);
$response = $oauth->sendRequest($xauth_access_token_url,
$params,
HTTP_Request2::METHOD_POST);
if ($response->getStatus() !== 200) {
throw new Exception($response->getBody(), $response->getStatus());
}
} catch (Exception $e) {
echo 'Error';
exit;
}
// oauth_token=xxx&oauth_token_secret=xxx&
// user_id=xxx&screen_name=xxx&x_auth_expires=0
parse_str($response->getBody(), $access_token_info);
// oauth_token, oauth_token_secret, user_id, screen_name,
// x_auth_expires
var_dump($access_token_info);
取得したauth_tokenとtoken_secretを利用してtwitterにポスト。
require_once 'Services/Twitter.php';
require_once 'HTTP/OAuth/Consumer.php';
try {
$twitter = new Services_Twitter();
$oauth = new HTTP_OAuth_Consumer($consumer_key,
$consumer_secret,
$auth_token,
$token_secret);
$twitter->setOAuth($oauth);
$twitter->statuses->update('なうなう');
} catch (Services_Twitter_Exception $e) {
echo (string)$e;
exit;
}
Services_Twitter::sendOAuthRequest()の$methodはPOSTしないと「Incorrect signature」でちゃいますね。
もし、OAuthを利用できない特別な理由がある場合、deprecatedな方法となりますが、Alexにアプリケーション名をメールして、sourceパラメータで指定された該当のアプリケーション名を受け取るよう設定を頼みましょう。
Twitter API ? TwitterまとめWiki
というわけで送ってみたけど、以下の返信がきたよ。
Hi XXXX,
Unfortunately, applications that do not use OAuth authentication cannot have source parameters at this time. We are working to improve OAuth so mobile applications can easily integrate it, and I sincerely apologize for the inconvenience in the meantime.
Thanks for your understanding,
Brian
残念。
xAuthで変更できそうなのでそっち試し中。
Twitter API Wiki / Twitter REST API Method: oauth access_token for xAuth