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

Get current consent-status to throw a more cleaner error in the logs #179

Open
RamonQu opened this issue Jan 15, 2023 · 5 comments
Open
Labels
enhancement New feature or request

Comments

@RamonQu
Copy link

RamonQu commented Jan 15, 2023

I saw quite some people with issues (#174, #175, #176, #178) on the integration which is caused by a missing Consent in the MySkoda App.

I managed to capture the calls which are performed to GET the specific consent-status and POST a confirmation (by accepting the terms). Maybe it would be helpful to check the status of the consent and use it to throw a more cleaner error in the logging.

  1. A GET call is done to https://api.connect.skoda-auto.cz/api/v1/users/[USERID]/identities which returns:
{
	"identities": [{
		"identity": "MBB",
		"actionsToCompleteIdentity": []
	}, {
		"identity": "DCS",
		"actionsToCompleteIdentity": []
	}, {
		"identity": "CONNECT",
		"actionsToCompleteIdentity": ["GIVE_DOCUMENT_CONSENT"]
	}, {
		"identity": "CABS",
		"actionsToCompleteIdentity": []
	}]
}

The GIVE_DOCUMENT_CONSENT is probably the status that prevents further actions to the API to get the car status.

  1. A GET call is done to https://document-consent.vwgroup.io/api/v2/consents/required?document-id=[DOCID]&user-id=[USERID}&locale=en-GB
{
	"consentRequired": true,
	"versionDetails": {
		"id": "[ID]",
		"versionId": "[VERSIONID]",
		"locale": "en-GB",
		"title": "ŠKODA Connect",
		"text": "<br>\n\n### Terms and Conditions\n----------------\nImportant legal terms and information for setting up and using ŠKODA Connect services.\n\n[TERMS AND CONDITIONS ŠKODA CONNECT > ](https://consent.vwgroup.io/consent/v1/texts/SkodaConnect/gb/en/termsOfUse/latest/html)\n\n<br>\n\n### Information on Personal Data Processing\n----------------\nInformation on handling user data across ŠKODA Connect functions.\n\n[INFORMATION ON PERSONAL DATA PROCESSING > ](https://consent.vwgroup.io/consent/v1/texts/SkodaConnect/gb/en/dataprivacy/latest/html)",
		"disclaimer": ""
	},
	"consent": {
		"id": "[ID]",
		"userId": "[USERID]",
		"decision": true,
		"versionDetailsId": "[VERSIONID]",
		"collector": "[COLLECTOR]@apps_vw-dilab_com",
		"updatedAt": "2021-10-14T09:02:53Z",
		"version": 2
	}
}
  1. A POST is done to https://document-consent.vwgroup.io/api/v2/consents to confirm the decision to accept the terms

Payload
{"decision":true,"userId":"[USERID]","versionDetailsId":"[VERSIONID]"}

Response

{
	"id": "[NEWID?]",
	"userId": "[USERID]",
	"decision": true,
	"versionDetailsId": "[OTHERVERSIONID],
	"collector": "[COLLECTOR]@apps_vw-dilab_com",
	"updatedAt": "2023-01-15T21:42:35.045Z",
	"version": 3
}
  1. After accepting the terms the first GET call to https://api.connect.skoda-auto.cz/api/v1/users/[USERID]/identities return this response:
{
	"identities": [{
		"identity": "MBB",
		"actionsToCompleteIdentity": []
	}, {
		"identity": "DCS",
		"actionsToCompleteIdentity": []
	}, {
		"identity": "CONNECT",
		"actionsToCompleteIdentity": []
	}, {
		"identity": "CABS",
		"actionsToCompleteIdentity": []
	}]
}
@Farfar
Copy link
Collaborator

Farfar commented Jan 15, 2023

I saw quite some people with issues (#174, #175, #176, #178) on the integration which is caused by a missing Consent in the MySkoda App.

I managed to capture the calls which are performed to GET the specific consent-status and POST a confirmation (by accepting the terms). Maybe it would be helpful to check the status of the consent and use it to throw a more cleaner error in the logging.

  1. A GET call is done to https://api.connect.skoda-auto.cz/api/v1/users/[USERID]/identities which returns:
{
	"identities": [{
		"identity": "MBB",
		"actionsToCompleteIdentity": []
	}, {
		"identity": "DCS",
		"actionsToCompleteIdentity": []
	}, {
		"identity": "CONNECT",
		"actionsToCompleteIdentity": ["GIVE_DOCUMENT_CONSENT"]
	}, {
		"identity": "CABS",
		"actionsToCompleteIdentity": []
	}]
}

The GIVE_DOCUMENT_CONSENT is probably the status that prevents further actions to the API to get the car status.

  1. A GET call is done to [https://document-consent.vwgroup.io/api/v2/consents/required?document-id=[DOCID]&user-id=USERID}&locale=en-GB
{
	"consentRequired": true,
	"versionDetails": {
		"id": "[ID]",
		"versionId": "[VERSIONID]",
		"locale": "en-GB",
		"title": "ŠKODA Connect",
		"text": "<br>\n\n### Terms and Conditions\n----------------\nImportant legal terms and information for setting up and using ŠKODA Connect services.\n\n[TERMS AND CONDITIONS ŠKODA CONNECT > ](https://consent.vwgroup.io/consent/v1/texts/SkodaConnect/gb/en/termsOfUse/latest/html)\n\n<br>\n\n### Information on Personal Data Processing\n----------------\nInformation on handling user data across ŠKODA Connect functions.\n\n[INFORMATION ON PERSONAL DATA PROCESSING > ](https://consent.vwgroup.io/consent/v1/texts/SkodaConnect/gb/en/dataprivacy/latest/html)",
		"disclaimer": ""
	},
	"consent": {
		"id": "[ID]",
		"userId": "[USERID]",
		"decision": true,
		"versionDetailsId": "[VERSIONID]",
		"collector": "[COLLECTOR]@apps_vw-dilab_com",
		"updatedAt": "2021-10-14T09:02:53Z",
		"version": 2
	}
}
  1. A POST is done to https://document-consent.vwgroup.io/api/v2/consents to confirm the decision to accept the terms

Payload {"decision":true,"userId":"[USERID]","versionDetailsId":"[VERSIONID]"}

Response

{
	"id": "[NEWID?]",
	"userId": "[USERID]",
	"decision": true,
	"versionDetailsId": "[OTHERVERSIONID],
	"collector": "[COLLECTOR]@apps_vw-dilab_com",
	"updatedAt": "2023-01-15T21:42:35.045Z",
	"version": 3
}
  1. After accepting the terms the first GET call to https://api.connect.skoda-auto.cz/api/v1/users/[USERID]/identities return this response:
{
	"identities": [{
		"identity": "MBB",
		"actionsToCompleteIdentity": []
	}, {
		"identity": "DCS",
		"actionsToCompleteIdentity": []
	}, {
		"identity": "CONNECT",
		"actionsToCompleteIdentity": []
	}, {
		"identity": "CABS",
		"actionsToCompleteIdentity": []
	}]
}

Yes! This is exactly the type of information I need to improve the integration under these circumstances.
I've seen this endpoint being used from version 5.x of the app, it wasn't used in 4.x, it had another endpoint to check valid consent.
Now the question is: how to get the document ID. It would be nice to add the functionality to accept from config flow.
For starters it should be enough with this information to implement a check that throws a relevant error message.

@RamonQu
Copy link
Author

RamonQu commented Jan 15, 2023

Using MySkoda iOS App 5.3.0 (Build ID000000120, 05-12-2022)

@Farfar
Copy link
Collaborator

Farfar commented Jan 15, 2023

That's the same version as recent Android which I guess means they use same version numbering now on both platforms.

@RamonQu
Copy link
Author

RamonQu commented Jan 15, 2023

No luck there. I don't see a call that fetches the documentID, so probably it is created of raised from the App itself. But throwing a relevant error message would be helpful for starters. :)

@WebSpider WebSpider added the enhancement New feature or request label Jun 27, 2023
@dvx76
Copy link
Member

dvx76 commented Feb 16, 2024

Just a note to go check this out and maybe have a way to implement auto-accepting consent:

https://www.npmjs.com/package/iobroker.vw-connect/v/0.0.34

0.0.34

add auto accept of new privacy consent

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

No branches or pull requests

4 participants