Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Authentication methods changed #146

Closed
realcoloride opened this issue Feb 5, 2024 · 9 comments
Closed

Authentication methods changed #146

realcoloride opened this issue Feb 5, 2024 · 9 comments

Comments

@realcoloride
Copy link
Owner

Hello,

For the second time, it seems like characterai has switched to a new way of authentication.

@realcoloride
Copy link
Owner Author

From my search, it seems like atleast for google accounts, there is an id tokenand key associated with a token from the new endpoint of dj-rest-auth/google_idp/.
image

This produces a session token.
image

This is the endpoint in question.
image

For easier development purposes, I might have to switch to using the session token only and rework the README.md.
image

I will keep you updated.

@realcoloride realcoloride pinned this issue Feb 5, 2024
@realcoloride
Copy link
Owner Author

Hello again,
image

Changing to char_token seems to be a viable solution. I will push a fix along with the readme.md tutorial soon.

@realcoloride
Copy link
Owner Author

I added a warning message if the token is not as the same size of char_tokens (40).
image

@realcoloride
Copy link
Owner Author

I've updated the code for mobile token gathering.
image

@realcoloride
Copy link
Owner Author

Relevant commits:
7cb8e59 and 46db79e.

Experimental version 1.2.5 was pushed, please let me know how it goes for you all.

@Asphyxiav2
Copy link

Screenshot_20240205-233206
No id token

@realcoloride
Copy link
Owner Author

Hello, please read the entire issue. Id tokens and access tokens have been replaced with session tokens. See README.md.

@azureknight63
Copy link

Thanks for the update. Your changes seem to be effective. For the readme update, it seems that the access token is now under Local Storage > char_token.value as you described. The ID token is under Local Storage > uuid.

It also looks like char_token has a 1-month TTL property. It's hard to suggest a feature if character.ai is going to change authentication methods this frequently, but if it stabilizes then I would recommend including utility for updating the char_token.

Cheers.

@realcoloride
Copy link
Owner Author

I seem to have also detected that the newer chat interface uses a websocket whilst the old interface uses good old requests.
Might be interesting to open an issue related to it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants