We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
We have a method called: registerAccessTokenService Source found: https://github.com/RocketChat/Rocket.Chat/blob/develop/app/lib/server/oauth/oauth.js#L9
registerAccessTokenService
It is executed from the login endpoint: https://github.com/RocketChat/Rocket.Chat/blob/develop/app/lib/server/oauth/oauth.js#L27
So when you do a login like:
curl -H "Content-type:application/json" \ http://localhost:3000/api/v1/login \ -d '{ "serviceName": "yourOauth", "accessToken": "tokenFromOauthProvider", "expiresIn": 200 }'
serviceName matches the oauth service registered and executes the function passed. That returns an object like:
{ serviceData, options: { profile: { name: identity.name, }, }, };
That then finds or creates an account here: https://github.com/RocketChat/Rocket.Chat/blob/develop/app/lib/server/oauth/oauth.js#L54
An example of an oauth provider registering: https://github.com/RocketChat/Rocket.Chat/blob/develop/app/lib/server/oauth/google.js#L28
It takes the access token and calls google with it to get the identity: https://github.com/RocketChat/Rocket.Chat/blob/develop/app/lib/server/oauth/google.js#L10
This is ensuring its valid as well as getting some info about the user that the token belongs to.
The data is then pieced together: https://github.com/RocketChat/Rocket.Chat/blob/develop/app/lib/server/oauth/google.js#L39
picked of only the fields we want: https://github.com/RocketChat/Rocket.Chat/blob/develop/app/lib/server/oauth/google.js#L46
then returned as mentioned above.
That needs added in here: https://github.com/RocketChat/Rocket.Chat/blob/develop/app/custom-oauth/server/custom_oauth_server.js making use of the access patterns setup. Can likely reuse a lot of the code/functions already there to make this not so bad.
This would also close out: #5521
The text was updated successfully, but these errors were encountered:
On it, will try to fix this
Sorry, something went wrong.
@knrt10 awesome! Feel free to request my review on it when you open a PR. Will gladly help you shape it up and test it.
I'll created a provider for EGroupware OpenID Connect / OAuth server, I'll refactor it for all custom OAuth servers and send a pull request soon.
Successfully merging a pull request may close this issue.
We have a method called:
registerAccessTokenService
Source found: https://github.com/RocketChat/Rocket.Chat/blob/develop/app/lib/server/oauth/oauth.js#L9
It is executed from the login endpoint: https://github.com/RocketChat/Rocket.Chat/blob/develop/app/lib/server/oauth/oauth.js#L27
So when you do a login like:
serviceName matches the oauth service registered and executes the function passed. That returns an object like:
That then finds or creates an account here: https://github.com/RocketChat/Rocket.Chat/blob/develop/app/lib/server/oauth/oauth.js#L54
An example of an oauth provider registering:
https://github.com/RocketChat/Rocket.Chat/blob/develop/app/lib/server/oauth/google.js#L28
It takes the access token and calls google with it to get the identity: https://github.com/RocketChat/Rocket.Chat/blob/develop/app/lib/server/oauth/google.js#L10
This is ensuring its valid as well as getting some info about the user that the token belongs to.
The data is then pieced together: https://github.com/RocketChat/Rocket.Chat/blob/develop/app/lib/server/oauth/google.js#L39
picked of only the fields we want: https://github.com/RocketChat/Rocket.Chat/blob/develop/app/lib/server/oauth/google.js#L46
then returned as mentioned above.
That needs added in here: https://github.com/RocketChat/Rocket.Chat/blob/develop/app/custom-oauth/server/custom_oauth_server.js making use of the access patterns setup. Can likely reuse a lot of the code/functions already there to make this not so bad.
This would also close out: #5521
The text was updated successfully, but these errors were encountered: