diff --git a/src/providers/index.js b/src/providers/index.js index 012357b647..095aefe13c 100644 --- a/src/providers/index.js +++ b/src/providers/index.js @@ -37,6 +37,7 @@ import Twitch from './twitch' import Twitter from './twitter' import VK from './vk' import Yandex from './yandex' +import Zoho from './zoho' export default { Apple, @@ -77,5 +78,6 @@ export default { Twitch, Twitter, VK, - Yandex + Yandex, + Zoho } diff --git a/src/providers/zoho.js b/src/providers/zoho.js new file mode 100644 index 0000000000..ab5cb5e1b5 --- /dev/null +++ b/src/providers/zoho.js @@ -0,0 +1,22 @@ +export default (options) => { + return { + id: 'zoho', + name: 'Zoho', + type: 'oauth', + version: '2.0', + scope: 'AaaServer.profile.Read', + params: { grant_type: 'authorization_code' }, + accessTokenUrl: 'https://accounts.zoho.com/oauth/v2/token', + authorizationUrl: 'https://accounts.zoho.com/oauth/v2/auth?response_type=code', + profileUrl: 'https://accounts.zoho.com/oauth/user/info', + profile: (profile) => { + return { + id: profile.ZUID, + name: `${profile.First_Name} ${profile.Last_Name}`, + email: profile.Email, + image: null + } + }, + ...options + } +} diff --git a/www/docs/providers/zoho.md b/www/docs/providers/zoho.md new file mode 100644 index 0000000000..d1a52189fd --- /dev/null +++ b/www/docs/providers/zoho.md @@ -0,0 +1,26 @@ +--- +id: zoho +title: Zoho +--- + +## Documentation + +https://www.zoho.com/accounts/protocol/oauth/web-server-applications.html + +## Configuration + +https://api-console.zoho.com/ + +## Example + +```js +import Providers from `next-auth/providers` +... +providers: [ + Providers.Zoho({ + clientId: process.env.ZOHO_CLIENT_ID, + clientSecret: process.env.ZOHO_CLIENT_SECRET + }) +] +... +```