-
Notifications
You must be signed in to change notification settings - Fork 22
Add ODIC Back-Channel Logout #304
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: develop
Are you sure you want to change the base?
Conversation
|
Uh, whoops. Literally just heavily modified the session system for MFA. I'll take a look and see what works for both OIDC and MFA. |
|
This is ready to be reviewed now |
DecDuck
left a comment
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.
Just some nitpick stuff, will have more of a look over when I have a wider screen (I'm on mobile).
|
Fixed |
04d4817 to
b40eee2
Compare
|
Typecheck is very unhappy |
|
Fixed |
| }); | ||
| return { userId: authMek.userId, result }; | ||
|
|
||
| return { result: true, userId: authMek.userId }; |
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.
Result needs to be returned, it's a enum containing "fail", "2fa" or "success" - the client uses it to redirect.
| import sessionHandler from "../../session"; | ||
| import type { SessionSearchTerms } from "../../session/types"; | ||
|
|
||
| // TODO: monitor https://github.com/goauthentik/authentik/issues/8751 for easier?? OIDC setup by end users |
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.
Do we know if any self-hosted IDP that has this spec implemented? Would love to have the feature.
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.
No idea tbh
| if (!configuration) | ||
| throw new Error("OIDC try to init without configuration"); | ||
|
|
||
| if (systemConfig.shouldOidcRequireHttps()) { |
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.
Maybe refactor into an array and a loop to check them all?
| issuer: this.oidcConfiguration.issuer.toString(), | ||
| }); | ||
| } catch (e) { | ||
| console.error("Failed to verify OIDC logout token:", e); |
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.
logger?
| } | ||
| for (const [key, value] of Object.entries(options.data || {})) { | ||
| // stringify to do deep comparison | ||
| if (JSON.stringify(session.data[key]) !== JSON.stringify(value)) { |
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.
Need to use JSON.stringify(sortMyObj, Object.keys(sortMyObj).sort()) to sort keys to ensure this check works if the objects are modified in different orders.
Alternatively, keep it this way and add comment explaining we don't sort keys because we want the objects to be truly identical.
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.
I need to double check it, but you can't use Object#getKeys on a non object.
| // this.sessionProvider = createMemorySessionProvider(); | ||
| } | ||
|
|
||
| // async signin( |
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.
Can probably be removed
|
Just reviewed. Also, does this need a test with the new MFA stuff? |
|
Yea, I don't have the setup to properly test the changes rn |
Let an ODIC provider sign out users. Also attempted to make the server more spec compliant by verifying responses and enforcing HTTPS for providers by default.