Skip to content

Commit

Permalink
Merge pull request #604 from openziti/fix.2282.oidc.totp.flow
Browse files Browse the repository at this point in the history
related to openziti/ziti#2282 totp OIDC flow fixes
  • Loading branch information
andrewpmartinez authored Aug 1, 2024
2 parents f853cab + 0a91679 commit 02841ee
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 02841ee

Please sign in to comment.