{"id":4066,"date":"2010-09-28T23:59:36","date_gmt":"2010-09-28T14:59:36","guid":{"rendered":"http:\/\/ke-tai.org\/blog\/?p=4066"},"modified":"2010-09-29T00:55:55","modified_gmt":"2010-09-28T15:55:55","slug":"opensocialoauthframework","status":"publish","type":"post","link":"http:\/\/ke-tai.org\/blog\/2010\/09\/28\/opensocialoauthframework\/","title":{"rendered":"\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u3092\u4f7f\u3063\u3066Opensocial\u306eOAuth\u8a8d\u8a3c\u3092\u901a\u3059\u5834\u5408\u306e\u30cf\u30de\u308a\u3069\u3053\u308d"},"content":{"rendered":"<p>\u8fd1\u9803\u6d41\u884c\u306eOpensocial\u30cd\u30bf\u3067\u3059\u3002<\/p>\n<p>mixi\u30a2\u30d7\u30ea\u3084\u30e2\u30d0\u30b2\u30fc\u306a\u3069\u3067\u30bd\u30fc\u30b7\u30e3\u30eb\u30b2\u30fc\u30e0\u3092\u4f5c\u308b\u306b\u306fOpensocial\u306eOAuth\u8a8d\u8a3c\u3067\u3001\u7f72\u540d\u3092\u30c1\u30a7\u30c3\u30af\u3059\u308b\u3068\u3044\u3046\u51e6\u7406\u304c\u3042\u308a\u307e\u3059\u3002<\/p>\n<p>\u30ea\u30af\u30a8\u30b9\u30c8\u306eURL\u3084\u30d1\u30e9\u30e1\u30fc\u30bf\u306a\u3069\u304b\u3089\u3001\u30a2\u30af\u30bb\u30b9\u306e\u59a5\u5f53\u6027\u3092\u30c1\u30a7\u30c3\u30af\u3059\u308b\u3068\u3044\u3046\u3082\u306e\u306a\u306e\u3067\u3059\u304c\u3001\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u3092\u4f7f\u3063\u3066\u3044\u308b\u3068\u30cf\u30de\u308b\u3053\u3068\u304c\u3042\u308b\u306e\u3067\u3001\u30e1\u30e2\u4ee3\u308f\u308a\u306b\u66f8\u3044\u3066\u304a\u304d\u307e\u3059\u3002<\/p>\n<p class=\"spacer\">&nbsp;<\/p>\n<p>\u4f8b\u3048\u3070CakePHP\u306a\u3069\u30d5\u30ec\u30fc\u30e0\u30ef\u30fc\u30af\u306e.htaccess\u3067\u306f\u3053\u306e\u3088\u3046\u306a\u5f62\u306b\u306a\u3063\u3066\u3044\u308b\u3053\u3068\u304c\u3042\u308a\u307e\u3059\u3002<br \/>\n\u3053\u306emod_rewrite\u306e\u51e6\u7406\u304c\u300curl\u300d\u3068\u3044\u3046GET\u30d1\u30e9\u30e1\u30fc\u30bf\u3092\u4ed8\u3051\u3066\u7f72\u540d\u8a8d\u8a3c\u3092\u30a8\u30e9\u30fc\u306b\u3057\u3066\u3057\u307e\u3046\u306e\u3067\u3059\u3002<\/p>\n<pre class=\"super-pre-small\"><\/code>RewriteRule ^(.*)$ index.php?url=$1 [QSA,L]<\/code><\/pre>\n<p class=\"spacer\">&nbsp;<\/p>\n<p>\u56de\u907f\u3059\u308b\u306b\u306f\u7c21\u5358\u3067\u3001$_GET\u304b\u3089unset\u3057\u3066\u3084\u308c\u3070OK\u3067\u3059\u3002<\/p>\n<pre class=\"super-pre-small\"><code>\/\/ \u4f59\u8a08\u306a\u30d1\u30e9\u30e1\u30fc\u30bf\u3092unset\u3059\u308b\r\nunset($_GET['url']);\r\n\r\n\/\/Build a request object from the current request\r\n$request = OAuthRequest::from_request(null, null, array_merge($_GET, $_POST));\r\n<\/code><\/pre>\n<p>\u53c2\u8003\uff1a\u3000<a href=\"http:\/\/developer.mixi.co.jp\/appli\/spec\/pc\/make_request\/validating_signed_requests\" target=\"_blank\">mixi Developer Center\u3000\u7f72\u540d\u4ed8\u304d\u30ea\u30af\u30a8\u30b9\u30c8\u306e\u691c\u8a3c<\/a> <small>[developer.mixi.co.jp]<\/small><\/p>\n<p class=\"spacer\">&nbsp;<\/p>\n<p>\u30e2\u30d0\u30a4\u30eb\u306a\u3069\u3067consumer key\u3092\u4f7f\u3063\u305f\u8a8d\u8a3c\u3067\u306f\u3001OAuth.php\u3067\u306f$_SERVER[&#8216;QUERY_STRING&#8217;]\u3092\u4f7f\u3063\u3066\u3044\u308b\u306e\u3067\u3001\u6b21\u306e\u3088\u3046\u306b\u4e00\u5ea6\u3070\u3089\u3057\u3066\u518d\u69cb\u7bc9\u3067\u3044\u3051\u307e\u3057\u305f\u3002<\/p>\n<pre class=\"super-pre-small\"><code>parse_str($_SERVER['QUERY_STRING'], $query_arr);\r\nunset($query_arr['url']);\r\n$_SERVER['QUERY_STRING'] = http_build_query($query_arr);<\/code><\/pre>\n<p class=\"spacer\">&nbsp;<\/p>\n<p>\u30e2\u30d0\u30a4\u30eb\u7248\u306e\u53c2\u8003\u30b3\u30fc\u30c9\u3082\u3053\u3053\u306b\u66f8\u304d\u305f\u3044\u3068\u3053\u308d\u3067\u3059\u304c\u3001\u5404\u793e\u3068\u3082\u30e2\u30d0\u30a4\u30eb\u7248\u306e\u60c5\u5831\u306f\u306a\u305c\u304b\u975e\u516c\u958b\u3089\u3057\u3044\u306e\u3067\u81ea\u91cd\u3057\u3066\u304a\u304d\u307e\u3059\u3002<\/p>\n<p>\u4e0a\u8a18\u306fPHP\u306e\u4f8b\u3067\u3059\u304c\u3001\u57fa\u672c\u3069\u306e\u8a00\u8a9e\u3067\u3082\u5909\u308f\u3089\u306a\u3044\u306f\u305a\u3067\u3059\u3002<\/p>\n<p class=\"spacer\">&nbsp;<\/p>\n<p><strong><em>\u95a2\u9023\uff1a<\/em><\/strong><\/p>\n<ul>\n<li><em><a href=\"http:\/\/ke-tai.org\/blog\/2010\/09\/27\/rubykaigi2010keitaiopensocial\/\">\u65e5\u672cRuby\u4f1a\u8b702010\u306e\u767a\u8868\u3067\u4f7f\u308f\u308c\u305f\u30b9\u30e9\u30a4\u30c9\u8cc7\u6599\u300cRuby on Rails\u3067\u306f\u3058\u3081\u308b\u643a\u5e2f\u96fb\u8a71\u5411\u3051\u30aa\u30fc\u30d7\u30f3\u30bd\u30fc\u30b7\u30e3\u30eb\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u958b\u767a\u300d<\/a><\/em> <img decoding=\"async\" style=\"border:0px\" src=\"http:\/\/b.hatena.ne.jp\/entry\/image\/small\/http:\/\/ke-tai.org\/blog\/2010\/09\/27\/rubykaigi2010keitaiopensocial\/\" alt=\"\" \/><\/li>\n<li><em><a href=\"http:\/\/ke-tai.org\/blog\/2010\/09\/22\/atmarkit11\/\">\u30b1\u30fc\u30bf\u30a4\u5411\u3051Flash\u30bd\u30fc\u30b7\u30e3\u30eb\u30b2\u30fc\u30e0\u958b\u767a\u306b\u95a2\u3059\u308b\u9023\u8f09\u8a18\u4e8b\u300c\u3044\u307e\u3055\u3089Flash Lite 1.1\u3092\u4f7f\u3046\u305f\u3081\u306e\u57fa\u790e\u77e5\u8b58\u300d<\/a><\/em> <img decoding=\"async\" style=\"border:0px\" src=\"http:\/\/b.hatena.ne.jp\/entry\/image\/small\/http:\/\/ke-tai.org\/blog\/2010\/09\/22\/atmarkit11\/\" alt=\"\" \/><\/li>\n<li><em><a href=\"http:\/\/ke-tai.org\/blog\/2010\/05\/14\/reviewmixiopensocial\/\">\u30d6\u30c3\u30af\u30ec\u30d3\u30e5\u30fc\uff1amixi\u30a2\u30d7\u30ea\u3092\u3064\u304f\u308d\u3046!OpenSocial\u3067\u5b66\u3076\u30bd\u30fc\u30b7\u30e3\u30eb\u30a2\u30d7\u30ea<\/a><\/em> <img decoding=\"async\" style=\"border:0px\" src=\"http:\/\/b.hatena.ne.jp\/entry\/image\/small\/http:\/\/ke-tai.org\/blog\/2010\/05\/14\/reviewmixiopensocial\/\" alt=\"\" \/><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>\u8fd1\u9803\u6d41\u884c\u306eOpensocial\u30cd\u30bf\u3067\u3059\u3002 mixi\u30a2\u30d7\u30ea\u3084\u30e2\u30d0\u30b2\u30fc\u306a\u3069\u3067\u30bd\u30fc\u30b7\u30e3\u30eb\u30b2\u30fc\u30e0\u3092\u4f5c\u308b\u306b\u306fOpensocial\u306eOAuth\u8a8d\u8a3c\u3067\u3001\u7f72\u540d\u3092\u30c1\u30a7\u30c3\u30af\u3059\u308b\u3068\u3044\u3046\u51e6\u7406\u304c\u3042\u308a\u307e\u3059\u3002 \u30ea\u30af\u30a8\u30b9\u30c8\u306eURL\u3084\u30d1\u30e9\u30e1\u30fc\u30bf\u306a\u3069\u304b\u3089\u3001 [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[10],"tags":[577,195],"_links":{"self":[{"href":"http:\/\/ke-tai.org\/blog\/wp-json\/wp\/v2\/posts\/4066"}],"collection":[{"href":"http:\/\/ke-tai.org\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/ke-tai.org\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/ke-tai.org\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/ke-tai.org\/blog\/wp-json\/wp\/v2\/comments?post=4066"}],"version-history":[{"count":19,"href":"http:\/\/ke-tai.org\/blog\/wp-json\/wp\/v2\/posts\/4066\/revisions"}],"predecessor-version":[{"id":4085,"href":"http:\/\/ke-tai.org\/blog\/wp-json\/wp\/v2\/posts\/4066\/revisions\/4085"}],"wp:attachment":[{"href":"http:\/\/ke-tai.org\/blog\/wp-json\/wp\/v2\/media?parent=4066"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/ke-tai.org\/blog\/wp-json\/wp\/v2\/categories?post=4066"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/ke-tai.org\/blog\/wp-json\/wp\/v2\/tags?post=4066"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}