{"id":15468187,"url":"https://github.com/yhirano55/genkan","last_synced_at":"2025-08-20T21:17:36.426Z","repository":{"id":56873902,"uuid":"96223550","full_name":"yhirano55/genkan","owner":"yhirano55","description":":door::running:Genkan is authentication engine for Rails","archived":false,"fork":false,"pushed_at":"2017-09-15T01:35:27.000Z","size":68,"stargazers_count":13,"open_issues_count":1,"forks_count":1,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-06-20T17:57:04.709Z","etag":null,"topics":["omniauth","rails-engine","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/yhirano55.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}},"created_at":"2017-07-04T13:55:41.000Z","updated_at":"2019-09-16T15:44:45.000Z","dependencies_parsed_at":"2022-08-20T22:30:58.321Z","dependency_job_id":null,"html_url":"https://github.com/yhirano55/genkan","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/yhirano55/genkan","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yhirano55%2Fgenkan","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yhirano55%2Fgenkan/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yhirano55%2Fgenkan/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yhirano55%2Fgenkan/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yhirano55","download_url":"https://codeload.github.com/yhirano55/genkan/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yhirano55%2Fgenkan/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261466859,"owners_count":23162573,"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":["omniauth","rails-engine","ruby"],"created_at":"2024-10-02T01:40:24.633Z","updated_at":"2025-06-29T08:32:52.310Z","avatar_url":"https://github.com/yhirano55.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cimg width=\"350\" src=\"https://user-images.githubusercontent.com/15371677/27876034-6f54c860-61f0-11e7-8ebb-0623227ee491.png\"\u003e\n\n[![Build Status](https://travis-ci.org/yhirano55/genkan.svg?branch=master)](https://travis-ci.org/yhirano55/genkan)\n[![Gem Version](https://badge.fury.io/rb/genkan.svg)](https://badge.fury.io/rb/genkan)\n\nGenkan is authentication engine for Rails\n\n## Installation\n\n```ruby\ngem 'genkan'\n\n# Add any omniauth provider\ngem 'omniauth-google-oauth2'\ngem 'omniauth-facebook'\n```\n\nAnd then execute:\n\n```bash\n$ bundle\n```\n\n## Getting started\n\n```bash\n$ bin/rails g genkan:install --model User\n      create  config/initializers/genkan.rb\n      create  db/migrate/20170705074103_create_users.rb\n      create  app/models/user.rb\n      insert  app/controllers/application_controller.rb\n       route  mount Genkan::Engine, at: '/'\n      create  app/views/genkan/sessions/new.html.erb\n\n$ bin/rails db:migrate\n```\n\nSome setup you must do manually if you haven't yet:\n\n1. Ensure you have edited config/initializers/genkan.rb.\n   For example:\n\n  ```ruby\n  Genkan.configure do |config|\n    config.user_class_name   = 'User'\n    config.auto_acceptance   = true\n    config.cookie_expiration = 1.week\n  end\n\n  Genkan::Engine.configure do |config|\n    config.middleware.use OmniAuth::Builder do\n      # Add omniauth-google-oauth2 to Gemfile:\n      #   gem 'omniauth-google-oauth2'\n      provider(\n        :google_oauth2,\n        ENV['GOOGLE_OAUTH_CLIENT_ID'],\n        ENV['GOOGLE_OAUTH_CLIENT_SECRET'],\n        {\n          name:       'google',\n          scope:      'email',\n          hd:         'host-domain.com',\n          verify_iss: false,\n        }\n      )\n    end\n  end\n  ```\n\n2. Ensure you have defined root_url to *something* in your config/routes.rb.\n   For example:\n\n  ```ruby\n  root to: \"home#index\"\n  ```\n\n3. Ensure you have flash messages in app/views/layouts/application.html.erb.\n   For example:\n\n  ```ruby\n  \u003cp class=\"notice\"\u003e\u003c%= notice %\u003e\u003c/p\u003e\n  \u003cp class=\"alert\"\u003e\u003c%= alert %\u003e\u003c/p\u003e\n  ```\n\n4. Ensure you have set logout link in app/views/layouts/application.html.erb.\n   For example:\n\n  ```ruby\n  \u003c% if logged_in? %\u003e\n    \u003cp\u003e\u003c%= link_to \"logout\", genkan.logout_path %\u003e\u003c/p\u003e\n  \u003c% end %\u003e\n  ```\n\n## Debugging\n\nYou can check on dummy server:\n\n```bash\n$ bundle\n$ bin/rails db:setup\n$ GOOGLE_OAUTH_CLIENT_ID=YOUR_ID GOOGLE_OAUTH_CLIENT_SECRET=YOUR_SECRET bin/rails s\n```\n\nHow to create google client id and secret:\n\n- [Creating a Google API Console project and client ID  |  Google Sign-In for Websites  |  Google Developers](https://developers.google.com/identity/sign-in/web/devconsole-project).\n\n## License\nThe gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyhirano55%2Fgenkan","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyhirano55%2Fgenkan","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyhirano55%2Fgenkan/lists"}