-
Notifications
You must be signed in to change notification settings - Fork 5
FedCM - a quick hack #30
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
base: main
Are you sure you want to change the base?
Conversation
|
We should probably keep https://github.com/aaronpk/oauth-fedcm-profile in mind. |
src/core/AuthorizationCodeGrant.ts
Outdated
| // @ts-ignore | ||
| const fedCMissuer = new URL(credential.configURL).origin + '/' | ||
| // @ts-ignore | ||
| return buildRedirectUrl(credential.token, params.state, fedCMissuer) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
using state this way clearly makes no sense, something we need to investigate.
Co-authored-by: mrkvon <mrkvon@protonmail.com> Co-authored-by: Christopher Mühl <toki@toph.so> Co-authored-by: bourgeoa <alain.bourgeois10@gmail.com>
|
@uvdsl what do you think about refactoring your code in a way that allows creating separate package, for example solid-oidc-fedcm-rp which has this package as dependency. As we see here the difference is using redirect vs. using FedCM api in the browser. It should be possible to isolate the redirect logic in a way that the other package uses browser api instead of the redirect 🤔 EDIT: fedcm-rp package should still allow to use the original redirect flow as a fallback! |
|
9de4229 improves a bit to const client_id = 'https://zestful-keely-sootily.ngrok-free.dev/id.jsonld'
const session = new Session({ client_id })
await session.fedCM() |
|
ccd2f0c untangles FedCM further, I'll leave it here unti further feedback I don't think this projet has any formatter, recently I started using https://oxc.rs/#feature-formatter It should be easy to test it with https://github.com/elf-pavlik/mallory/tree/fedcm/cuckoo
On success nothing visible happen, but one can reload to see mallory message that it aborted the exploit attempt. |

Followup to #29
We made it today with @mrkvon @tophcodes, and @bourgeoa
heavily copy & paste from https://github.com/Liquid-Surf/fedcm-demo/tree/main/packages/client by @thhck
I will push later code using it but in short
idpis not used by FedCM and is later extracted from what browser API returns, for now we still passed it to avoid making more changesIt only works with URL Client ID in our case
It took us last 30 min to cheat our way out of trailing
/errors 🤦