I'm trying to use a token I've generated per this KB but example is limited to curl and while it works for one and looks like password is just being replaced with the random generated (a token), the same approach (to use a part after : as a password) doesn't work in Python.
If I have a token of john.doe@example.com:asdghlkj3jtklaslkdf, then code below
getCookie = requests.post(url=base + '/rest/auth/1/session', data='{ "username": "' + username + '", "password": "' + password + '" }', headers={'Content-Type': 'application/json'})
returns "Login failed", if I use john.doe@example.com as a user and asdghlkj3jtklaslkdf as a password.
Hi @Yevgen Lasman,
The problem is not with Python but with the endpoint called.
Indeed, at this point in time, it is not actually possible to use the API token to create a session using the rest/auth/1/session endpoint. We have the below suggestion open in our system in order to have this possibility added:
- JRACLOUD-68026: Make the /rest/auth/1/session endpoint accept API token instead of password
Please vote and watch the above feature request in order to be updated on its status.
Cheers,
Dario
Well, I expected this just need a confirmation. Thank you for your help!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.