Skip to content
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

Should processOAuthCallback throw when previous cookie signature is invalid? #105

Open
andrew-nowak opened this issue Oct 7, 2022 · 0 comments

Comments

@andrew-nowak
Copy link
Member

ref:

val existingAuth = CookieUtils.parseCookieData(c.value, settings.publicKey)
logger.debug("user re-authed, merging auth data")
claimedAuth.copy(
authenticatingSystem = system,
authenticatedIn = existingAuth.authenticatedIn ++ Set(system),
multiFactor = checkMultifactor(claimedAuth)
)

guardian/grid#3865

When panda gets the oauth callback, it tries to parse any previous panda cookie and merge the authorised systems. But if for some reason the previous panda cookie was signed with a different private key, then the signature won't match and an exception will be thrown preventing a new cookie from being minted (even if that cookie is expired, you'll be stuck in this situation until you clear your cookie manually).

I suspect it's not a common problem as the panda keys don't change, we only noticed on the Grid when testing our alternative (local dev) oauth provider.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant