{"id":21892737,"url":"https://github.com/cgorshing/ueberauth_stackoverflow","last_synced_at":"2025-03-22T03:25:28.218Z","repository":{"id":62430629,"uuid":"108751626","full_name":"cgorshing/ueberauth_stackoverflow","owner":"cgorshing","description":"This is still not ready for general use (definitely alpha release). An issue with gzipped encoding still needs to be resolved. See the README file below.","archived":false,"fork":false,"pushed_at":"2020-06-17T01:39:00.000Z","size":14,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-02-28T14:14:29.360Z","etag":null,"topics":["elixir","stackexchange","stackexchange-api","stackoverflow","stackoverflow-api","ueberauth"],"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/cgorshing.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-10-29T16:38:23.000Z","updated_at":"2018-12-30T03:52:29.000Z","dependencies_parsed_at":"2022-11-01T20:20:26.457Z","dependency_job_id":null,"html_url":"https://github.com/cgorshing/ueberauth_stackoverflow","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/cgorshing%2Fueberauth_stackoverflow","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cgorshing%2Fueberauth_stackoverflow/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cgorshing%2Fueberauth_stackoverflow/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cgorshing%2Fueberauth_stackoverflow/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cgorshing","download_url":"https://codeload.github.com/cgorshing/ueberauth_stackoverflow/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244901452,"owners_count":20528940,"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":["elixir","stackexchange","stackexchange-api","stackoverflow","stackoverflow-api","ueberauth"],"created_at":"2024-11-28T12:59:24.873Z","updated_at":"2025-03-22T03:25:28.197Z","avatar_url":"https://github.com/cgorshing.png","language":"Elixir","readme":"# A Couple Quick Notes\nThis is not ready for public consumption yet. This is in\nalpha stage and there are some issues that need to be sorted out before it will\nbe ready for others to use. (i.e. handling gzipped compression). The gzipped\ncompression probably should be handled in hackney (which is what most of the\nueberauth strategies use). There is [an outstanding\nissue](https://github.com/benoitc/hackney/issues/155) for this and I'm looking\nat submitting a PR for this feature.\n\nSecondly - The Stack Exchange API does not return any email address for the\nuser. So if you are wanting to use this to get at that kind of information,\nyou might look else where or plan on asking the user for an email. See [this answer]( https://stackoverflow.com/questions/37026028/how-to-get-stackexchange-users-email-id-through-the-api).\n\n# Überauth StackOverflow\n\n\u003e StackOverflow OAuth2 strategy for Überauth.\n\n## Installation\n\n1. Setup your application at [Stack Apps](https://stackapps.com/apps/oauth/register).\n\n1. Add `:ueberauth_stackoverflow` to your list of dependencies in `mix.exs`:\n\n    ```elixir\n    def deps do\n      [{:ueberauth_stackoverflow, \"~\u003e 0.0.1\"}]\n    end\n    ```\n\n1. Add the strategy to your applications:\n\n    ```elixir\n    def application do\n      [applications: [:ueberauth_stackoverflow]]\n    end\n    ```\n\n1. Add StackOverflow to your Überauth configuration:\n\n    ```elixir\n    config :ueberauth, Ueberauth,\n      providers: [\n        stackoverflow: {Ueberauth.Strategy.StackOverflow, []}\n      ]\n    ```\n\n1.  Update your provider configuration:\n\n    ```elixir\n    config :ueberauth, Ueberauth.Strategy.StackOverflow.OAuth,\n      client_id: System.get_env(\"STACKOVERFLOW_CLIENT_ID\"),\n      client_secret: System.get_env(\"STACKOVERFLOW_CLIENT_SECRET\")\n    ```\n\n1.  Include the Überauth plug in your controller:\n\n    ```elixir\n    defmodule MyApp.AuthController do\n      use MyApp.Web, :controller\n\n      pipeline :browser do\n        plug Ueberauth\n        ...\n       end\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 \"/:provider\", AuthController, :request\n      get \"/:provider/callback\", AuthController, :callback\n    end\n    ```\n\n1. You controller needs to implement callbacks to deal with `Ueberauth.Auth` and `Ueberauth.Failure` responses.\n\nFor an example implementation see the [Überauth Example](https://github.com/ueberauth/ueberauth_example) application.\n\n## Calling\n\nDepending on the configured url you can initial the request through:\n\n    /auth/stackoverflow\n\nOr with options:\n\n    /auth/stackoverflow?scope=no_expiry\n\nBy default the requested scope is \"\". This provides \"an application to identify a user via the /me method\". See more at [StackOverflow's OAuth Documentation](http://api.stackexchange.com/docs/authentication#scope). Scope can be configured either explicitly as a `scope` query value on the request path or in your configuration:\n\n```elixir\nconfig :ueberauth, Ueberauth,\n  providers: [\n    stackoverflow: {Ueberauth.Strategy.StackOverflow, [default_scope: \"private_info no_expiry\"]}\n  ]\n```\n\nIt is also possible to disable the sending of the `redirect_uri` to StackOverflow. This is particularly useful\nwhen your production application sits behind a proxy that handles SSL connections. In this case,\nthe `redirect_uri` sent by `Ueberauth` will start with `http` instead of `https`, and if you configured\nyour StackOverflow OAuth application's callback URL to use HTTPS, StackOverflow will throw an `uri_missmatch` error.\n\nTo prevent `Ueberauth` from sending the `redirect_uri`, you should add the following to your configuration:\n\n```elixir\nconfig :ueberauth, Ueberauth,\n  providers: [\n    stackoverflow: {Ueberauth.Strategy.StackOverflow, [send_redirect_uri: false]}\n  ]\n```\n\n## License\n\nPlease see [LICENSE](https://github.com/cgorshing/ueberauth_stackoverflow/blob/master/LICENSE) for licensing details.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcgorshing%2Fueberauth_stackoverflow","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcgorshing%2Fueberauth_stackoverflow","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcgorshing%2Fueberauth_stackoverflow/lists"}