{"id":40228123,"url":"https://github.com/yeuem1vannam/devise-fireauth","last_synced_at":"2026-01-19T22:35:22.751Z","repository":{"id":40232040,"uuid":"148404033","full_name":"yeuem1vannam/devise-fireauth","owner":"yeuem1vannam","description":"Firebase as centralized authentication service behind the devise","archived":false,"fork":false,"pushed_at":"2024-06-30T08:48:52.000Z","size":111,"stargazers_count":33,"open_issues_count":6,"forks_count":8,"subscribers_count":4,"default_branch":"main","last_synced_at":"2024-07-01T20:38:56.760Z","etag":null,"topics":["devise","firebase-auth","idtoken","jwt"],"latest_commit_sha":null,"homepage":null,"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/yeuem1vannam.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","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":"2018-09-12T01:39:09.000Z","updated_at":"2024-07-01T14:47:23.000Z","dependencies_parsed_at":"2023-01-28T23:46:15.891Z","dependency_job_id":null,"html_url":"https://github.com/yeuem1vannam/devise-fireauth","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/yeuem1vannam/devise-fireauth","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yeuem1vannam%2Fdevise-fireauth","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yeuem1vannam%2Fdevise-fireauth/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yeuem1vannam%2Fdevise-fireauth/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yeuem1vannam%2Fdevise-fireauth/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yeuem1vannam","download_url":"https://codeload.github.com/yeuem1vannam/devise-fireauth/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yeuem1vannam%2Fdevise-fireauth/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28587244,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-19T20:45:59.482Z","status":"ssl_error","status_checked_at":"2026-01-19T20:45:41.500Z","response_time":67,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["devise","firebase-auth","idtoken","jwt"],"created_at":"2026-01-19T22:35:22.692Z","updated_at":"2026-01-19T22:35:22.743Z","avatar_url":"https://github.com/yeuem1vannam.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Devise Firebase authentication\n\nA strategy to use Google Firebase as the authentication service behind the already famous authentication solution: [devise](https://github.com/plataformatec/devise)\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem \"devise-fireauth\"\n```\n\nAnd then execute:\n```bash\n$ bundle install\n```\n\n## Usage\n\n- Get your Firebse's Web API Key, then add a configuration section into the devise's initializer\n```ruby\n# config/initializers/devise.rb\nDevise.setup do |config|\n  # Other configuration\n  config.authentication_keys = [\n    # Other keys, ex: email\n    :id_token\n  ]\n  config.strip_whitespace_keys = [\n    # Other keys, ex: email\n    :id_token\n  ]\n  config.fireauth do |f|\n    f.api_key = \"YoUR-weB-aPi-KEy\"\n    f.project_id = \"firebase-project-id\"\n    f.token_key = :id_token\n  end\nend\n```\n- Modify your `User` model\n  - Use `firebase_authenticatable` strategy for devise\n  - Implement a class method `User.from_firebase` to find the corresponding user from your system. Example\n```ruby\n# app/models/user.rb\nclass User \u003c ApplicationRecord\n  devise :firebase_authenticatable\n  class \u003c\u003c self\n    def from_firebase(auth_hash)\n      # Find or create new user with auth_hash[\"email\"]\n      # Update user name with auth_hash[\"displayName\"]\n      # Return a user to allow login, or nil to reject\n    end\n  end\nend\n```\n\n- Restart the server\n- From now on, you can authenticate with the API via firebase `idToken` by one of:\n  - Add params `id_token` to URL query\n  - Attach the header `Authorization: Bearer #{id_token}` to the request\n\n## Development\n\nAfter checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.\n\nTo install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/yeuem1vannam/devise-fireauth. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).\n\n## Code of Conduct\n\nEveryone interacting in the `devise-fireauth` project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/yeuem1vannam/devise-fireauth/blob/master/CODE_OF_CONDUCT.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyeuem1vannam%2Fdevise-fireauth","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyeuem1vannam%2Fdevise-fireauth","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyeuem1vannam%2Fdevise-fireauth/lists"}