Skip to content

[FIX] Custom OAuth Bug#16811

Merged
sampaiodiego merged 1 commit intoRocketChat:developfrom
PrajvalRaval:develop
Mar 12, 2020
Merged

[FIX] Custom OAuth Bug#16811
sampaiodiego merged 1 commit intoRocketChat:developfrom
PrajvalRaval:develop

Conversation

@PrajvalRaval
Copy link
Contributor

@PrajvalRaval PrajvalRaval commented Mar 7, 2020

This pull request fixes a bug in Custom OAuth flow of Rocket.Chat. Custom OAuth right now depends upon the services block of user data to validate and find user from the database. Following is a sample services block, with alexapnr as OAuth servicename:

services: {
  password: {
    bcrypt: '$2b$10$dWQ7Vjfb8jRaT15/wpqdZOZXLmHOM.rx69GQjos.cUM4Oqyszr.ry',
    reset: [ Object ]
  },
  email: {
    verificationTokens: [ Array ]
  },
  resume: {
    loginTokens: [ Array ]
  },
  alexapnr: {
    id: 'Dv8cbqqFYuG6cvmWP',
    accessToken: '57fbbe8c1a16d4b2181e12fc52cfd6e634eaede5',
    email: 'ravalprajval@gmail.com',
    expiresAt: 1583579264954,
    name: 'Prajval Raval',
    roles: [ Array ],
    username: 'prajval.raval'
  }
}

In the above block you can see, the data is stored as services.[serviceName].id: userId but in current Rocket Chat code, we are sending the query as:

const query = { username, [`services.${ serviceName }.id`]: serviceName };

instead of,

const query = { username, [`services.${ serviceName }.id`]: userId };

@PrajvalRaval
Copy link
Contributor Author

@MarcosSpessatto Please review it. Thanks.

@sampaiodiego sampaiodiego changed the title [FIX] Fixing Custom OAuth Bug [FIX] Custom OAuth Bug Mar 12, 2020
@sampaiodiego sampaiodiego merged commit d183e80 into RocketChat:develop Mar 12, 2020
gabriellsh added a commit that referenced this pull request Mar 13, 2020
…exact_search

* 'develop' of github.com:RocketChat/Rocket.Chat: (178 commits)
  [IMPROVE] Add option to require authentication on user's shield endpoint (#16845)
  [FIX] Custom OAuth Bug (#16811)
  [FIX] Integrations page pagination (#16838)
  fix: livechat/facebook missing visitor data after registerGuest (#16810)
  [FIX] Invite links counting users already joined (#16591)
  [FIX] No settings to be displayed if search not found (#16255)
  [FIX] Removed some hardcoded texts (#16304)
  [FIX] Cannot unfollow message from thread's panel (#16560)
  Add Enterprise Edition license (#16801)
  [FIX] Fallback content-type as application/octet-stream for FileSystem uploads (#16776)
  [IMPROVE] Apps-engine E2E tests (#16781)
  [FIX] Remove spaces from i18n placeholders to show Personal access token (#16724)
  [NEW] SAML config to allow clock drift (#16751)
  [FIX] Slash command preview: Wrong item being selected, Horizontal scroll (#16750)
  [FIX] Cannot pin on direct messages (#16759)
  [FIX] Get all channels from Slack via REST API (#16767)
  LingoHub Update 🚀 (#16837)
  [FIX]  Flextab information is not working when clicking on visitor or agent username in Omnichannel messages (#16797)
  Update Node to 12.16.1
  [NEW] Update Meteor to 1.9.2 (#16718)
  ...
ggazzo added a commit to wreiske/Rocket.Chat that referenced this pull request Mar 19, 2020
…4892-wreiske-user-status-bubbles

* 'develop' of github.com:RocketChat/Rocket.Chat: (540 commits)
  [FIX] Show error message if password and confirm password not equal (RocketChat#16247)
  [FIX] Message quote button inside threads (RocketChat#16925)
  Fix wrong imported library meteor/tap:i18n
  lint
  [IMPROVE] User gets feedback when a message has been starred or unstarred (RocketChat#13860)
  [FIX] admin can sort users by email in directory view (RocketChat#15796)
  [FIX] Pinned messages wouldn't collapse (RocketChat#16188)
  [IMPROVE] Added border to page header. (RocketChat#16792)
  [FIX] Correct thread messages display in context bar. (RocketChat#16835)
  [FIX] Public channel cannot be acessed via URL when 'Allow Anonymous Read' is active (RocketChat#16914)
  Fixed Line break incorrectly being called apostrophe (RocketChat#16918)
  [IMPROVE] Context menu autofocus (RocketChat#16915)
  Improve room types usage (RocketChat#16753)
  [NEW] API `users.deactivateIdle` for mass-disabling of idle users (RocketChat#16849)
  [NEW] API to logout from other locations (RocketChat#16193)
  [IMPROVE] Add option to require authentication on user's shield endpoint (RocketChat#16845)
  [FIX] Custom OAuth Bug (RocketChat#16811)
  [FIX] Integrations page pagination (RocketChat#16838)
  reset package-lock to upstream
  Apply suggestions from code review
  ...
ggazzo added a commit that referenced this pull request Mar 20, 2020
…ultiple-users* 'develop' of github.com:RocketChat/Rocket.Chat: (53 commits) [FIX] Show error message if password and confirm password not equal (#16247)  [FIX] Message quote button inside threads (#16925)  Fix wrong imported library meteor/tap:i18n  lint  [IMPROVE] User gets feedback when a message has been starred or unstarred (#13860)  [FIX] admin can sort users by email in directory view (#15796)  [FIX] Pinned messages wouldn't collapse (#16188)  [IMPROVE] Added border to page header. (#16792)  [FIX] Correct thread messages display in context bar. (#16835)  [FIX] Public channel cannot be acessed via URL when 'Allow Anonymous Read' is active (#16914)  Fixed Line break incorrectly being called apostrophe (#16918)  [IMPROVE] Context menu autofocus (#16915)  Improve room types usage (#16753)  [NEW] API `users.deactivateIdle` for mass-disabling of idle users (#16849)  [NEW] API to logout from other locations (#16193)  [IMPROVE] Add option to require authentication on user's shield endpoint (#16845)  [FIX] Custom OAuth Bug (#16811)  [FIX] Integrations page pagination (#16838)  reset package-lock to upstream  Apply suggestions from code review  ...
@sampaiodiego sampaiodiego mentioned this pull request Apr 9, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments