{"id":15620707,"url":"https://github.com/fdeschenes/oauth2-fb-exchange-token-strategy","last_synced_at":"2025-04-28T13:42:41.829Z","repository":{"id":56322070,"uuid":"312831510","full_name":"fdeschenes/oauth2-fb-exchange-token-strategy","owner":"fdeschenes","description":"OAuth2 Strategy for Facebook Long-Lived User Access Tokens","archived":false,"fork":false,"pushed_at":"2024-03-14T00:37:31.000Z","size":10,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-08T14:17:06.731Z","etag":null,"topics":["facebook","facebook-graph-api","facebook-graph-api-login","oauth2","oauth2-strategy","ruby"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fdeschenes.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"MIT-LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-11-14T14:19:39.000Z","updated_at":"2025-01-08T03:15:35.000Z","dependencies_parsed_at":"2024-10-22T05:46:46.603Z","dependency_job_id":null,"html_url":"https://github.com/fdeschenes/oauth2-fb-exchange-token-strategy","commit_stats":{"total_commits":7,"total_committers":3,"mean_commits":"2.3333333333333335","dds":0.4285714285714286,"last_synced_commit":"2cf95a895b3bbdb20aec4da518f4bc5950fe8581"},"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fdeschenes%2Foauth2-fb-exchange-token-strategy","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fdeschenes%2Foauth2-fb-exchange-token-strategy/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fdeschenes%2Foauth2-fb-exchange-token-strategy/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fdeschenes%2Foauth2-fb-exchange-token-strategy/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fdeschenes","download_url":"https://codeload.github.com/fdeschenes/oauth2-fb-exchange-token-strategy/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251321387,"owners_count":21570729,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["facebook","facebook-graph-api","facebook-graph-api-login","oauth2","oauth2-strategy","ruby"],"created_at":"2024-10-03T09:02:10.539Z","updated_at":"2025-04-28T13:42:41.805Z","avatar_url":"https://github.com/fdeschenes.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# OAuth2 Strategy for Facebook Long-Lived User Access Tokens\n\n[![Gem Version](https://badge.fury.io/rb/oauth2_fb_exchange_token_strategy.svg)](https://badge.fury.io/rb/oauth2_fb_exchange_token_strategy)\n[![Coverage Status](https://coveralls.io/repos/github/fdeschenes/oauth2-fb-exchange-token-strategy/badge.svg?branch=master)](https://coveralls.io/github/fdeschenes/oauth2-fb-exchange-token-strategy?branch=master)\n[![Maintainability](https://api.codeclimate.com/v1/badges/34355bd39e55a168918a/maintainability)](https://codeclimate.com/github/fdeschenes/oauth2-fb-exchange-token-strategy/maintainability)\n[![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](https://opensource.org/licenses/MIT)\n\nAs per Facebook, default User and Page access tokens are short-lived, expiring in hours, however, you can [exchange a short-lived token for a long-lived token](https://developers.facebook.com/docs/facebook-login/access-tokens/refreshing/).\n\nThis gem adds a new strategy to the excellent [oauth2](https://github.com/oauth-xx/oauth2) gem that can be used to do just that.\n\n## Installation\n\n```\ngem install oauth2_fb_exchange_token_strategy\n```\n\nOr inside Gemfile\n\n```\ngem 'oauth2_fb_exchange_token_strategy'\n```\n\n## Usage Examples\n\n```ruby\nrequire 'oauth2'\nrequire 'oauth2_fb_exchange_token_strategy'\nclient = OAuth2::Client.new('client_id', 'client_secret', site: 'https://graph.facebook.com/v9.0', authorize_url: 'https://www.facebook.com/v8.0/dialog/oauth', token_url: 'oauth/access_token')\n\nshort_lived_token = client.auth_code.get_token('authorization_code_value', redirect_uri: 'http://example.org/oauth2/callback')\ntoken = client.fb_exchange_token.get_token(short_lived_token.token)\n# =\u003e OAuth2::AccessToken\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffdeschenes%2Foauth2-fb-exchange-token-strategy","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffdeschenes%2Foauth2-fb-exchange-token-strategy","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffdeschenes%2Foauth2-fb-exchange-token-strategy/lists"}