Add the DTT SSO provider - #3
Merged
Merged
Conversation
Signs users in with the DTT SSO (auth-server) via the authorization code flow with scope=openid: - the token endpoint gets the client credentials as unescaped HTTP Basic, which the SSO compares byte for byte (golang.org/x/oauth2 escapes them) - the HS256 id_token is verified with the client secret via golang-jwt; go-jose rejects HMAC keys under 32 bytes, and SSO secrets can be shorter - the session carries the email, the user UUID as the user, and the role as the only group, so allowed_groups can restrict by role - RefreshSession uses the refresh token and re-reads email and role; ValidateSession calls /oauth/check_token Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Adds a
dtt-ssoprovider so oauth2-proxy can protect internal tools with our SSO (auth-server). Stacked on #2.Upstream's generic
oidcprovider cannot be used: the SSO signs id_tokens with HS256 keyed on the client secret and publishes no JWKS, while upstream verifies only asymmetric keys.How it works
scope=openid, the only scope the SSO accepts. Endpoints default tohttps://auth.thebestagent.pro;--login-url,--redeem-urland--validate-urlpoint it elsewhere (e.g. stage)./oauth/tokenas unescaped HTTP Basic. The SSO compares them byte for byte, andgolang.org/x/oauth2URL-escapes them, which breaks base64 secrets.golang-jwt: HS256 only, signature against the client secret, issuer = the login URL's origin, audience = client id, expiry. go-jose is not used because it rejects HMAC keys under 32 bytes, and SSO secrets can be shorter.--allowed-group=dtt_adminrestricts by role.RefreshSessionuses the refresh token and re-reads email and role;ValidateSessioncalls/oauth/check_token. With--cookie-refresh, a user deleted or signed out in the SSO loses access at the next refresh.Each instance needs its own SSO client (one redirect URI per client) and its own
--cookie-name, since the Atlassian proxy sets_oauth2_proxyon.thebestagent.pro. Docs:docs/docs/configuration/providers/dtt_sso.md.Verified
sso-master.dtt.stage.thebestagent.pro): sign-in, id_token verification,dtt_adminas a group,check_token, and a token refresh.Merge with a merge commit, after #2.
🤖 Generated with Claude Code