Sync Personnummer to Member System via Vipps Login
When a user authenticates with Vipps and the Vipps OIDC token contains a personnummer claim, the Vipps Integration Service extracts this value after successful token exchange and compares it against the user's existing member record in Supabase. If the member record lacks a personnummer or has a mismatched value, the service initiates a sync update to the member system integration layer. The sync is silent and automatic — the user receives no disruptive notification unless the sync fails, in which case the failure is logged for coordinator review. This feature directly addresses the longstanding data quality problem identified across NHF, Blindeforbundet, and HLF.
User Story
Acceptance Criteria
- Given a Vipps login where the ID token contains a personnummer claim, when the Vipps Integration Service processes the token, then it checks the user's member record for an existing personnummer value
- Given a member record with no personnummer, when a personnummer is extracted from Vipps, then the member record is updated automatically and the sync is logged with a timestamp and source ('vipps-login')
- Given a member record with a matching personnummer, when the same value arrives from Vipps, then no update is performed and the event is silently logged as 'confirmed, no change'
- Given a member record with a conflicting personnummer, when a different value arrives from Vipps, then the conflict is logged for manual coordinator review and no automatic override is performed
- Given a Vipps login where the personnummer claim is absent (user did not grant that scope), when the token is processed, then login proceeds normally with no sync attempt and no error shown to the user
- Given a sync attempt that fails due to member system unavailability, when the sync service returns an error, then the authentication still succeeds, the failure is logged, and the sync is queued for retry without interrupting the user's session
Business Value
Missing personnummer values in member records are a critical data quality issue across all three organizations. They prevent correct identity matching, cause duplicate records, and complicate Bufdir grant reporting where beneficiary identity must be traceable. Automatically capturing personnummer at Vipps login resolves this without any user effort, delivering immediate data quality improvement as a side effect of authentication — a uniquely high-value outcome from a single technical implementation.
Components
- Vipps Integration Service service
- Vipps API Gateway infrastructure
- Auth Token Repository data