-
Notifications
You must be signed in to change notification settings - Fork 24
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
Extracting phoneNumber from the 3-legg access token #117
Comments
Let's at least discuss and write down the decision about this topic |
Hi @gregory1g My comments would be:
|
@gregory1g @eric-murray The question above looks for me very similar to the more general discussion in camaraproject/IdentityAndConsentManagement#174 |
commonalities has updated the guideline for 3-legged cases. The guideline says that if phoneNumber is provided in the payload the API must validate it towards the access token: camaraproject/Commonalities#233 |
For my perspective, first, the phone number should be optional (This is already the case) and second, we have the 403 INVALID_TOKEN_CONTEXT as specified here if these is mismatch between the phone number in the access token and the one in the request. You think @gregory1g that we need more? |
formally, I do agree. But as a API client developer and as an API server developer I would prefer more clear statements.
We have discussed all these topic and have an agreed view, but they are very documented. |
@gregory1g got it. From my perspective and happy to get yours & from the team
Camara rule: It is important to remark that in cases where personal user data is processed by the API, and users can exercise their rights through mechanisms such as opt-in and/or opt-out, the use of 3-legged access tokens becomes mandatory.
Better to not sent it to avoid to be in position 4.
Given 1 I will say that if you use this API under CAMARA 'rules of engagement' this question is not relevant
Your server must compare and must throw a 403 if mismatch. |
Let's document this. One cannot expect that all developers (server and client slide) read all camara commonalities guideline AND understand them same way.
a. if 3 legged is a must, what's the point to provide phone number in the payload at all? Just to force server do a comparison? According to commonalties this should be avoided. So, if 3-legged is a must - we should better remove phone number from the payload. |
Hi @gregory1g
Humm I'm bit uncomfortable to do that as the ICM team took weeks to agreed on the 'magic' sentences that we added in all API. I'm more in favor to keep as it at least for this meta-release. |
@bigludo7 @fernandopradocabrillo I'm also in favour to not change or interfere with the current documented statements. There is some reasoning behind, especially to decouple the technical specification from legal discussions which have to happen within a specific legal framework when onboarding a concrete application owner and application. For example:
It is for safe to assume and use 3-legged tokens here. But reading the sentence not mechanically, but with a legal mindset: there is an "and" between the two conditions. Which means: In cases where users don't have rights to opt-in or opt-out from a SimSwap check, for example if it is requested by local law from banks to do the check in certain cases, then the conclusion that 3-legged is mandatory is not automatically following. But it is still safe to use 3-legged, as also with a 3-legged token these cases can be handled. So as an API provider you might can decide to offer SimSwap only with e.g. CIBA flow, as this covers all cases in your market. But there might be other markets where SimSwap is expected to be offered with Client Credentials. In short: the final decisions can't be taken by developers alone, it is also a subject of business and legal discussions within markets and during the onboarding of an application. |
So, technically client-credentials and 3-legged are supported, therefore phoneNumber in the request payload must stay. If this is correct understanding, we can close this issue. |
This understanding is correct from my point of view.
There is the Appendix A: info.description template for device identification from access token with a recommended text to be added into the info.description of the API YAML. You would need to change the text a bit (as you don't have cc: @bigludo7 @fernandopradocabrillo
Expected action could be to add the recommended text to the API description. |
From that is follows that because phoneNumer is personal user data, a 3-legged flow is mandatory. Subscribers might have opted-out of the API and that opt-out check is still possible with client credentials, but there is no consent collection or opt-in with client credentials flow. I would not add a optional phoneNumber parameter because that leads to all kinds of trouble. The case where phoneNumber from the access token and phoneNumber from the parameter were discussed above. But some telcos might implement a version of the API where if the two phoneNumbers have the same person or contract owner then they accept the API request based on the access token but the result is still for the parameter phoneNumber. I would go for a separate endpoint with a separate scope for the client credentials version of the API and only clients who are eligible for client credentials get that scope. That way we can still have one openIdConnect security scheme as decided by TSC, but still decide at client-onboarding-time which client gets that client-credentials-scope.
Any client credentials flow version of any API is NOT privacy friendly. Providing a client credentials flow should be the exception and not be used e.g. if a telco failed to implement OpenId Connect. |
I agree with @bigludo7 proposal in #117 (comment) and with @hdamker clarifications in #117 (comment). Thank you! @fernandopradocabrillo @bigludo7 I think this issue can be resolved adding the corresponding explanation to API description and including the required error responses to both API endpoints. Appendix A: info.description template for device identification from access token is a good reference, but it is intended for APIs using P.D: Just to clarify. As stated in this Appendix...
This is the case of the SIM Swap API, which defines phone_number as a way to identify the corresponding "user account" (no device concept is used). In cases where the device object commonality guideline does not apply, it is up to the API subproject to decide whether or not to rely on the access_token in 3-legged scenarios according to its own criteria and API requirements. And in this case, it was decided to follow an approach for the phone_number similar to the one recommended in the commonality guideline for the device object. Which I personally agree with. |
Hello
Please @AxelNennker @jpengar @hdamker @gregory1g @fernandopradocabrillo could you confirm your support for this?
|
for the 3-legged auth this error must be issues even when phoneNumber is included in the payload. Because service cannot prove that access token matches it (we are in 3 legged scenario). Suggested text version: |
@bigludo7 Looks good to me. But I see some typos in the suggested text. Some double spaces after replacing "device object" with phoneNumber and some "phoneNumber object"... I've tried to fix them in the suggestion below. By the way, you might also consider defining a specific 422 error for this API, as suggested below as well.
|
Thanks @jpengar ! this is perfect for me. @gregory1g I prefer to keep as it is |
Problem description
When a 3-legged auth is used, the access token is MSISDN specific. This has two important consequences:
As far as I understand commonalities tends to prefer the second option (avoid duplication and use the token):
camaraproject/Commonalities#171
SimSwap does not use device object per se, however the question if one should use MSISDN from the access token instead of payload is relevant for the SimSwap. Moreover, phoneNumber is currently a mandatory parameter, therefore switching to access token based execution will be a not-backward compatible change.
Possible evolution
phoneNumber can be declared optional. Thus, it must be provided when client credentials auth is used, and must not be provided when 3-legged token is used. Or at least we can introduce such approach in the future without breaking backward compatibility.
The text was updated successfully, but these errors were encountered: