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
def user_kratos_session_info():
# Enter a context with an instance of the API client
kratos_url = "http://localhost:4433"
with ory_kratos_client.ApiClient(configuration=kratos_url) as api_client:
api_instance = frontend_api.FrontendApi(api_client)
cookie = "csrf_token_806060ca5bf70dff3caa0e5c860002aade9d470a5a4dce73bcfa7ba10778f481=564ihowvLVIqiCqjb1oH2U1O3y8vd1exNJdq0fEym+M="
try:
api_response = api_instance.to_session(cookie=f"ory_session={cookie}")
print("session_api", api_response)
except ory_kratos_client.ApiException as e:
print("Exception when calling FrontendApi->to_session: %s")
user_kratos_session_info()
I am calling this Python function to retrieve the session info, but I am encountering a 401 (unauthorized) error. I am passing the exact cookies that were generated at the same time.
On which operating system are you observing this issue?
Linux
In which environment are you deploying?
Docker Compose
Additional Context
Once the user is logged in, we aim to retrieve session information for the active user. However, I am unable to obtain the session information using the Python SDK.
The text was updated successfully, but these errors were encountered:
Preflight checklist
Ory Network Project
No response
Describe the bug
def user_kratos_session_info():
# Enter a context with an instance of the API client
kratos_url = "http://localhost:4433"
with ory_kratos_client.ApiClient(configuration=kratos_url) as api_client:
api_instance = frontend_api.FrontendApi(api_client)
cookie = "csrf_token_806060ca5bf70dff3caa0e5c860002aade9d470a5a4dce73bcfa7ba10778f481=564ihowvLVIqiCqjb1oH2U1O3y8vd1exNJdq0fEym+M="
try:
api_response = api_instance.to_session(cookie=f"ory_session={cookie}")
print("session_api", api_response)
except ory_kratos_client.ApiException as e:
print("Exception when calling FrontendApi->to_session: %s")
user_kratos_session_info()
I am calling this Python function to retrieve the session info, but I am encountering a 401 (unauthorized) error. I am passing the exact cookies that were generated at the same time.
Reproducing the bug
Kratos run through the docker-compose.
kratos_url = "http://localhost:4433"
Relevant log output
No response
Relevant configuration
No response
Version
ory-kratos-client==0.13.1
On which operating system are you observing this issue?
Linux
In which environment are you deploying?
Docker Compose
Additional Context
Once the user is logged in, we aim to retrieve session information for the active user. However, I am unable to obtain the session information using the Python SDK.
The text was updated successfully, but these errors were encountered: