Improve authentication mechanism for subscription events#580
Improve authentication mechanism for subscription events#580rartych merged 8 commits intocamaraproject:mainfrom
Conversation
|
@m-nahum The procedure for EasyCLA signing is explained in https://github.com/camaraproject/EasyCLA repo. |
|
@m-nahum Thank you for the input.
|
|
Thanks for the input @m-nahum. @jpengar and myself have been reviewed it. The following comments reflect Telefónica’s initial review and feedback on the content of this Pull Request:
|
|
@PedroDiez and @jpengar, thank you for your comments. Regarding:
The token type will be included in the token response when the API Provider requests an access token from the API Consumer authorization server. There is no reason to limit the token type to Bearer in this specification. |
Hi @m-nahum, The point is that we want to keep both securitization approacahes in terms of behavior, so guaranteeing backwards compatibility. It was discussed in the past the use of "bearer" token. No matter to not explicitly indicate in subscription phase, but indicate that tokens issued are "bearer" token type. |
documentation/CAMARA-API-Event-Subscription-and-Notification-Guide.md
Outdated
Show resolved
Hide resolved
documentation/CAMARA-API-Event-Subscription-and-Notification-Guide.md
Outdated
Show resolved
Hide resolved
documentation/CAMARA-API-Event-Subscription-and-Notification-Guide.md
Outdated
Show resolved
Hide resolved
documentation/CAMARA-API-Event-Subscription-and-Notification-Guide.md
Outdated
Show resolved
Hide resolved
documentation/CAMARA-API-Event-Subscription-and-Notification-Guide.md
Outdated
Show resolved
Hide resolved
documentation/CAMARA-API-Event-Subscription-and-Notification-Guide.md
Outdated
Show resolved
Hide resolved
documentation/CAMARA-API-Event-Subscription-and-Notification-Guide.md
Outdated
Show resolved
Hide resolved
documentation/CAMARA-API-Event-Subscription-and-Notification-Guide.md
Outdated
Show resolved
Hide resolved
documentation/CAMARA-API-Event-Subscription-and-Notification-Guide.md
Outdated
Show resolved
Hide resolved
|
|
||
| opt Using ACCESSTOKEN sink credential type | ||
| opt Subscription | ||
| appbe ->> cspres: POST /subscription<br>Body: {<br>sink: <API Consumer>/notification,<br>sinkCredential:{ credentialType: ACCESSTOKEN,<br>accessToken:<Access Token>,<br>accessTokenExpireUtc:<access token expire time>,<br>accessTokenType: bearer },<br>...} |
There was a problem hiding this comment.
| appbe ->> cspres: POST /subscription<br>Body: {<br>sink: <API Consumer>/notification,<br>sinkCredential:{ credentialType: ACCESSTOKEN,<br>accessToken:<Access Token>,<br>accessTokenExpireUtc:<access token expire time>,<br>accessTokenType: bearer },<br>...} | |
| appbe ->> cspres: POST /subscriptions<br>Body: {<br>sink: <API Consumer>/sink,<br>sinkCredential:{ credentialType: ACCESSTOKEN,<br>accessToken:<Access Token>,<br>accessTokenExpireUtc:<access token expire time>,<br>accessTokenType: bearer },<br>...} |
|
The definition of plain credentials in subscription template looks awkward: but it is intended for protocols with plain security (and is inherited from original CloudEvents subscription template). |
Co-authored-by: Rafal Artych <121048129+rartych@users.noreply.github.com>
documentation/CAMARA-API-Event-Subscription-and-Notification-Guide.md
Outdated
Show resolved
Hide resolved
| } | ||
| } | ||
| ``` | ||
| Note: To use `credentialType` with value `PRIVATE_KEY_JWT`, the API Consumer and API Provider shall share |
There was a problem hiding this comment.
I think this part it would be better below the above table for editorial aligment with Explicit Susbcription (after line 79)
| opt Using PRIVATE_KEY_JWT sink credential type | ||
| note over appclient,cspclient: Onboarding: <br> API Consumer shares <Token Endpoint> and <Client ID><br>API Provider shares <JWKS URI> | ||
| opt Subscription | ||
| appclient ->> cspres: POST /subscription<br>Body: {<br>sink: <API Consumer 2>/notification,<br>sinkCredential:{ credentialType: PRIVATE_KEY_JWT },<br>...} |
There was a problem hiding this comment.
Similar changes as for ACCESSTOKEN flow:
| appclient ->> cspres: POST /subscription<br>Body: {<br>sink: <API Consumer 2>/notification,<br>sinkCredential:{ credentialType: PRIVATE_KEY_JWT },<br>...} | |
| appclient ->> cspres: POST /subscriptions<br>Body: {<br>sink: <API Consumer 2>/sink,<br>sinkCredential:{ credentialType: PRIVATE_KEY_JWT },<br>...} |
| end | ||
|
|
||
| opt Notification | ||
| cspclient ->> appres: POST /notification<br>Authorization: Bearer <Access Token><br>Body: { ... } |
There was a problem hiding this comment.
| cspclient ->> appres: POST /notification<br>Authorization: Bearer <Access Token><br>Body: { ... } | |
| cspclient ->> appres: POST /sink<br>Authorization: Bearer <Access Token><br>Body: { ... } |
|
Due to document structure we have twice the following stance:
For security experts it is obvious what
|
@rartych |
My understanding is that we concluded that using REFRESHTOKEN is not feasible in CAMARA event notification, hence using pre-shared information as alternative solution is proposed. |
patrice-conil
left a comment
There was a problem hiding this comment.
LGTM after the modifications requested by Pedro and Rafal are implemented.
| } | ||
| } | ||
| ``` | ||
| Note: To use `credentialType` with value `PRIVATE_KEY_JWT`, the API Consumer and API Provider shall share |
|
@rartych, @PedroDiez , @patrice-conil
To avoid having the note in 2 places and add the additional references, I propose to add a section to the Security section that explains the pre-requisites for using PRIVATE_KEY_JWT |
PedroDiez
left a comment
There was a problem hiding this comment.
Editorial comment.
LGTM at functional level
Co-authored-by: Pedro Díez García <pedro.diezgarcia@telefonica.com>
Clarified description of ACCESS_TOKEN_EXPIRED reason. Aligned with CAMARA API Design Guide
PedroDiez
left a comment
There was a problem hiding this comment.
Minor point aligned in a commit
What type of PR is this?
What this PR does / why we need it:
This PR proposes to improve the authentication mechanism for subscription events.
It proposes two sink credential types to cater for clients with different authentication and authorization capabilities :
This PR also proposes to remove from the spec two sink credential types that are not required anymore.
Which issue(s) this PR fixes:
Fixes #461
Does this PR introduce a breaking change?
-REFRESHTOKEN credential type is removed. It was not allowed in the current version of the spec.
Special notes for reviewers:
Changelog input
Additional documentation
This section can be blank.