-
Notifications
You must be signed in to change notification settings - Fork 69
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
Update tokens when they get refreshed on User Level OAuth #235
Comments
func (c *OAuthClient) getUserViaOAuth(user *model.User) (*User, error) {
url := fmt.Sprintf("%s/users/me", c.apiURL)
currentToken, err := c.api.GetZoomSuperUserToken()
if err != nil {
return nil, errors.Wrap(err, "error getting zoom super user token")
}
tokenSource := c.config.TokenSource(context.Background(), currentToken)
updatedToken, err := tokenSource.Token()
if err != nil {
return nil, errors.Wrap(err, "error getting token from token source")
}
if updatedToken.AccessToken != currentToken.AccessToken {
kvErr := c.api.SetZoomSuperUserToken(updatedToken)
if kvErr != nil {
return nil, errors.Wrap(kvErr, "error setting new token")
}
}
c.token = updatedToken
if c.isAccountLevel {
url = fmt.Sprintf("%s/users/%s", c.apiURL, user.Email)
} Is it good to update like that ? @larkox |
This seems the functionality for the account level oauth, not for the user level oauth. Feel free to create a PR so we can look better at the changelog. |
jupriano
pushed a commit
to jupriano/mattermost-plugin-zoom
that referenced
this issue
Nov 17, 2021
jupriano
pushed a commit
to jupriano/mattermost-plugin-zoom
that referenced
this issue
Nov 24, 2021
jupriano
pushed a commit
to jupriano/mattermost-plugin-zoom
that referenced
this issue
Dec 14, 2021
jupriano
pushed a commit
to jupriano/mattermost-plugin-zoom
that referenced
this issue
Dec 14, 2021
jupriano
pushed a commit
to jupriano/mattermost-plugin-zoom
that referenced
this issue
Dec 14, 2021
jupriano
added a commit
to jupriano/mattermost-plugin-zoom
that referenced
this issue
Dec 14, 2021
jupriano
added a commit
to jupriano/mattermost-plugin-zoom
that referenced
this issue
Dec 22, 2021
hanzei
added a commit
to jupriano/mattermost-plugin-zoom
that referenced
this issue
Jan 25, 2022
larkox
pushed a commit
that referenced
this issue
Feb 7, 2022
* [GH-235] Refresh token on user level oauth (#235) * [GH-235] Add Oauth User Level Refresh Token (#235) * [GH-235] Remove Unwanted Change * [GH-235] Add Error Log * [GH-235] Add Oauth User Level Refresh Token (#235) Co-authored-by: root <[email protected]> Co-authored-by: jupriano <[email protected]> Co-authored-by: Ben Schumacher <[email protected]>
mickmister
pushed a commit
that referenced
this issue
Feb 24, 2022
* [GH-235] Refresh token on user level oauth (#235) * [GH-235] Add Oauth User Level Refresh Token (#235) * [GH-235] Remove Unwanted Change * [GH-235] Add Error Log * [GH-235] Add Oauth User Level Refresh Token (#235) Co-authored-by: root <[email protected]> Co-authored-by: jupriano <[email protected]> Co-authored-by: Ben Schumacher <[email protected]>
mickmister
added a commit
that referenced
this issue
Jul 14, 2022
mickmister
added a commit
that referenced
this issue
Jul 21, 2022
@mickmister I think this issue has been fixed with PR #253. Can you please confirm that? If yes, can we close this issue? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Right now, on Account Level OAuth, OAuth tokens are updated when the token gets refreshed.
mattermost-plugin-zoom/server/zoom/oauth.go
Lines 101 to 120 in 2acac55
This should be also done for User Level Apps. Also, it would be nice to check if all paths are correctly updating all the tokens (User Level and Account Level).
The text was updated successfully, but these errors were encountered: