-
Notifications
You must be signed in to change notification settings - Fork 10.8k
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
[NEW][API] Endpoint settings.addCustomOAuth
to create Custom OAuth services
#14912
[NEW][API] Endpoint settings.addCustomOAuth
to create Custom OAuth services
#14912
Conversation
…eft/Rocket.Chat into api-create-oauth-service
Just a thought, but is it worth looking at this as well while you are at it? |
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.
Please try to make a few more of these fields required.
Especially the critical things to make it work. Like:
- url
- client id
- client secret
@reetp I think if addressing that feature request would need to open a new PR as wouldn't fit in the scope of this PR |
@geekgonecrazy I think the current implementation is correct. This mimics the behavior in the application. First you provide a name and the custom Oauth is created. Then you make edits and provide additional values. These values would be set via the REST API using the Settings update call. This would prevent having to update the REST API call proposed, in the future if some settings should change. Also, in the code you shared for addOauthService, it only accepts one parameter of name so the proposed solution is also consistent for this reason. It then continues on the create all the parameters you'll need so that you can call the settings update REST API for each one you need to change. Let me know if I'm missing something. Would love to see this feature in the next release. |
Ah good point! Not sure how I missed that. It is definitely too bad that that doesn’t return the settings created to make it easier for the following call. But I can’t think of a clean way to do that. |
Thanks for the comments, everyone! @reetp I'm sorry, but that does seem a bit far out of scope for this pull request, especially because it concerns very different parts of the application. @codakin Thank you, that does fit my reasoning perfectly. Basically my implementation just provides an API route for what the admin UI "Add OAuth Service" button does. I set the options for the created OAuth Service via the options (settings?) API. @geekgonecrazy Thank you for the change request. codakin explained the reason behind the lack of further parameters to the route. If the explanation is sufficient, could you please close the request? I believe returning a list of options would break consistency with the API of Rocket.Chat in general and the paths to update the properties of an arbitrary OAuth Service are quite easy to generate. I can supply examples for the documentation if you want. |
Related #10420 |
Is there any plan on including this in one of the next releases? Would parts of this code probably solve #10420 , if yes, could they be probably provided as separate PR? Thanks |
I've re-requested a review, as it seems this has gone to sleep. :) |
@geekgonecrazy @g-rauhoeft Can you merge this PR? Any updates? |
Sorry mate, nothing I can do because I'm not a member of the Rocket.Chat team and haven't got write access. |
# Conflicts: # package-lock.json
settings.addCustomOAuth
to create Custom OAuth services
…rewrite_admin_sidebar * 'develop' of github.com:RocketChat/Rocket.Chat: (30 commits) Readme: Update Raspberry Pi 2 to Pi 4 (#17031) [NEW] Accept variable `#{userdn}` on LDAP group filter (#16273) [FIX] Spotify embed link opens in same tab (#13637) [FIX] Markdown links not accepting URLs with parentheses (#13605) [NEW][API] Endpoint `settings.addCustomOAuth` to create Custom OAuth services (#14912) [IMPROVE] Make the implementation of custom code easier by having placeholders for a custom folder (#15106) [NEW] Skip Export Operations that haven't been updated in over a day (#16135) [NEW] Highlight matching words in message search results (#16166) [FIX] Set `x-content-type-options: nosniff` header (#16232) [FIX] Disabling `Json Web Tokens protection to file uploads` disables the File Upload protection entirely (#16262) Fixes some italian word (#14008) Bump version to 3.4.0-develop Bump version to 3.3.0 Bump version to 3.3.0-rc.4 Bump version to 3.3.0-rc.3 Bump version to 3.3.0-rc.2 Bump version to 3.3.0-rc.1 Bump version to 3.3.0-rc.0 [FIX] Slack importer Link handling (#17595) Bump version to 3.2.2 ...
…into new/apps_rewrite * 'new/apps_rewrite' of github.com:RocketChat/Rocket.Chat: (31 commits) Readme: Update Raspberry Pi 2 to Pi 4 (#17031) [NEW] Accept variable `#{userdn}` on LDAP group filter (#16273) [FIX] Spotify embed link opens in same tab (#13637) [FIX] Markdown links not accepting URLs with parentheses (#13605) [NEW][API] Endpoint `settings.addCustomOAuth` to create Custom OAuth services (#14912) [IMPROVE] Make the implementation of custom code easier by having placeholders for a custom folder (#15106) [NEW] Skip Export Operations that haven't been updated in over a day (#16135) [NEW] Highlight matching words in message search results (#16166) [FIX] Set `x-content-type-options: nosniff` header (#16232) [FIX] Disabling `Json Web Tokens protection to file uploads` disables the File Upload protection entirely (#16262) Fixes some italian word (#14008) Submit a payload to the release service when a release happens (#17775) Bump version to 3.4.0-develop Bump version to 3.3.0 Bump version to 3.3.0-rc.4 Bump version to 3.3.0-rc.3 Bump version to 3.3.0-rc.2 Bump version to 3.3.0-rc.1 Bump version to 3.3.0-rc.0 [FIX] Slack importer Link handling (#17595) ...
…nto develop * 'develop' of https://github.com/RocketChat/Rocket.Chat: (83 commits) Fix invalid develop payload to release service (RocketChat#17799) Readme: Update Raspberry Pi 2 to Pi 4 (RocketChat#17031) [NEW] Accept variable `#{userdn}` on LDAP group filter (RocketChat#16273) [FIX] Spotify embed link opens in same tab (RocketChat#13637) [FIX] Markdown links not accepting URLs with parentheses (RocketChat#13605) [NEW][API] Endpoint `settings.addCustomOAuth` to create Custom OAuth services (RocketChat#14912) [IMPROVE] Make the implementation of custom code easier by having placeholders for a custom folder (RocketChat#15106) [NEW] Skip Export Operations that haven't been updated in over a day (RocketChat#16135) [NEW] Highlight matching words in message search results (RocketChat#16166) [FIX] Set `x-content-type-options: nosniff` header (RocketChat#16232) [FIX] Disabling `Json Web Tokens protection to file uploads` disables the File Upload protection entirely (RocketChat#16262) Fixes some italian word (RocketChat#14008) Submit a payload to the release service when a release happens (RocketChat#17775) Bump version to 3.4.0-develop Bump version to 3.3.0 Bump version to 3.3.0-rc.4 Regression: Fix Unread bar design (RocketChat#17750) Regression: Adjusting spaces between OAuth login buttons (RocketChat#17745) Improved thread margins for clarity Bump version to 3.3.0-rc.3 ... � Conflicts: � app/theme/client/imports/general/variables.css � app/ui-sidenav/client/sideNav.html
…/new-threads * 'develop' of github.com:RocketChat/Rocket.Chat: (38 commits) [IMPROVE][Federation] Add support for _tcp and protocol DNS entries (#17818) Fix the update check not working (#17809) Add Apps-Engine to Engine Versions on History (#17810) [FIX] Link preview containing HTML encoded chars (#16512) [FIX] Email link "go to message" being incorrectly escaped (#17803) [FIX] Error when re-installing an App (#17789) Update Apps-Engine version (#17804) Fix invalid develop payload to release service (#17799) Readme: Update Raspberry Pi 2 to Pi 4 (#17031) [NEW] Accept variable `#{userdn}` on LDAP group filter (#16273) [FIX] Spotify embed link opens in same tab (#13637) [FIX] Markdown links not accepting URLs with parentheses (#13605) [NEW][API] Endpoint `settings.addCustomOAuth` to create Custom OAuth services (#14912) [IMPROVE] Make the implementation of custom code easier by having placeholders for a custom folder (#15106) [NEW] Skip Export Operations that haven't been updated in over a day (#16135) [NEW] Highlight matching words in message search results (#16166) [FIX] Set `x-content-type-options: nosniff` header (#16232) [FIX] Disabling `Json Web Tokens protection to file uploads` disables the File Upload protection entirely (#16262) Fixes some italian word (#14008) Bump version to 3.4.0-develop ...
This pull request adds a new path to the app/api/server/v1/settings.js file, called "settings.addCustomOAuth", which allows users to create a new custom OAuth Service definition via the REST interface, as discussed under https://forums.rocket.chat/t/add-custom-oauth-via-rest-api/3967.