Adapt login to WorkOS Connect: issuer config, sid-aware revocation, branded callback page - #32
Open
jordanalexmeyer wants to merge 4 commits into
Open
Adapt login to WorkOS Connect: issuer config, sid-aware revocation, branded callback page#32jordanalexmeyer wants to merge 4 commits into
jordanalexmeyer wants to merge 4 commits into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adapts
extend login/extend logout(added in #31) to the WorkOS Connect Standalone authorization server that replaces the home-grown OAuth provider (extend-web PR extend-hq/extend-web#6961).What changed
Auth server resolution (
internal/cli/env.go,login.go)EXTEND_OAUTH_ISSUER(the AuthKit domain, e.g.https://auth.extend.ai— required forextend login, fails with instructions when unset) andEXTEND_OAUTH_CLIENT_ID(defaults to the built-in first-party client).resourceindicator (the API base URL).Logout / revocation (
login.go)POST /oauth/revoke-currentwith the access token (refreshing first when stale); the API denylists the token'ssid, killing every token of the login instantly. Stored records no longer carry aRevocationEndpoint.sidas the grant it replaces. Revocation is sid-keyed, so revoking the replaced grant killed the brand-new session (second login's/mefailed, and the following logout got a 401). Login now decodes thesidclaim from both tokens (oauth.TokenSID, unverified local read) and skips the revoke when they match; opaque/undecodable tokens still revoke best-effort as before.Loopback callback page (
internal/oauth/loopback.go)light-dark(); the logomark renders viacurrentColor.Tests
TestRunLoginSkipsRevokingSameConsentGrant/TestRunLoginRevokesDifferentConsentGrant— the sid guard, plus the existing opaque-token revoke path.TestTokenSID— claim extraction table test (WorkOS JWT, missing claim, opaque, malformed)./oauth/revoke-current.go test ./internal/...green; verified end-to-end against a devbox running the extend-web branch (login → consent → API calls → logout revocation).Notes