éçºä¸ã®ã¢ããªã§ã¯OpenIDãå©ç¨ãã¦èªè¨¼ãããã¨ã«ããã®ã§ãæå§ãã«ã¯ã¦ãªèªè¨¼API使ã£ã¦ã¿ã¾ããã æºå 1. APIãã¼ã®åå¾ ã¯ã¦ãªèªè¨¼APIã®ãã¼ã¸ã§APIãã¼ãåå¾ãã¦ãèªè¨¼ãå©ç¨ããã¢ããªã±ã¼ã·ã§ã³ã®æ å ±ãç»é²ãã³ã¼ã«ããã¯URLã¯ãä¸è¨ã®ããã«è¨å®ï¼localhostã§ã大ä¸å¤«ã§ããï¼ãhttp://localhost:3000/main/hatena_callback 2. ã©ã¤ãã©ãªã¤ã³ã¹ãã¼ã« gem install hatenaapiauth å®è£ # application.rb protected def authorize unless session[:user] flash[:notice] = "ãã°ã¤ã³ãã¦ãã ãã" redirect_to :action => "login" end end before_filterã§å©ç¨ããã¡ã½ããã追å ãã¦ã
{{#tags}}- {{label}}
{{/tags}}