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

CareLink Follower - CarePartner app authentication #3210

Merged
merged 2 commits into from
Nov 28, 2023

Conversation

benceszasz
Copy link
Contributor

Issue
Auth token is only valid for 1-3 hours, if it cannot refreshed for exmaple due to lack of internet connection, a new login must be carried out manually.

Solution
CarePartner app authentication is valid for 1 week, thus even if xdrip is unable to connect to CareLink for a few days (for example due to the lack of internet connection), it will be able to renew the login (refresh the token) automatically in the background after it can connect to CareLink again without needing to login again manually using the browser. The user account restriction applies to this authentication process as well: a different dedicated follower account must be used in every app, otherwise the previous auth token will be revoked.

Credits
CarePartner app authentication process is based on the impressive work of @palmarci in extracting the entire authentication process of the mobile app.

Limitations
When the same account is logged in from another xdrip or official mobile application the previous login will be closed (authetication token is revoked). A different dedicated follower account must be used in every official and xdrip app, otherwise the previous auth token will be revoked.

Testing
I have tested it with all kinds of accounts (patient, carepartner) with different devices (standalone CGM and 7xxG pump) in every region (EU,US) on different phones and it is was working fine without any errors and was stable.

@palmarci
Copy link

Great work as always! Thanks for this

…into bszasz-connectfollow

� Conflicts:
�	app/build.gradle
Copy link
Collaborator

@jamorham jamorham left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this. If strings are stable, where they are hard coded you could extract these to string values for localization in future.

@benceszasz
Copy link
Contributor Author

Is it enough if I do the text extraction for translations in another PR?

@jamorham
Copy link
Collaborator

Yes a later PR is fine. I have already approved this one so don't change it.

@jamorham jamorham merged commit 5f93de7 into NightscoutFoundation:master Nov 28, 2023
1 check passed
@benceszasz
Copy link
Contributor Author

Ok, thanks! I will start to extract the hard coded texts and put them into the translatable strings and create a new PR.

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

Successfully merging this pull request may close these issues.

3 participants