{"id":28381834,"url":"https://github.com/opf/omniauth-openid_connect-providers","last_synced_at":"2025-06-25T04:31:34.863Z","repository":{"id":23988339,"uuid":"27371652","full_name":"opf/omniauth-openid_connect-providers","owner":"opf","description":"Offers a means to configure OmniAuth OpenIDConnect providers comfortably.","archived":false,"fork":false,"pushed_at":"2023-10-20T08:30:37.000Z","size":38,"stargazers_count":3,"open_issues_count":0,"forks_count":5,"subscribers_count":16,"default_branch":"dev","last_synced_at":"2025-06-22T00:57:49.476Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/opf.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2014-12-01T09:17:13.000Z","updated_at":"2024-06-18T07:36:50.000Z","dependencies_parsed_at":"2022-08-22T09:10:35.315Z","dependency_job_id":"d64097f9-9e75-44a3-9ded-1f8ce46606f3","html_url":"https://github.com/opf/omniauth-openid_connect-providers","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/opf/omniauth-openid_connect-providers","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opf%2Fomniauth-openid_connect-providers","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opf%2Fomniauth-openid_connect-providers/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opf%2Fomniauth-openid_connect-providers/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opf%2Fomniauth-openid_connect-providers/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/opf","download_url":"https://codeload.github.com/opf/omniauth-openid_connect-providers/tar.gz/refs/heads/dev","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opf%2Fomniauth-openid_connect-providers/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261805120,"owners_count":23212303,"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":"2025-05-30T04:06:32.752Z","updated_at":"2025-06-25T04:31:34.844Z","avatar_url":"https://github.com/opf.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Omniauth::OpenidConnect::Providers\n\nThis gem offers a convenient way to configure different OmniAuth OpenIDConnect providers.\nIt comes with preconfigured providers for Heroku and Google which take care of the necessary details.\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'omniauth-openid_connect-providers', git: 'git@github.com:finnlabs/omniauth-openid_connect-providers.git',\n                                         branch: 'dev'\n```\n\nAnd then execute:\n\n    $ bundle\n\nWhile used in conjunction with `openid_connect` it does not technically depend on it.\n\n## Usage\n\nOmniAuth expects an options hash when registering a provider. For instance:\n\n```ruby\nRails.application.config.middleware.use OmniAuth::Builder do\n  provider :openid_connect,\n           name: 'google',\n           scope: [:email, :openid, :profile]\n           client_options: {\n               host: 'accounts.google.com',\n               identifier: 'myapp',\n               secret: 'mysecret'\n               redirect_uri: 'https://example.org/auth/google/callback',\n               authorization_endpoint: '/o/oauth2/auth',\n               token_endpoint: '/o/oauth2/token',\n               userinfo_endpoint: 'https://www.googleapis.com/plus/v1/people/me/openIdConnect'\n           }\nend\n```\n\nWith this gem you can make this a bit easier by using the respective provider or even a generic one:\n\n```ruby\nRails.application.config.middleware.use OmniAuth::Builder do\n  config = {\n    identifier: 'myapp',\n    secret: 'mysecret',\n    redirect_uri: 'https://example.org/auth/google/callback'\n  }\n  p = OmniAuth::OpenIDConnect::Google.new 'google', config\n\n  provider :openid_connect, p.to_h\nend\n```\n\nYou can still pass arbitrary client options inside the configuration to override default values or add new ones.\n\n### Generic Providers\n\n`Google` is just one of the available specific providers with custom options to make OpenIDConnect work with Google.\nIn general you can use the generic `OmniAuth::OpenIDConnect::Provider` class in the same way.\n\n```ruby\nOmniAuth::OpenIDConnect::Provider.new 'myservice', config\n```\n\n### Base Redirect URI\n\nYou can configure a base redirect URI to use for all providers.\n\n```ruby\nOmniAuth::OpenIDConnect::Providers.configure base_redirect_uri: 'https://example.org/'\n```\n\nThis way you can also omit the redirect URI in the provider specific configuration.\nThe default redirect URI is constructed using the base URI. If your provider's redirect URI\nis different from the default (`/auth/\u003cname\u003e/callback`) you can still override it on a per-provider basis\neither directly in the configuration or as an option.\n\n```ruby\np = OmniAuth::OpenIDConnect::Provider.new 'test', config, base_redirect_uri: 'https://example.net'\n```\n\nThis way the configuration can omit the redirect URI and instead one will be generated using the default schema\nwhich results in `https://example.net/auth/test/callback` here.\nThe difference to configuring the base redirect URI via `Providers` is that it is not global but only applies\nto the created provider instance.\n\n### Custom Options\n\nThe options in the root level of the hash given to OmniAuth cannot be extended through the configuration hash by default.\nBut if you want a provider to accept additional options there you can configure them using `OmniAuth::OpenIDConnect::Providers.configure`.\nThis way your provider will also accept the given options which are optional if ending with a `?` and required otherwise,\nmeaning an error will be raised if they are missing.\n\n```ruby\nOmniAuth::OpenIDConnect::Providers.configure custom_options: [:icon?, :display_name]\n\nconfig = {\n  display_name: 'My App'\n  identifier: 'myapp',\n  secret: 'mysecret',\n  redirect_uri: 'https://example.org/auth/google/callback'\n}\np = OmniAuth::OpenIDConnect::Google.new 'google', config\n\nexpect(p.to_h).to include('display_name')\n```\n\nNote that this as everything in `Providers` is a global configuration applying to all Provider instances.\n\n## Contributing\n\n1. Fork it ( http://github.com/\u003cmy-github-username\u003e/omniauth-openid_connect-providers/fork )\n2. Create your feature branch (`git checkout -b my-new-feature`)\n3. Commit your changes (`git commit -am 'Add some feature'`)\n4. Push to the branch (`git push origin my-new-feature`)\n5. Create new Pull Request\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopf%2Fomniauth-openid_connect-providers","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopf%2Fomniauth-openid_connect-providers","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopf%2Fomniauth-openid_connect-providers/lists"}