prehistoric-knife-48976
06/30/2023, 4:44 AMshy-beach-55709
06/30/2023, 12:44 PMprehistoric-knife-48976
06/30/2023, 2:26 PMprehistoric-knife-48976
06/30/2023, 2:27 PMauthenticators:
anonymous:
enabled: true
config:
subject: guest
cookie_session:
enabled: true
config:
check_session_url: https://<project-slug>.<http://projects.oryapis.com/sessions/whoami|projects.oryapis.com/sessions/whoami>
prehistoric-knife-48976
06/30/2023, 2:27 PM{
"authenticators": [
{
"forward_http_headers": [
"X-Forwarded-For",
"Authorization",
"Cookie"
],
"handler": "cookie_session"
}
],
"id": "customer",
"match": {
"methods": [
"POST",
"GET"
],
"url": "<https://localhost/api/v1/user/><[0-9a-zA-Z-]{20,40}>/customer"
},
"mutators": [
{
"handler": "noop"
}
],
"version": "v0.36.0-beta.4"
}
shy-beach-55709
06/30/2023, 2:36 PMprehistoric-knife-48976
06/30/2023, 4:14 PMprehistoric-knife-48976
06/30/2023, 4:19 PM{"error":{"code":401,"status":"Unauthorized","message":"Access credentials are invalid"}}↵
Which leads me to believe that there is something wrong with the cookies or the headers based on this snippet of the API docs:
This endpoint authenticates users by checking:
if the Cookie HTTP header was set containing an Ory Kratos Session Cookie; if the Authorization: bearer <ory-session-token> HTTP header was set with a valid Ory Kratos Session Token; if the X-Session-Token HTTP header was set with a valid Ory Kratos Session Token.
If none of these headers are set or the cooke or token are invalid, the endpoint returns a HTTP 401 status code.
I’ve tried using all three of these methods (Authorization header with bearer token, naming the cookie ory_kratos_session, and including an X-Session-Token header with the token), but all return the 401 unauthorized.prehistoric-knife-48976
06/30/2023, 5:23 PM