-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
connector: Connectors without a RefreshConnector should not error out #872
Conversation
2b5a21f
to
4826fb3
Compare
server/handlers.go
Outdated
@@ -647,7 +647,15 @@ func (s *Server) handleAuthCode(w http.ResponseWriter, r *http.Request, client s | |||
|
|||
reqRefresh := func() bool { | |||
for _, scope := range authCode.Scopes { | |||
if scope == scopeOfflineAccess { | |||
conn, ok := s.connectors[authCode.ConnectorID] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add a comment here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also this check needs to happen outside the for loop :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
c6ee5fb
to
10b1c1f
Compare
s.tokenErrHelper(w, errServerError, "", http.StatusInternalServerError) | ||
return false | ||
} | ||
_, ok = conn.Connector.(connector.RefreshConnector) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can short circuit this.
if !ok {
return false
}
This avoids the loop in some cases.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
…refresh token instead of erroring
10b1c1f
to
5950285
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
connector: Connectors without a RefreshConnector should not error out
fixes #871.
Tested this change by running the example-app with okta. The "Creating SAML data: SAML does not support offline access" error is no longer displayed. The example app does not display a refresh token on the final out put page.