-
Notifications
You must be signed in to change notification settings - Fork 20
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
CredentialOfferSession notification_id structure #124
Comments
@auer-martin what about the notification_id in the CredentialResponse:
I haven't tested if it's the same. But when they are different, we should remove it from the credentialoffersession, shouldn't we? Otherwise it gets difficult to map the notification_ids to the different types in the session. |
I am not entirely sure what you mean. I thought a structure like this might make sense. export interface CredentialOfferSession extends StateType {
...
credentialIssuanceState: {
[notificationId]: {
credentialId: string,
notificationEvent?: notificationEvent
}
} Each CredentialResponse has a unique notification_id, and you send that id to the notification endpoint. |
My fault, I was talking from the client side, not from the RP side. So we need also to set a flag that we already got a repsonse and do not need to run an internal function again. When the access token got invalid, we are safe to remove the notification id. |
Yeah, although I am not entirely sure about not calling an internal function again. The problem lies whenever we get a call from a wallet if the session is already cleaned up because it was expired. Up until now the sessions were typically relatively short lived. This would need a more durable storage. I am leaning towards a solution where we still store the notification ides in the session. It is then on any session persistence implementation, how long they keep sessions around (that is not necessarily the expiration time). If the notification id is found in the session we add an additional flag to the internal event that the notification id was correlated with the session. If not found we have a value that we could not match it to the session. In all cases we generate the events, to notify any listeners. That way any downstream listeners can decide how to handle it. So to the outside world we are always returning okay. Internally we are always generating events, with a flag that shows whether the notification id was found in the sessions or not. There is no notion of duplicates or anything. The other route would be to only generate the event internally once. But that would mean we need durable persistence for notification ids and keep track of a time at which we received the notification from the wallet |
Currently, credential offer sessions contain a notification_id property.
As multiple credentials can be offered and requested during a credential offer session, there should/may be multiple notification IDs.
Therefore, I think we need to restructure this so that multiple credential_offer id properties can exist and be correlated to the particular credential being offered.
The text was updated successfully, but these errors were encountered: