session_identifier compilation on AshAuthentication update
When updating AshAuthenticationPhoenix for the security advisory, I also updated AshAuthentication, and that also produces a compile-time error, which is not mentioned in the advisory.
Does this just go in the top level of the
authentication do
block? i.e.
Solution:Jump to solution
the preferred solution would be to turn on
require_token_presence_for_authentication? true
13 Replies
I will update the advisory to explain this one
and I will update that error message
Solution
the preferred solution would be to turn on
require_token_presence_for_authentication? true
Which essentially involves doing full server-side session management.
But if you have a reason not to enable that, then yes you'd add
session_identifier :jti
into the authentication do
block
The CVE now explains this, as does the errorHey Zach! I just came across this and tried the preferred solution, but it's breaking half of my test suite, lol.
IIRC there is a thread here talking about this somewhere as well
session_identifier :jti
seems to work fine.
Just to confirm: I tried putting require_token_presence_for_authentication? true
inside the following block:
I'll try to find it.in general tho, you gotta share error messages etc.
I don't have a lot of details yet. All I'm seeing is forbidden errors across pretty much all GraphQL operations, e.g.
With a valid bearer token for an admin user that should be able to run this operation.
With
session_identifier :jti
in the code instead of require_token_presence_for_authentication? true
, things work fine.Do you have any policies on your token resource? like the bypass that allows ash authentication to do anything it wants for tokens?
Here are my policies in the
Token
resource:
BTW should I move this discussion somewhere else?Ah
Your test to create a user probably aren't inserting a token or something along those lines
Maybe make a new question
but I forget what the solution was, and its documented somewhere in one of these support threads
OK, I'll do more research tomorrow and if I still can't find it, I'll make a new question. Thanks and sorry for hijacking this thread!
No problem