I have this code I use to get avatars from Facebook... if auth.info.image.present? user.update_attribute(:avatar, URI.parse(auth.info.image)) end When I try to load the code now I get this error: A RuntimeError occurred in authentications#create: redirection forbidden: http://graph.facebook.com/672086173/picture?type=square -> https://fbcdn-profile-a.akamaihd.net/hprofile-ak-prn2/t5.0-1/1086349_67
callback = "http://localhost:3001/auth/todo/callback" app_id = "70b18783971c5405907241c1b45616a26c704dd6406cf1c6743ab61c4615eb00" secret = "1dbd541132ca2bdeb9fe83b41d24490b2be445c30fd1856e5914f6d343c4a71b" client = OAuth2::Client.new(app_id, secret, site: "http://localhost:3000/") client.auth_code.authorize_url(redirect_uri: callback) access = client.auth_code.get_token('b77df49142317a6a42ea12412d
自社サービスにAPIを実装する事ってあまりないですよね。 kamadoのプロダクトも現在はAPIは公開してません。 もし提供するのであれば、簡易的な方法ですが、ユーザーテーブルにtokenカラムを追加して、API用のルーティングを作成する…という方法が考えられると思います。 しかし、その実装時間でより良いAPIが実装出来るとしたら素晴らしいですよね。 そこで紹介したいのがgem doorkeeperです。 日本語の記事が見当たらなかったので記事にしました。 github https://github.com/applicake/doorkeeper gem doorkeeperってどんな機能があるのか? 簡単に説明すると、 ・アプリケーションの管理機能 ・アプリケーションの承認管理 ・スコープの設定 いってしまえば、Facebook API(に近い実装)そのまま実装出来ます。 しかもOAu
There are several changes to the latest OAuth 2.0 spec which requires a couple of changes to 2 models which you are REQUIRED to update manually if you are supporting OAuth2. github.com/pelle/oauth-plugin/blob/master/lib/generators/active_record/oauth_provider_templates/oauth2_token.rb class Oauth2Token < AccessToken attr_accessor :state def as_json(options={}) d = {:access_token=>token, :token_typ
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く