Unable to get session_token_exchange_code for native login flow with ory_kratos_client python SDK
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
With the ory_kratos_client python SDK, I am unable to create a native login flow which will return a session_token_exchange_code .
Reproducing the bug
Steps to reproduce:
-
Creating a native login flow with the return_session_token_exchange_code=True:
api_response = api_instance.create_native_login_flow(return_session_token_exchange_code=True) -
The response does not include the session_token_exchange_code field and the request_url present in the response is:
'request_url': 'http://self_hosted_ory_kratos/self-service/login/api?return_session_token_exchange_code=True', -
From my observations and playing with the API directly, it seems that the issue comes from the uppercase T of True. Calling the api directly with an all lower cases true fixes the issue.
'http://self_hosted_ory_kratos/self-service/login/api?return_session_token_exchange_code=true'
I can observe a session_token_exchange_code field in the response.
Relevant log output
No response
Relevant configuration
No response
Version
Ory kratos V1.0.0 and ory-kratos-client 1.0.0
On which operating system are you observing this issue?
Linux
In which environment are you deploying?
Docker Compose
Additional Context
No response
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 by tracing create_native_login_flow in the generated Python client and inspect how the return_session_token_exchange_code query parameter is serialized. Reproduce the request with True and true, then verify that the generated URL uses lowercase true and the response includes session_token_exchange_code.
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
- Mostly clear
- Newbie friendliness
- 42/100