-
Notifications
You must be signed in to change notification settings - Fork 284
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
authorize: add support for logging id token #4392
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,6 +16,7 @@ const ( | |
AuthorizeLogFieldEmail AuthorizeLogField = "email" | ||
AuthorizeLogFieldHeaders = AuthorizeLogField(headersFieldName) | ||
AuthorizeLogFieldHost AuthorizeLogField = "host" | ||
AuthorizeLogFieldIDToken AuthorizeLogField = "id-token" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. (optional) I wonder if it would make sense to allow the user to choose between just the raw ID token or just the decoded claims. Should we add an explicit There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The requirements stated that both should be logged
Though maybe I misunderstood what was being asked for. |
||
AuthorizeLogFieldImpersonateEmail AuthorizeLogField = "impersonate-email" | ||
AuthorizeLogFieldImpersonateSessionID AuthorizeLogField = "impersonate-session-id" | ||
AuthorizeLogFieldImpersonateUserID AuthorizeLogField = "impersonate-user-id" | ||
|
@@ -63,6 +64,7 @@ var authorizeLogFieldLookup = map[AuthorizeLogField]struct{}{ | |
AuthorizeLogFieldEmail: {}, | ||
AuthorizeLogFieldHeaders: {}, | ||
AuthorizeLogFieldHost: {}, | ||
AuthorizeLogFieldIDToken: {}, | ||
AuthorizeLogFieldImpersonateEmail: {}, | ||
AuthorizeLogFieldImpersonateSessionID: {}, | ||
AuthorizeLogFieldImpersonateUserID: {}, | ||
|
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 changes required)
Do we already verify the ID token signature somewhere else, and that's why it's fine to fine to call UnsafeClaimsWithoutVerification() here?
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 don't know about the security ramifications of this. Verifying the signature of the ID token against the configured identity provider would be difficult to implement here (and also likely very slow)
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.
It looks like there's some verification related to ID tokens here:
pomerium/internal/identity/oidc/oidc.go
Line 225 in baf8918
Do you know if all ID tokens come from that
getIDToken()
method?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.
The ID token comes from the identity provider and is saved to the session.