Skip to content

Commit

Permalink
related to openziti/ziti#2282 totp OIDC flow fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewpmartinez committed Aug 1, 2024
1 parent f853cab commit 0a91679
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions edge-apis/authwrapper.go
Original file line number Diff line number Diff line change
Expand Up @@ -735,7 +735,7 @@ func oidcAuth(clientTransportPool ClientTransportPool, credentials Credentials,
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())
}

authRequestId := resp.Header().Get(AuthRequestIdHeader)
authRequestId := payload.AuthRequestId
totpRequiredHeader := resp.Header().Get(TotpRequiredHeader)
totpRequired := totpRequiredHeader != ""
totpCode := ""
Expand Down Expand Up @@ -775,11 +775,14 @@ func oidcAuth(clientTransportPool ClientTransportPool, credentials Credentials,
}

return nil, apiErr

}
}

tokens := <-rpServer.TokenChan
var tokens *oidc.Tokens[*oidc.IDTokenClaims]
select {
case tokens = <-rpServer.TokenChan:
case <-time.After(30 * time.Minute):
}

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

0 comments on commit 0a91679

Please sign in to comment.