aiwaiwa
Ueberauth: github nickname only; callback domain
- If I’m only interested in the username (nickname) at github, is there a way to achieve that? Basically I’m not interested in emails, I just need to verify that I’m dealing with a few administrators via github auth.
This is my current config:
config :ueberauth, Ueberauth,
providers: [
github:
{Ueberauth.Strategy.Github,
[
default_scope: "user:email",
callback_path: "/auth/github/callback"
]}
]
- I also wonder if this
callback_pathcould be somehow made relative to the current domain?
Most Liked Responses
linusdm
I’m not sure what you’re asking regarding your first point. I’d advice to do some trial and error, and see what the minimal scope is you can get away with, no?
Regarding your second point: I’m not sure how you could do this with Ueberauth, because of the way it needs to be configured in one of your config scripts. But I suggest to take a look at Assent instead. IMO it’s much easier to configure Assent. I used to depend on Ueberauth for OAuth integration, but I switched because I found Assent to be easier to configure and understand. The downside is that it requires you to wire up your own controller (but that doesn’t require much glue code anyway). Assent itself has a very simple API, and can be used independently from Pow (I don’t use Pow, but I do use Assent together with the phx.gen.auth code).
I have a simple demo repo online (phx_gen_auth_meetes_assent) that shows how to integrate Assent. See this specific line to see how you’d configure Assent to have the correct callback path, using verified routes:
https://github.com/linusdm/phx_gen_auth_meets_assent/blob/main/lib/my_app_web/controllers/auth_controller.ex#L32
Popular in Questions
Other popular topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #javascript
- #podcasts
- #code-sync
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #advent-of-code
- #elixirconf-us
- #distillery
- #processes
- #forms
- #api
- #metaprogramming
- #security
- #performance








