lardcanoe

lardcanoe

Using ash_authentication for generic OAuth2 connections

I am using ash_auth for password/google registration/signup.

I was looking into also using it to let a user connect to a 3rd party service so I can track tokens, but I do NOT want to enable registration or signup for that.

This doesn’t seem to be a use case that ash auth currently allows. True? I should just use assent directly?

Marked As Solved

zachdaniel

zachdaniel

Creator of Ash

While it might be possible to make that work, I know that it was not designed/tested for that kind of use case. I think a case could be made that it can/should be added to ash_auth, but for now I’d assume it’s not on the table. Perhaps open an issue on the repo to track that as a feature request? I imagine that if I or @jimsynz want to do something similar that we’re going to want to reuse all the goodies in AshAuthentication instead of hand rolling it from scratch.

PRs welcome for this kind of feature, although want to run it by @jimsynz as well :slight_smile:

Also Liked

lardcanoe

lardcanoe

It dawned on me after a bit of tinkering that ash_auth wasn’t gonna be the right approach anyway for me. I have a model where a User can be part of multiple Organizations, and I need to tie the refresh_tokens to a UserOrg, not a User. That was going to mean I would need to have the UserOrg also be an identity for ash_auth, which just wasn’t right (since I would be forced to define a strategy).

Ultimately, assent was like ~30 lines of code spread across the router, controller, and a tiny OAuth module. (Plus a new resource to store the tokens).

Thank you for the feedback!

Last Post!

ajst7les

ajst7les

@jimsynz I was wondering if this was on the roadmap?

Where Next?

Popular in Questions Top

vegabook
I’m brand new to Phoenix and I have stripped one of the demo applications to the bone. I just want to get an svg up on the screen. Here i...
New
stefanchrobot
What’s the safe way to decode a JSON string into a struct? I want to avoid calling String.to_atom. Jason.decode can give me a map with st...
New
9mm
I am constructing a JSON object (map) and I need to conditionally set a field. I’m trying to write proper elixir-way code… and I’m at a l...
New
fireproofsocks
Forgive me if this is obvious, but how does one delete a database record WITHOUT selecting it first? Ecto.Repo — Ecto v3.14.0 has exampl...
New
belgoros
I’m not a pro in using Regex and can’t figure out why the following behaviour happens, especially if we take into account the difference ...
New
sergio_101
I am VERY much an elixir newbie. I have taken one elixir course and one phoenix course on Udemy. During that course, I saw the instructor...
New
SoCreat
i’m a new one to elixir which editor can i use vs code? or atom? Thanks! :smiley:
New

Other popular topics Top

dokuzbir
I want to highlight html closing tags when i click a html tag. That works in .html files but doesnt work for html.eex templates. How can...
New
Darmani72
If I have a post route which an argument: post /my_post_route/:my_param1, MyController.my_post_handler How would get the post params ...
New
dogweather
I wrote this comment on r/haskell, and it’s not popular there. :wink: But I think I’m on to something… Haskell reminds me of Java, and e...
New
AstonJ
Seen any cool LiveView demos, sample apps or examples? Please post them here! :003:
New
dblack
I’ve got an issue with an app and I’ve no idea of how to troubleshoot it. I’m hoping someone here might have seen something similar. I p...
New
sergio
Kind of like when jquery came out, it was super necessary. Existing drag and drop libraries have a bunch of baggage to support old browse...
New

We're in Beta

About us Mission Statement