You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After trying to set the redirect_uri as http://authentification.dev.local/ (note the final "/"), I realize that the hostname part is not parsed. When I access http://private.dev.local/ it assumes that I'm on the redirect URI path :
172.23.0.1 - - [26/Dec/2018:11:31:57 +0000] "GET / HTTP/1.1" 500 79 "-""Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36"
2018/12/26 11:31:59 [debug] 7#7: *20 [lua] openidc.lua:1297: authenticate(): Redirect URI path (/) is currently navigated -> Processing authorization response coming from OP
2018/12/26 11:31:59 [error] 7#7: *20 [lua] openidc.lua:1301: authenticate(): request to the redirect_uri path but there's no session state found, client: 172.23.0.1, server: private.dev.local, request: "GET / HTTP/1.1", host: "private.dev.local"172.23.0.1 - - [26/Dec/2018:11:31:59 +0000] "GET / HTTP/1.1" 500 79 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36"
I think it should be something like Redirect URI path (http://authentification.dev.local/) is currently navigated?
Looking at the code, this part extracts the path only :
It seems like I have to define an explicit path for the callback, defining it as redirect_uri = "http://authentification.dev.local/callback" made it pass the test!
Hello,
Following #240 I'm trying to implement my auth solution but I'm hitting a wall. My goal is to set up authentication for a whole sub-domain (.dev.local in this case), without the need of declaring a redirect_uri for each private app.
My issue is that the authorization response is not detected by lua-resty-openidc, this condition seems never true in my case :
The result is that I'm in a redirect loop on this url : http://authentification.dev.local/?state=a763259a95b6331f66e1f4dbc1b04909&session_state=0c62c696-4df2-4eb7-8ee2-8d13c399522c&code=fea27c51-a300-4bff-b9f6-a9048e442e29.0c62c696-4df2-4eb7-8ee2-8d13c399522c.2ae2c95f-45f1-4644-9d9d-12fb48db09ae
I followed @bodewig recommendations from #240 (comment) and produced this configuration :
After the edits I'm not quite sure what is and what is not working right now :-)
The Redirect URI path (" .. path .. ") is currently navigated explicitly uses a path after the hostname part has been stripped. In your setup you probably should avoid using a redirect_uri with a path that is a legitimate path for your application (as / likely would be), so using /callback sound like a good idea.
openidc_get_path and thus openidc_get_redirect_uri_path strip the hostname even if it doesn't match the current hostname as visible to nginx. This happens for setups where nginx doesn't know enough about the public facing URI space to properly reconstruct the URI used by the client from information available to the server. This may happen if there is another reverse proxy sitting in front of the nginx running your authentication proxy code which rewrites URIs by a more complex logic.
Thank you @bodewig , so I need to "reserve" the same /callback route for all my protected services in order to be able to use http://authentication.dev.local/callback as the single valid redirect_uri from keycloak point of view.
EDIT II:
After trying to set the
redirect_uri
ashttp://authentification.dev.local/
(note the final "/"), I realize that the hostname part is not parsed. When I accesshttp://private.dev.local/
it assumes that I'm on the redirect URI path :I think it should be something like
Redirect URI path (http://authentification.dev.local/) is currently navigated
?Looking at the code, this part extracts the path only :
lua-resty-openidc/lib/resty/openidc.lua
Line 1317 in d7bd9a2
EDIT :
It seems like I have to define an explicit path for the callback, defining it as
redirect_uri = "http://authentification.dev.local/callback"
made it pass the test!Hello,
Following #240 I'm trying to implement my auth solution but I'm hitting a wall. My goal is to set up authentication for a whole sub-domain (.dev.local in this case), without the need of declaring a redirect_uri for each private app.
My issue is that the authorization response is not detected by
lua-resty-openidc
, this condition seems never true in my case :lua-resty-openidc/lib/resty/openidc.lua
Line 1337 in d7bd9a2
The result is that I'm in a redirect loop on this url :
http://authentification.dev.local/?state=a763259a95b6331f66e1f4dbc1b04909&session_state=0c62c696-4df2-4eb7-8ee2-8d13c399522c&code=fea27c51-a300-4bff-b9f6-a9048e442e29.0c62c696-4df2-4eb7-8ee2-8d13c399522c.2ae2c95f-45f1-4644-9d9d-12fb48db09ae
I followed @bodewig recommendations from #240 (comment) and produced this configuration :
Environment
Logs
The logs are a repeating sequence of this :
The text was updated successfully, but these errors were encountered: