Skip to content

Commit

Permalink
feat(provider): add Zoho provider (#1516)
Browse files Browse the repository at this point in the history
* feat(provider): add zoho

* fix: use LF instead of CRLF

* fix: crlf to lf line endings

Co-authored-by: Balázs Orbán <info@balazsorban.com>
  • Loading branch information
jkwiz and balazsorban44 committed Mar 16, 2021
1 parent 07a3f76 commit 776b948
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/providers/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -77,5 +78,6 @@ export default {
Twitch,
Twitter,
VK,
Yandex
Yandex,
Zoho
}
22 changes: 22 additions & 0 deletions src/providers/zoho.js
Original file line number Diff line number Diff line change
@@ -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
}
}
26 changes: 26 additions & 0 deletions www/docs/providers/zoho.md
Original file line number Diff line number Diff line change
@@ -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
})
]
...
```

1 comment on commit 776b948

@vercel
Copy link

@vercel vercel bot commented on 776b948 Mar 16, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.