Authenticate sessionless tokens#306
Conversation
|
@bwaidelich can you verify this change as I copied the security part from your own implementation back then. |
|
Mh, the |
|
The For neos-canto that means we get a 'authorization needed' redirect: https://github.com/flownative/neos-canto/blob/main/Classes/Service/CantoClient.php#L106 |
|
@MiauzGenau The corresponding auth tokens aren't active for this controller it seems, maybe you can debug Security\Context::isTokenActive() why that is. I assume, that there is a missing request pattern |
|
And maybe you could post the (deducted, if needed) output of |
|
I will take a look, but also for your information, as mentioned in the issue:
|
|
Providers config looks like this ATM: |
|
OK, the settings look fine for me..
Yes, it removes the cookie if no account is authenticated. But the problem is, that no account is authenticated, not that it removes the cookie :) Maybe also debug https://github.com/flownative/flow-openidconnect-client/blob/main/Classes/Http/SetJwtCookieMiddleware.php#L88 – i.e. what's It's quite tedious to debug Flow auth because there are so many moving parts. We can look at it together in a call if you wish to! |
|
Yes I see it the same, we are not authenticated, that is why I proposed this PR, which would authenticate the request. Provider name is If it helps we can look at it in a call together : ) |
Thanks for that, but the thing is: Flow should automatically authenticate required tokens if everything is configured correctly.
Well, I hope it helps you :) |
|
For request: /neos/graphql/media-assets |
|
Looks like for the fix we could also use |
…atus is set to null (unset)
bwaidelich
left a comment
There was a problem hiding this comment.
I would still prefer to understand why authentication is not correctly triggered automatically, but this change probably doesn't do any harm so I'd be fine with it.
Thanks!
|
I sadly do not know enough about the Neos authentication and how it should be triggered automatically. (We have no urgency for this, it only prevents us from updating.) Thank you : ) |
|
@MiauzGenau are you on slack and open for a quick call so I can try to reproduce your setup? |
|
I have no slack. |
|
@MiauzGenau OK, in order to reproduce your issue I would need to know your setup.. You could describe it or suggest any other way to establish a quick call if you're up for it |
|
You would at least need a setup with https://github.com/flownative/openidconnect-neos (or something which uses a similar way to authenticate), on our end this requires a setup in Azure. Not sure how you can get a test setup working with that. (But I guess this would be the most important step to be able to reproduce it.) (Then in our case we use https://github.com/flownative/neos-canto, which would require a connection to Canto, this is probably also not easy to reproduce. (I'm not sure if this is needed to reproduce the error.)) I'm happy to describe it in a call, but I never really had the use-case of having to setup a call outside the company. Feel free to point out how I can describe it in a better way : ) |
|
I was able to reproduce the issue by installing the flownative/openidconnect-neos package (with a local OIDC provider). |
|
I tested it and it seems to resolve the issue for me 👍 |
My attempt to resolve: #305
This change injects the
AuthenticationManagerInterfacevia theGraphQLMiddlewareFactoryand callsauthenticate()after the simulated request is assigned.AuthenticationRequiredExceptionis caught deliberately:Authentication is attempted, not required, so anonymous/token-based API access (as described in the README) keeps working and privilege targets decide authorization as before.
Tested with:
flowpack/media-ui: 2.0.4
flownative/openidconnect-neos: 0.4.0
flownative/neos-canto: 0.6.0