Skip to content

Commit b8b21af

Browse files
committed
fixes
1 parent 2a2a535 commit b8b21af

File tree

3 files changed

+19
-11
lines changed

3 files changed

+19
-11
lines changed

cmd/ssokenizer/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ func Run(ctx context.Context, args []string) error {
7070
}
7171

7272
type Config struct {
73-
// Full URL of the tokenizer service
73+
// Full URL of the ssokenizer service
7474
URL string `yaml:"url"`
7575

7676
// Tokenizer seal (public) key

etc/ssokenizer.yml

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# Full URL of the ssokenizer service
2+
url: "$SSOKENIZER_URL"
3+
14
# Public part of tokenizer's keypair
25
seal_key: "$TOKENIZER_SEAL_KEY"
36

@@ -148,12 +151,12 @@ identity_providers:
148151
scopes:
149152
- "$GITHUB_AUTH_SCOPES"
150153

151-
vanta:
152-
secret_auth:
153-
bearer: "$PROXY_AUTH"
154-
profile: vanta
155-
client_id: "$VANTA_CLIENT_ID"
156-
client_secret: "$VANTA_CLIENT_SECRET"
157-
return_url: "$VANTA_RETURN_URL"
158-
scopes:
159-
- "$VANTA_AUTH_SCOPES"
154+
# vanta:
155+
# secret_auth:
156+
# bearer: "$PROXY_AUTH"
157+
# profile: vanta
158+
# client_id: "$VANTA_CLIENT_ID"
159+
# client_secret: "$VANTA_CLIENT_SECRET"
160+
# return_url: "$VANTA_RETURN_URL"
161+
# scopes:
162+
# - "$VANTA_AUTH_SCOPES"

oauth2/oauth2.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,12 @@ func (p *Provider) handleCallback(w http.ResponseWriter, r *http.Request) {
128128
return
129129
}
130130

131-
tok, err := p.OAuthConfig.Exchange(r.Context(), code, oauth2.AccessTypeOffline)
131+
opts := []oauth2.AuthCodeOption{oauth2.AccessTypeOffline}
132+
if p.OAuthConfig.RedirectURL == "" {
133+
opts = append(opts, oauth2.SetAuthURLParam("redirect_uri", p.URL.JoinPath(callbackPath).String()))
134+
}
135+
136+
tok, err := p.OAuthConfig.Exchange(r.Context(), code, opts...)
132137
if err != nil {
133138
r = withError(r, fmt.Errorf("failed exchange: %w", err))
134139
tr.ReturnError(w, r, "bad response")

0 commit comments

Comments
 (0)