fix(oidc): thread real acr/amr through op_session creation + refresh family #288
No reviewers
Labels
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
psa-systems/bunyip!288
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/BUNYIP-257-acr-amr-threading"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
BUNYIP-257: every op_session row and every rotated at+jwt previously carried hardcoded
acr = "urn:bunyip:loa:pwd"+amr = ["pwd"]regardless of the actual authentication method. A TOTP-completed login, a magic-link login, and a vanilla password login were indistinguishable to RPs. RPs that gate step-up auth onamr contains "mfa" / "otp"were misled; the OIDC at+jwt was reportingpwdfor users who had cleared a second factor.establish_op_session signature change. The bunyip-api wrapper now takes
acr+amrfrom the caller and passes them through toOidcProvider::create_op_session(which already had the parameters). Three named constants live next to the function:ACR_PASSWORD,ACR_MFA,ACR_OTP. The five existing call sites inauth.rspass the right values per flow:register/login(no MFA) /accept_invite/setup_admin: ACR_PASSWORD + ["pwd"].verify_magic_link: ACR_OTP + ["otp"].totp::verify: ACR_MFA + ["pwd", "mfa"] (TOTP verify only fires after a password attempt that returned TwoFactorRequired).Refresh family carries acr/amr forward. New migration
20260701000020_refresh_family_acr_amr.sqladdsacr TEXT NOT NULL DEFAULT 'urn:bunyip:loa:pwd'andamr TEXT[] NOT NULL DEFAULT ARRAY['pwd']torefresh_token_families.issue_refresh_tokengainsacr/amrparameters and persists them on the family.rotate_refresh_tokenJOINs the family soRotatedTokenscarries them on every rotation.handle_refresh_grantreads from the rotation result instead of stamping the hardcoded defaults. The legacy default columns let existing families finish out their idle/absolute TTLs without a schema break.Code-to-token exchange passes
code_row.acr/code_row.amr(already onoauth_authorization_codessince BUNYIP-62) intoissue_refresh_token, so the truthful values are persisted on the family from minute one.Silent-SSO branches in oidc.rs:649 + :705 (the hub
access_token/refresh_tokencookie paths) STILL hardcode pwd/pwd because the hub HS256 JWT claims don't carry acr/amr. Fixing that requires expandingAccessTokenClaims/RefreshTokenClaimsto ride those fields, which is its own follow-up ticket (the audit's silent-SSO concern is bigger than acr/amr alone).#BUNYIP-257