Closed tuxpeople closed 1 year ago
Hm, telling from authelias error message the state is too short. But I don't think it is less than 8 characters. Sharry creates a 8 character string and adds a signature, resulting in a length of at least 30 characters. You are right, it is not configurable, it is generated randomly.
You could maybe add this lines:
"sharry.restserver.oauth.CodeFlow" = "Trace"
"sharry.restserver.routes.LoginRoutes" = "Trace"
to the config in the logging
section. It should print out more things when doing the auth flow. Then you see what sharry sends to authelia. Maybe this gives a clue.
This is what I get:
2023.03.17 20:03:25:0000 [io-comp...] [DEBUG] sharry.restserver.routes.LoginRoutes.applyOrElse:55 - Redirecting to OAuth provider internal: https://auth.${SECRET_DOMAIN}/api/oidc/authorization?client_id=sharry&redirect_uri=https%3A%2F%2Fsharry.${SECRET_DOMAIN}%2Fapi%2Fv2%2Fopen%2Fauth%2Foauth%2Finternal%2Fresume&response_type=code
2023.03.17 20:03:25:0001 [io-comp...] [INFO ] org.http4s.server.middleware.Logger - HTTP/1.1 GET /api/v2/open/auth/oauth/internal
2023.03.17 20:03:25:0002 [io-comp...] [INFO ] org.http4s.server.middleware.Logger - HTTP/1.1 303 See Other
2023.03.17 20:03:26:0000 [io-comp...] [INFO ] org.http4s.server.middleware.Logger - HTTP/1.1 GET /api/v2/open/auth/oauth/internal/resume?error=invalid_state&error_description=The+state+is+missing+or+does+not+have+enough+characters+and+is+therefore+considered+too+weak.+Request+parameter+%27state%27+must+be+at+least+be+8+characters+long+to+ensure+sufficient+entropy.&state=
2023.03.17 20:03:26:0001 [io-comp...] [INFO ] org.http4s.server.middleware.Logger - HTTP/1.1 307 Temporary Redirect
2023.03.17 20:03:25:0003 [io-comp...] [INFO ] org.http4s.server.middleware.Logger - HTTP/1.1 GET /app/login?oauth=1
2023.03.17 20:03:25:0004 [io-comp...] [INFO ] org.http4s.server.middleware.Logger - HTTP/1.1 200 OK
2023.03.17 20:03:26:0000 [io-comp...] [INFO ] org.http4s.server.middleware.Logger - HTTP/1.1 GET /api/v2/open/info/version
2023.03.17 20:03:26:0001 [io-comp...] [INFO ] org.http4s.server.middleware.Logger - HTTP/1.1 200 OK
2023.03.17 20:03:25:0005 [io-comp...] [INFO ] org.http4s.server.middleware.Logger - HTTP/1.1 POST /api/v2/sec/auth/session
2023.03.17 20:03:25:0006 [io-comp...] [INFO ] org.http4s.server.middleware.Logger - HTTP/1.1 403 Forbidden
Maybe I misread that, but I think there should be a state in line 1 and Sharry gets state=
back in line 4 which equals empty.
Oh no! You are right, the parameter is not even there. I need to look into this.
Did you have a chance to look into this?
Did you have a chance to look into this?
No, unfortunately I haven't had enough time yet.
Having same issue. I'm trying to switch from Gokapi to Sharry
Hi there, I just tried to reproduce, but I couldn't. It is working fine in my case. For comparison here are my configs. On a first glance I don't see any obvious differences. I also checked that the state
parameter is in the url. What version of sharry are you using? Could you try the nightly version perhaps just to see if it's also in the latest build?
Nightly build seems to work just fine
Thanks @hibare - good to know. I'll then do a 1.12.1 release soon.
I can't test right now, as my box broke down and I'm waiting for a new power supply. Looks like it will not arrive before I'm away next week. Therefore I need to trust you guys and I'm looking forward deploying 1.12.1
Hi
I'm using the
eikek0/sharry
image with tagv1.12.0
in Kubernetes. For OAuth, I try to use theghcr.io/authelia/authelia
image with tag4
.This is my Sharry config for OAuth:
This is the relevant part of my Authelia config:
When I press the button for OAuth, Sharry tries to authenticate and eventually ends back at the login screen with "There was an invalid response status: 405". In the Authelia log, I see this:
My knowledge in OAuth and both tools is limited, therefore I cannot be sure it's not a configuration issue. But as fas as I understand, the state parameter is not configurable, right? Do you have any idea where the problem could be located?
Kind regards