{"id":13427685,"url":"https://github.com/beenhero/omniauth-weibo-oauth2","last_synced_at":"2025-05-16T11:05:49.141Z","repository":{"id":2719620,"uuid":"3714158","full_name":"beenhero/omniauth-weibo-oauth2","owner":"beenhero","description":"OmniAuth Oauth2 strategy for weibo.com.","archived":false,"fork":false,"pushed_at":"2023-03-29T08:05:09.000Z","size":35,"stargazers_count":135,"open_issues_count":2,"forks_count":49,"subscribers_count":12,"default_branch":"master","last_synced_at":"2025-04-12T08:15:57.240Z","etag":null,"topics":[],"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/beenhero.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2012-03-14T03:25:03.000Z","updated_at":"2024-06-24T06:58:22.000Z","dependencies_parsed_at":"2023-07-06T22:32:25.209Z","dependency_job_id":null,"html_url":"https://github.com/beenhero/omniauth-weibo-oauth2","commit_stats":{"total_commits":51,"total_committers":14,"mean_commits":3.642857142857143,"dds":0.6274509803921569,"last_synced_commit":"9197025dc995470a94ac80837e2d5b13bedb0ea1"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/beenhero%2Fomniauth-weibo-oauth2","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/beenhero%2Fomniauth-weibo-oauth2/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/beenhero%2Fomniauth-weibo-oauth2/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/beenhero%2Fomniauth-weibo-oauth2/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/beenhero","download_url":"https://codeload.github.com/beenhero/omniauth-weibo-oauth2/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254227583,"owners_count":22035664,"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":[],"created_at":"2024-07-31T01:00:37.854Z","updated_at":"2025-05-16T11:05:44.131Z","avatar_url":"https://github.com/beenhero.png","language":"Ruby","funding_links":[],"categories":["User","用户"],"sub_categories":["Omniauth"],"readme":"# Status\n[![Gem Version](https://img.shields.io/gem/v/omniauth-weibo-oauth2.svg)][gem]\n[![Security Check](https://hakiri.io/github/beenhero/omniauth-weibo-oauth2/master.svg)][security]\n[![Percentage of issues still open](https://isitmaintained.com/badge/open/beenhero/omniauth-weibo-oauth2.svg)][OpenIssues]\n[![Average time to resolve an issue](https://isitmaintained.com/badge/resolution/beenhero/omniauth-weibo-oauth2.svg)][IssueResolution]\n[![Build Status](https://travis-ci.org/NeverMin/omniauth-weibo-oauth2.svg?branch=master)][travis]\n\n[gem]: https://rubygems.org/gems/omniauth-weibo-oauth2\n[security]: https://hakiri.io/github/beenhero/omniauth-weibo-oauth2/master\n[OpenIssues]: https://isitmaintained.com/project/beenhero/omniauth-weibo-oauth2\n[IssueResolution]: https://isitmaintained.com/project/beenhero/omniauth-weibo-oauth2\n[travis]: https://travis-ci.org/NeverMin/omniauth-weibo-oauth2\n\n\n\n# OmniAuth Weibo OAuth2\n\nWeibo OAuth2 Strategy for OmniAuth 1.0.\n\nRead Weibo OAuth2 docs for more details: https://open.weibo.com/wiki/授权机制\n\n## Security\n\n- CVE-2019-17268 [Issue #36](https://github.com/beenhero/omniauth-weibo-oauth2/issues/36)\n\n## Installing\n\nAdd to your `Gemfile`:\n\n```ruby\ngem 'omniauth-weibo-oauth2'\n```\n\nThen `bundle install`.\n\nOr install it yourself as:\n\n    $ gem install omniauth-weibo-oauth2\n\n## Usage\n\n`OmniAuth::Strategies::Weibo` is simply a Rack middleware. Read the OmniAuth 1.0 docs for detailed instructions: https://github.com/intridea/omniauth.\n\nHere's a quick example, adding the middleware to a Rails app in `config/initializers/omniauth.rb`:\n\n```ruby\nRails.application.config.middleware.use OmniAuth::Builder do\n  provider :weibo, ENV['WEIBO_KEY'], ENV['WEIBO_SECRET']\nend\n```\n## Configuration\n\nyou can set up redirect_uri in `omniauth.rb` as following:\n\n```ruby\nprovider :weibo, ENV['WEIBO_KEY'], ENV['WEIBO_SECRET'],\n         token_params: {redirect_uri: \"http://127.0.0.1:3000/auth/weibo/callback\" }\n```\n\n## Authentication Option\n* **image_size**: This option defines the size of the user's image in *Authentication Hash* (info['image']). Valid options include `small` (30x30), `middle` (50x50), `large` (180x180) and `original` (the size of the image originally uploaded). Default is `middle`.\n\n```ruby\nRails.application.config.middleware.use OmniAuth::Builder do\n  provider :weibo, ENV['WEIBO_KEY'], ENV['WEIBO_SECRET'], :image_size =\u003e 'original'\nend\n```\n\n## Authentication Hash\n\nHere's an example *Authentication Hash* available in `request.env['omniauth.auth']`:\n\n```ruby\n{\n  :provider =\u003e 'weibo',\n  :uid =\u003e '1234567890',\n  :info =\u003e {\n    :nickname =\u003e 'beenhero',\n    :name =\u003e 'beenhero',\n    :location =\u003e '浙江 杭州',\n    :image =\u003e 'http://tp4.sinaimg.cn/1640099215/50/1287016234/1',\n    :description =\u003e '移步twitter@beenhero',\n    :urls =\u003e {  :Blog =\u003e 'http://beenhero.com'\n                :Weibo =\u003e 'http://weibo.com/beenhero'\n    },\n  },\n  :credentials =\u003e {\n    :token =\u003e '2.00JjgzmBd7F...', # OAuth 2.0 access_token, which you may wish to store\n    :expires_at =\u003e 1331780640, # when the access token expires (if it expires)\n    :expires =\u003e true # if you request `offline_access` this will be false\n  },\n  :extra =\u003e {\n    :raw_info =\u003e {\n      ... # data from /2/users/show.json, check by yourself\n    }\n  }\n}\n```\n*PS.* Built and tested on MRI Ruby 2.4.2\n\n## Build\u0026pulish gem\n```\ngem build omniauth-weibo-oauth2.gemspec\n```\n\n```\ngem push omniauth-weibo-oauth2-VERSION.gem\n```\n\n## Contributing\n\n1. Fork it\n2. Create your feature branch (`git checkout -b my-new-feature`)\n3. Commit your changes (`git commit -am 'Added some feature'`)\n4. Push to the branch (`git push origin my-new-feature`)\n5. Create new Pull Request\n\n## License\nCopyright (c) 2012-2017 by Bin He, See [LICENSE][] for details.\n\n[license]: LICENSE.md\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbeenhero%2Fomniauth-weibo-oauth2","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbeenhero%2Fomniauth-weibo-oauth2","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbeenhero%2Fomniauth-weibo-oauth2/lists"}