{"id":13507449,"url":"https://github.com/ueberauth/ueberauth_identity","last_synced_at":"2025-03-30T08:30:32.845Z","repository":{"id":50354676,"uuid":"45856940","full_name":"ueberauth/ueberauth_identity","owner":"ueberauth","description":"A username/password Strategy for Überauth","archived":false,"fork":false,"pushed_at":"2022-07-08T20:59:06.000Z","size":46,"stargazers_count":80,"open_issues_count":1,"forks_count":21,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-03-08T02:08:57.368Z","etag":null,"topics":["identity","strategy","ueberauth","ueberauth-strategies"],"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/ueberauth.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null}},"created_at":"2015-11-09T18:10:56.000Z","updated_at":"2024-10-17T20:54:20.000Z","dependencies_parsed_at":"2022-08-04T14:30:32.705Z","dependency_job_id":null,"html_url":"https://github.com/ueberauth/ueberauth_identity","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ueberauth%2Fueberauth_identity","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ueberauth%2Fueberauth_identity/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ueberauth%2Fueberauth_identity/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ueberauth%2Fueberauth_identity/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ueberauth","download_url":"https://codeload.github.com/ueberauth/ueberauth_identity/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246296388,"owners_count":20754625,"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":["identity","strategy","ueberauth","ueberauth-strategies"],"created_at":"2024-08-01T02:00:33.927Z","updated_at":"2025-03-30T08:30:32.546Z","avatar_url":"https://github.com/ueberauth.png","language":"Elixir","funding_links":[],"categories":["Authentication"],"sub_categories":[],"readme":"# Üeberauth Identity\n\n[![Build Status](https://travis-ci.org/ueberauth/ueberauth_identity.svg?branch=master)](https://travis-ci.org/ueberauth/ueberauth_identity)\n[![Module Version](https://img.shields.io/hexpm/v/ueberauth.svg)](https://hex.pm/packages/ueberauth)\n[![Hex Docs](https://img.shields.io/badge/hex-docs-lightgreen.svg)](https://hexdocs.pm/ueberauth/)\n[![Total Download](https://img.shields.io/hexpm/dt/ueberauth.svg)](https://hex.pm/packages/ueberauth)\n[![License](https://img.shields.io/hexpm/l/ueberauth.svg)](https://github.com/ueberauth/ueberauth/blob/master/LICENSE)\n[![Last Updated](https://img.shields.io/github/last-commit/ueberauth/ueberauth.svg)](https://github.com/ueberauth/ueberauth/commits/master)\n\n\u003e A simple username/password strategy for Überauth.\n\n## Installation\n\n1.  Add `:ueberauth_identity` to your list of dependencies in `mix.exs`:\n\n    ```elixir\n    def deps do\n      [\n        {:ueberauth_identity, \"~\u003e 0.3\"}\n      ]\n    end\n    ```\n\n2.  Add the strategy to your applications:\n\n    ```elixir\n    def application do\n      [\n        applications: [:ueberauth_identity]\n      ]\n    end\n    ```\n\n3.  Add Identity to your Überauth configuration:\n\n    ```elixir\n    config :ueberauth, Ueberauth,\n      providers: [\n        identity: {Ueberauth.Strategy.Identity, [\n          callback_methods: [\"POST\"]\n        ]}\n      ]\n    ```\n\n4.  Include the Überauth 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\n5.  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 \"/:provider\", AuthController, :request\n      get \"/:provider/callback\", AuthController, :callback\n      post \"/identity/callback\", AuthController, :identity_callback\n    end\n    ```\n\n6. Your request phase handler should implement a form or similar method to collect the required login information.\n\n7.  The controller callback should validate login information using the `Ueberauth.Auth` struct:\n\n    ```elixir\n    def identity_callback(%{assigns: %{ueberauth_auth: auth}} = conn, params) do\n      case validate_password(auth.credentials) do\n        :ok -\u003e\n          user = %{id: auth.uid, name: name_from_auth(auth), avatar: auth.info.image}\n          conn\n          |\u003e put_flash(:info, \"Successfully authenticated.\")\n          |\u003e put_session(:current_user, user)\n          |\u003e redirect(to: \"/\")\n        { :error, reason } -\u003e\n          conn\n          |\u003e put_flash(:error, reason)\n          |\u003e redirect(to: \"/\")\n      end\n    end\n    ```\n\nFor an example implementation see the [Überauth Example](https://github.com/ueberauth/ueberauth_example) application.\n\n## Nested form attributes\n\nSometimes it's convenient to nest the returned params under a namespace. For\nexample if you're using a \"user\" form, your params may come back as:\n\n```elixir\n%{ \"user\" =\u003e { \"email\" =\u003e \"my@email.com\" … }\n```\n\nIf you're using a nested set of attributes like this you'll need to let\nÜberauth Identity know about it. To do this set an option in your config:\n\n```elixir\nconfig :ueberauth, Ueberauth,\n  providers: [\n    identity: {Ueberauth.Strategy.Identity, [param_nesting: \"user\"]}\n  ]\n```\n\n## Params scrubbing\n\nBy default Überauth Identity will be changing empty values from the returned\nparams to nil.\nIf you want to disable that behaviour set the following option in your config:\n\n```elixir\nconfig :ueberauth, Ueberauth,\n  providers: [\n    identity: {Ueberauth.Strategy.Identity, [scrub_params: false]}\n  ]\n```\n\n## Calling\n\nDepending on the configured url you can initial the request through:\n\n    /auth/identity/callback\n\n## Copyright and License\n\nCopyright (c) 2015 Daniel Neighman\n\nReleased under the MIT License, which can be found in the repository in [LICENSE](./LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fueberauth%2Fueberauth_identity","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fueberauth%2Fueberauth_identity","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fueberauth%2Fueberauth_identity/lists"}