swift-island-66287
02/27/2023, 10:12 AMfaint-insurance-61054
02/27/2023, 10:33 AMswift-island-66287
02/27/2023, 10:34 AMwitty-midnight-20567
02/27/2023, 10:58 AMswift-island-66287
02/27/2023, 3:39 PMory_kratos_session
? I’ll use the session with Casbin enforcer, to check if the user has the right permissions.
I’ve tried forwarding the Cookie
and also setting a cookie mutator
, but none of that seems to work.faint-insurance-61054
02/27/2023, 3:40 PMswift-island-66287
02/27/2023, 3:41 PMfaint-insurance-61054
02/27/2023, 3:48 PMfaint-insurance-61054
02/27/2023, 3:49 PMfaint-insurance-61054
02/27/2023, 3:50 PMfaint-insurance-61054
02/27/2023, 3:52 PMfaint-insurance-61054
02/27/2023, 3:52 PMswift-island-66287
02/27/2023, 3:55 PMfaint-insurance-61054
02/27/2023, 4:03 PMWhich calls an authorization api (this is the part where I’m stuck right now), the authorization api calls casbin.this part is made via oathkeeper remote authorization, right?
swift-island-66287
02/27/2023, 4:05 PMfaint-insurance-61054
02/27/2023, 4:07 PMory_kratos_session
cookie on this step to remote authz?swift-island-66287
02/27/2023, 4:08 PMfaint-insurance-61054
02/27/2023, 4:10 PMfaint-insurance-61054
02/27/2023, 4:10 PMfaint-insurance-61054
02/27/2023, 4:11 PM"authorizer": {
"handler": "remote",
"config": {
"remote": "<http://my-remote-authorizer/authorize>",
"headers": {
"X-Subject": "{{ print .Subject }}"
},
faint-insurance-61054
02/27/2023, 4:12 PMtype Header map[string][]string
swift-island-66287
02/27/2023, 4:12 PMauthorizer:
handler: remote
config:
remote: <http://127.0.0.1:8084/v1/authorize>
headers:
Cookie: "{{ print .Subject }}"
ctx.Request.Cookies(): [anonymous=]
str:
faint-insurance-61054
02/27/2023, 4:13 PMfaint-insurance-61054
02/27/2023, 4:13 PMfaint-insurance-61054
02/27/2023, 4:14 PM"{{ .Header.Get \"cookie\" }}"
swift-island-66287
02/27/2023, 4:14 PM{{ print .Header }}
swift-island-66287
02/27/2023, 4:14 PMswift-island-66287
02/27/2023, 4:27 PMauthorizer:
handler: remote
config:
remote: <http://127.0.0.1:8084/v1/authorize>
headers:
Cookie: '{{ .Header.Get "Cookie" }}'
authorizers:
remote:
enabled: true
config:
remote: <http://127.0.0.1:8084/v1/authorize>
headers:
Cookie: '{{ .Header.Get "Cookie" }}'
And from the logs, I can see that the initial request contains the Cookieswift-island-66287
02/27/2023, 4:27 PMprint
and MatchContext
as wellfaint-insurance-61054
02/27/2023, 4:30 PMfaint-insurance-61054
02/27/2023, 4:55 PMnil
faint-insurance-61054
02/27/2023, 4:55 PMfaint-insurance-61054
02/27/2023, 4:56 PMswift-island-66287
02/27/2023, 4:57 PMfaint-insurance-61054
02/27/2023, 4:58 PMfaint-insurance-61054
02/27/2023, 5:00 PMcookie_session
authenticators:
- handler: cookie_session
config:
check_session_url: https://session-store-host
only:
- sessionid
forward_http_headers:
- Connect
- Authorization
- Cookie
- X-Forwarded-Forswift-island-66287
02/27/2023, 5:01 PMfaint-insurance-61054
02/27/2023, 5:02 PMSubject
faint-insurance-61054
02/27/2023, 5:02 PMfaint-insurance-61054
02/27/2023, 5:02 PMswift-island-66287
02/27/2023, 5:02 PMWARN[2023-02-27T16:15:00+01:00] No authentication handler was responsible for handling the authentication request audience=application error=map[debug: message:Access credentials are invalid reason: status:Unauthorized status_code:401] granted=false http_host=127.0.0.1:4455 http_method=POST http_url=<grpc://127.0.0.1:4455/club.v1.ClubService/CreateClub> http_user_agent= reason_id=authentication_handler_no_match rule_id=ory:kratos:public service_name=Ory Oathkeeper Middleware service_version=master
WARN[2023-02-27T16:15:00+01:00] failed to handle request audience=application error=map[debug: message:Access credentials are invalid reason: status:Unauthorized status_code:401] http_request=map[headers:map[] host:127.0.0.1:4455 method:POST path:/club.v1.ClubService/CreateClub query:<nil> remote: scheme:http] middleware=oathkeeper service_name=Ory Oathkeeper Middleware service_version=master
btw this was. the error I got when using the cookie_sessionfaint-insurance-61054
02/27/2023, 5:03 PMNo authentication handler was responsible for handling the
faint-insurance-61054
02/27/2023, 5:03 PMfaint-insurance-61054
02/27/2023, 5:04 PMnoop
?swift-island-66287
02/27/2023, 5:09 PMfaint-insurance-61054
02/27/2023, 5:16 PMswift-island-66287
02/27/2023, 5:22 PMhttp_url=<grpc://http>:%2F%2F127.0.0.1:4455/club.v1.ClubService/CreateClub
faint-insurance-61054
02/27/2023, 5:22 PMswift-island-66287
02/27/2023, 5:23 PMswift-island-66287
02/27/2023, 5:23 PMfaint-insurance-61054
02/27/2023, 5:23 PMswift-island-66287
02/27/2023, 5:24 PM