{"id":18982389,"url":"https://github.com/defactosoftware/ueberauth_oidc","last_synced_at":"2025-04-19T20:05:54.173Z","repository":{"id":43789434,"uuid":"188424837","full_name":"DefactoSoftware/ueberauth_oidc","owner":"DefactoSoftware","description":"An Ueberauth strategy for generic OpenID Connect authentication.","archived":false,"fork":false,"pushed_at":"2023-11-06T17:07:41.000Z","size":81,"stargazers_count":2,"open_issues_count":2,"forks_count":9,"subscribers_count":12,"default_branch":"master","last_synced_at":"2024-10-13T06:57:27.071Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Elixir","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/DefactoSoftware.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-05-24T13:17:07.000Z","updated_at":"2022-10-15T18:28:15.000Z","dependencies_parsed_at":"2022-07-21T09:48:23.256Z","dependency_job_id":null,"html_url":"https://github.com/DefactoSoftware/ueberauth_oidc","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DefactoSoftware%2Fueberauth_oidc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DefactoSoftware%2Fueberauth_oidc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DefactoSoftware%2Fueberauth_oidc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DefactoSoftware%2Fueberauth_oidc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DefactoSoftware","download_url":"https://codeload.github.com/DefactoSoftware/ueberauth_oidc/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223713507,"owners_count":17190498,"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-11-08T16:13:20.084Z","updated_at":"2024-11-08T16:13:20.727Z","avatar_url":"https://github.com/DefactoSoftware.png","language":"Elixir","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Überauth OIDC\n\n\u003e OIDC Provider for Ueberauth using the OpenIDProvider library.\n\nThis library provides an OIDC strategy for Ueberauth using the information in the `/.well-known` url.\nOnly supports `authorization_code` flow for now.\nHas optional support for `/userinfo` endpoints, and has the option to get a user's `uid_field` from either the claims or the userinfo.\n\n*Originally based on rng2/ueberauth_oidc but has now diverged significantly from the source*\n\n## Installation\n\n1. Add `:ueberauth_oidc` to your list of dependencies in `mix.exs`:\n\n    ```elixir\n    def deps do\n      [{:ueberauth_oidc, git: \"https://github.com/DefactoSoftware/ueberauth_oidc.git\"}]\n    end\n    ```\n\n   Or if available in hex:\n\n   ```elixir\n    def deps do\n      [{:ueberauth_oidc, \"~\u003e 1.0\"}]\n    end\n   ```\n\n## Configuration\n\n1. Add OIDC to your Ueberauth configuration:\n\n    ```elixir\n    config :ueberauth, Ueberauth,\n      providers: [\n        oidc: { Ueberauth.Strategy.OIDC, [\n          default: [\n            # required, set to default provider you want to use\n            provider: :default_oidc,\n\n            # optional\n            uid_field: :sub\n          ],\n\n          # optional override for each provider\n          google: [uid_field: :email],\n          ...\n        ] }\n      ]\n    ```\n\n1. Update your provider configuration.\nSee [OpenIDConnect](https://hexdocs.pm/openid_connect/readme.html)\nfor a list of supported options.\n\n    ```elixir\n    config :ueberauth, Ueberauth.Strategy.OIDC,\n      # one or more providers\n      default_oidc: [\n        fetch_userinfo: true, # true/false\n        userinfo_uid_field: \"upn\", # only include if getting the user_id from userinfo\n        uid_field: \"sub\" # only include if getting the user_id from the claims\n        discovery_document_uri: \"https://oidc.example/.well-known/openid-configuration\",\n        client_id: \"client_id\",\n        client_secret: \"123456789\",\n        redirect_uri: \"https://your.url/auth/oidc/callback\",\n        response_type: \"code\",\n        scope: \"openid profile email\"\n      ],\n      ...\n    ```\n\n## Usage\n\n1. Include the Ueberauth plug in your controller:\n\n    ```elixir\n    defmodule MyApp.AuthController do\n      use MyApp.Web, :controller\n      plug Ueberauth\n      ...\n    end\n    ```\n\n1. Create the request and callback routes if you haven't already:\n\n    ```elixir\n    scope \"/auth\", MyApp do\n      pipe_through :browser\n\n      get \"/:unused\", AuthController, :request\n      get \"/:unused/callback\", AuthController, :callback\n    end\n    ```\n\n1. Your controller needs to implement callbacks to deal with `Ueberauth.Auth`\nand `Ueberauth.Failure` responses. For an example implementation see the\n[Ueberauth Example](https://github.com/ueberauth/ueberauth_example) application.\nNote that the `Ueberauth.Strategy.Info` struct stored in `Ueberauth.Auth`\nwill be empty. Use the information in `Ueberauth.Auth.Credentials` and\n`Ueberauth.Strategy.Extra` instead:\n\n   - `Ueberauth.Auth.Credentials` contains the `access_token` and related fields\n\n   - The `other` map in `Ueberauth.Auth.Credentials` contains `provider` and `user_info`\n\n   - `Ueberauth.Strategy.Extra` contains the raw claims, tokens and opts\n\n1.  Add `OpenIDConnect.Worker` with a provider list during application startup:\n\n\t  ```elixir\n    def start(_type, _args) do\n      ...\n      children = [\n        ...,\n        {OpenIDConnect.Worker, Application.get_env(:ueberauth, Ueberauth.Strategy.OIDC)},\n        ...\n      ]\n      ...\n      Supervisor.start_link(children, opts)\n    end\n    ```\n\n## Calling\n\nDepending on the configured url, you can initialize the request through:\n\n    /auth/oidc\n\nTo use another provider instead of the configured default, add the `oidc_provider` option:\n\n    /auth/oidc?oidc_provider=google\n\n## License\n\nPlease see [LICENSE](https://github.com/DefactoSoftware/ueberauth_oidc/blob/master/LICENSE)\nfor licensing details.\n\nLoosely based on [rng2/ueberauth_oidc](https://github.com/rng2/ueberauth_oidc).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdefactosoftware%2Fueberauth_oidc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdefactosoftware%2Fueberauth_oidc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdefactosoftware%2Fueberauth_oidc/lists"}