Skip to content

Commit 02841ee

Browse files
Merge pull request #604 from openziti/fix.2282.oidc.totp.flow
related to openziti/ziti#2282 totp OIDC flow fixes
2 parents f853cab + 0a91679 commit 02841ee

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

edge-apis/authwrapper.go

+6-3
Original file line numberDiff line numberDiff line change
@@ -735,7 +735,7 @@ func oidcAuth(clientTransportPool ClientTransportPool, credentials Credentials,
735735
return nil, fmt.Errorf("remote op login response is expected to be HTTP status %d got %d with body: %s", http.StatusOK, resp.StatusCode(), resp.Body())
736736
}
737737

738-
authRequestId := resp.Header().Get(AuthRequestIdHeader)
738+
authRequestId := payload.AuthRequestId
739739
totpRequiredHeader := resp.Header().Get(TotpRequiredHeader)
740740
totpRequired := totpRequiredHeader != ""
741741
totpCode := ""
@@ -775,11 +775,14 @@ func oidcAuth(clientTransportPool ClientTransportPool, credentials Credentials,
775775
}
776776

777777
return nil, apiErr
778-
779778
}
780779
}
781780

782-
tokens := <-rpServer.TokenChan
781+
var tokens *oidc.Tokens[*oidc.IDTokenClaims]
782+
select {
783+
case tokens = <-rpServer.TokenChan:
784+
case <-time.After(30 * time.Minute):
785+
}
783786

784787
if tokens == nil {
785788
return nil, errors.New("authentication did not complete, received nil tokens")

0 commit comments

Comments
 (0)