What is your authenticate_service_url
set to? I wonder if its a separate sub-domain such as authenticate.DOMAIN
.
Your authentication domain cannot be reused for any of the routes.
Also, having full set of logs is important to understand what is going on. i.e. the below is annotated log of a first request:
*** USER NAVIGATES TO ROUTE ***
{"level":"info","ip":"127.0.0.1","user_agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Safari/537.36","request-id":"b77577db-4e03-491a-8f8a-903a1b038d24","error":"Bad Request: internal/sessions: session is not found","idp_id":"","time":"2023-02-07T13:02:30-05:00","message":"authenticate: session load error"}
*** NO SESSION, AUTHORIZE WOULD REDIRECT TO SIGN-IN ***
{"level":"info","service":"envoy","upstream-cluster":"pomerium-control-plane-http","method":"GET","authority":"authenticate.localhost.pomerium.io","path":"/.pomerium/sign_in","user-agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Safari/537.36","referer":"","forwarded-for":"192.168.2.75","request-id":"b77577db-4e03-491a-8f8a-903a1b038d24","duration":9.977875,"size":871,"response-code":302,"response-code-details":"via_upstream","time":"2023-02-07T13:02:30-05:00","message":"http-request"}
*** IDP LOGIN SCREEN, FOLLOWED BY REDIRECT TO AUTHENTICATE CALLBACK ***
{"level":"info","service":"envoy","upstream-cluster":"pomerium-control-plane-http","method":"GET","authority":"authenticate.localhost.pomerium.io","path":"/oauth2/callback","user-agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/109.0.0.0 Safari/537.36","referer":"https://accounts.google.com/","forwarded-for":"192.168.2.75","request-id":"4c2246dd-3d7f-42c6-b58b-3255152aff46","duration":364.053916,"size":394,"response-code":302,"response-code-details":"via_upstream","time":"2023-02-07T13:02:38-05:00","message":"http-request"}
*** CREATING SESSION ***
{"level":"info","type":"type.googleapis.com/session.Session","id":"debb7c57-9c3c-4a9a-b074-6a9403ec9ce0","time":"2023-02-07T13:02:38-05:00","message":"get"}
{"level":"info","type":"type.googleapis.com/user.User","id":"106998556907638105504","time":"2023-02-07T13:02:38-05:00","message":"get"}
{"level":"info","record-count":2,"record-type":"type.googleapis.com/user.User","time":"2023-02-07T13:02:38-05:00","message":"put"}
{"level":"info","type":"type.googleapis.com/session.Session","query":"","offset":0,"limit":1,"filter":{"$or":[{"id":"debb7c57-9c3c-4a9a-b074-6a9403ec9ce0"},{"$index":"debb7c57-9c3c-4a9a-b074-6a9403ec9ce0"}]},"time":"2023-02-07T13:02:38-05:00","message":"query"}
{"level":"info","type":"type.googleapis.com/session.Session","query":"","offset":0,"limit":1,"filter":{"$or":[{"id":"debb7c57-9c3c-4a9a-b074-6a9403ec9ce0"},{"$index":"debb7c57-9c3c-4a9a-b074-6a9403ec9ce0"}]},"time":"2023-02-07T13:02:38-05:00","message":"query"}
{"level":"info","type":"type.googleapis.com/user.User","query":"","offset":0,"limit":1,"filter":{"$or":[{"id":"106998556907638105504"},{"$index":"106998556907638105504"}]},"time":"2023-02-07T13:02:38-05:00","message":"query"}
{"level":"info","type":"type.googleapis.com/user.ServiceAccount","query":"","offset":0,"limit":1,"filter":{"$or":[{"id":"debb7c57-9c3c-4a9a-b074-6a9403ec9ce0"},{"$index":"debb7c57-9c3c-4a9a-b074-6a9403ec9ce0"}]},"time":"2023-02-07T13:02:38-05:00","message":"query"}
{"level":"info","type":"pomerium.io/DirectoryUser","query":"","offset":0,"limit":1,"filter":{"$or":[{"id":"106998556907638105504"},{"$index":"106998556907638105504"}]},"time":"2023-02-07T13:02:38-05:00","message":"query"}
*** CHECK REQUEST TO ROUTE, OK NOW ***
{"level":"info","service":"authorize","request-id":"9c67f0ae-423f-4aa2-b766-780aee0eeca7","check-request-id":"9c67f0ae-423f-4aa2-b766-780aee0eeca7","method":"GET","path":"/","host":"httpbin1.localhost.pomerium.io","query":"","ip":"127.0.0.1","session-id":"debb7c57-9c3c-4a9a-b074-6a9403ec9ce0","allow":true,"allow-why-true":["user-ok"],"deny":false,"deny-why-false":["valid-client-certificate-or-none-required"],"user":"106998556907638105504","email":"XXXXX@gmail.com","time":"2023-02-07T13:02:38-05:00","message":"authorize check"}