{"id":15370147,"url":"https://github.com/danschultzer/phoenix_oauth2_provider","last_synced_at":"2025-04-05T21:10:23.553Z","repository":{"id":19174362,"uuid":"86203247","full_name":"danschultzer/phoenix_oauth2_provider","owner":"danschultzer","description":"Get an OAuth 2 provider running in your phoenix with controllers, views and models in just two minutes","archived":false,"fork":false,"pushed_at":"2023-02-16T15:55:02.000Z","size":150,"stargazers_count":84,"open_issues_count":10,"forks_count":44,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-03-29T20:08:03.726Z","etag":null,"topics":["oauth2-provider","oauth2-server","phoenix"],"latest_commit_sha":null,"homepage":null,"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/danschultzer.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"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},"funding":{"github":"danschultzer"}},"created_at":"2017-03-26T02:55:58.000Z","updated_at":"2024-04-19T11:32:18.000Z","dependencies_parsed_at":"2024-10-16T11:01:13.938Z","dependency_job_id":null,"html_url":"https://github.com/danschultzer/phoenix_oauth2_provider","commit_stats":{"total_commits":107,"total_committers":5,"mean_commits":21.4,"dds":"0.10280373831775702","last_synced_commit":"8f34e303681aed58f8cd8de2b80f5e71e17c5898"},"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danschultzer%2Fphoenix_oauth2_provider","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danschultzer%2Fphoenix_oauth2_provider/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danschultzer%2Fphoenix_oauth2_provider/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/danschultzer%2Fphoenix_oauth2_provider/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/danschultzer","download_url":"https://codeload.github.com/danschultzer/phoenix_oauth2_provider/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247399885,"owners_count":20932880,"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":["oauth2-provider","oauth2-server","phoenix"],"created_at":"2024-10-01T13:40:06.231Z","updated_at":"2025-04-05T21:10:23.528Z","avatar_url":"https://github.com/danschultzer.png","language":"Elixir","funding_links":["https://github.com/sponsors/danschultzer"],"categories":[],"sub_categories":[],"readme":"# PhoenixOauth2Provider\n\n[![Build Status](https://travis-ci.org/danschultzer/phoenix_oauth2_provider.svg?branch=master)](https://travis-ci.org/danschultzer/phoenix_oauth2_provider) [![hex.pm](http://img.shields.io/hexpm/v/phoenix_oauth2_provider.svg?style=flat)](https://hex.pm/packages/phoenix_oauth2_provider) [![hex.pm downloads](https://img.shields.io/hexpm/dt/phoenix_oauth2_provider.svg?style=flat)](https://hex.pm/packages/phoenix_oauth2_provider)\n\nGet an OAuth 2.0 provider running in your Phoenix app with schema modules and templates in just two minutes.\n\n## Installation\n\nAdd PhoenixOauth2Provider to your list of dependencies in `mix.exs`:\n\n```elixir\ndef deps do\n  [\n    # ...\n    {:phoenix_oauth2_provider, \"~\u003e 0.5.1\"}\n    # ...\n  ]\nend\n```\n\nRun `mix deps.get` to install it.\n\n## Getting started\n\nInstall ExOauthProvider first:\n\n```bash\nmix ex_oauth2_provider.install\n```\n\nFollow the instructions to update `config/config.exs`.\n\nSet up routes:\n\n```elixir\ndefmodule MyAppWeb.Router do\n  use MyAppWeb, :router\n  use PhoenixOauth2Provider.Router, otp_app: :my_app\n\n  # ...\n\n  pipeline :protected do\n    # Require user authentication\n  end\n\n  scope \"/\" do\n    pipe_through :api\n\n    oauth_api_routes()\n  end\n\n  scope \"/\" do\n    pipe_through [:browser, :protected]\n\n    oauth_routes()\n  end\n\n  # ...\nend\n```\n\nThat's it! The following OAuth 2.0 routes will now be available in your app:\n\n```text\noauth_authorize_path  GET    /oauth/authorize         AuthorizationController :new\noauth_authorize_path  POST   /oauth/authorize         AuthorizationController :create\noauth_authorize_path  GET    /oauth/authorize/:code   AuthorizationController :show\noauth_authorize_path  DELETE /oauth/authorize         AuthorizationController :delete\noauth_token_path      POST   /oauth/token             TokenController :create\noauth_token_path      POST   /oauth/revoke            TokenController :revoke\n```\n\nPlease read the [ExOauth2Provider](https://github.com/danschultzer/ex_oauth2_provider) documentation for further customization.\n\n## Configuration\n\n### Templates\n\nTo generate views and templates run:\n\n```bash\nmix phoenix_oauth2_provider.gen.templates\n```\n\nSet up the PhoenixOauth2Provider configuration with `:web_module`:\n\n```elixir\nconfig :my_app, PhoenixOauth2Provider,\n  web_module: MyAppWeb\n```\n\n### Current resource owner\n\nSet up what key in the plug conn `assigns` that PhoenixOauth2Provider should use to fetch the current resource owner.\n\n```elixir\nconfig :my_app, PhoenixOauth2Provider,\n  current_resource_owner: :current_user\n```\n\n## LICENSE\n\n(The MIT License)\n\nCopyright (c) 2017-2019 Dan Schultzer \u0026 the Contributors\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanschultzer%2Fphoenix_oauth2_provider","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdanschultzer%2Fphoenix_oauth2_provider","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdanschultzer%2Fphoenix_oauth2_provider/lists"}