Not getting session info
Nobody has claimed this yet.
- Dominant language
- PHP
- Stars
- 178
- Forks
- 96
- Avg merge
- 6d 23h
- Merged PRs (30d)
- 3
Description
Preflight checklist
- I could not find a solution in the existing issues, docs, nor discussions.
- I agree to follow this project's Code of Conduct.
- I have read and am following this repository's Contribution Guidelines.
- I have joined the Ory Community Slack.
- I am signed up to the Ory Security Patch Newsletter.
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.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the generated Python entry point FrontendApi.to_session and reproduce the 401 using ory-kratos-client==0.13.1 with the Docker Compose Kratos setup described. Compare the cookie argument with the client API contract and determine what behavior should be documented or corrected; the issue provides no logs, configuration, named files, or tests to define a narrower completion check.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- api
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 28/100