Skip to content
This repository has been archived by the owner on May 18, 2021. It is now read-only.

Commit

Permalink
fix: add dual duo sid API support (#294)
Browse files Browse the repository at this point in the history
  • Loading branch information
nickatsegment authored Jul 23, 2020
1 parent 650c5e8 commit 98c40a4
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion lib/duo.go
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,14 @@ func (d *DuoClient) DoStatus(txid, sid string) (auth string, status StatusResp,

if status.Response.Result == "SUCCESS" {
if status.Response.ResultURL != "" {
auth, err = d.DoRedirect(status.Response.ResultURL, status.Response.SessionID)
// DUO appears to waver on whether a session ID should come back
// in the response here, if it does, it should be used in the redirect
// before calling the Okta callback.
if status.Response.SessionID != "" {
sid = status.Response.SessionID
}
log.Debugf("Redirecting: %s; sid: %s", status.Response.ResultURL, sid)
auth, err = d.DoRedirect(status.Response.ResultURL, sid)
} else {
auth = status.Response.Cookie
}
Expand Down

2 comments on commit 98c40a4

@mikeborsuk-optimizely
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@nickatsegment Thanks for the fast fix on this, it unblocked our team. Do you happen to also maintain the homebrew formula? Just wondering if this will make its way into a release there shortly.

@nickatsegment
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Credit for the fix goes to @eculver! 👏

We don't maintain the official homebrew formula but they're receptive to PRs. I think there might even be an automated process, though I don't know the details.

Please sign in to comment.