Skip to content

Commit c072352

Browse files
authored
feat: add correlation identifier to interactions (#1218)
1 parent 63c044d commit c072352

3 files changed

Lines changed: 3 additions & 0 deletions

File tree

example/my_adapter.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@ class MyAdapter {
140140
* - trusted {string[]} - parameter names that come from a trusted source
141141
* - result {object} - interaction results object is expected here
142142
* - grantId {string} - grant identifier if there's a preexisting one
143+
* - cid {string} - correlating identifier for the Authorization request
143144
* - session {object}
144145
* - session.uid {string} - uid of the session this Interaction belongs to
145146
* - session.cookie {string} - jti of the session this Interaction belongs to

lib/actions/authorization/interactions.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ export default async function interactions(resumeRouteName, ctx, next) {
109109
trusted: oidc.trusted,
110110
session: oidc.session,
111111
grant: oidc.grant,
112+
cid: oidc.entities.Interaction?.cid || nanoid(),
112113
...(oidc.deviceCode ? { deviceCode: oidc.deviceCode.jti } : undefined),
113114
});
114115

lib/models/interaction.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ export default (provider) => class Interaction extends hasFormat(provider, 'Inte
6666
'grantId',
6767
'lastSubmission',
6868
'deviceCode',
69+
'cid',
6970
];
7071
}
7172
};

0 commit comments

Comments
 (0)