Skip to content

Commit

Permalink
feat(provider): add Kakao provider (#1459)
Browse files Browse the repository at this point in the history
  • Loading branch information
taehwanno committed Mar 6, 2021
1 parent a7e08e2 commit ba7aed1
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/providers/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import GitLab from './gitlab'
import Google from './google'
import IdentityServer4 from './identity-server4'
import Instagram from './instagram'
import Kakao from './kakao'
import LINE from './line'
import LinkedIn from './linkedin'
import MailRu from './mailru'
Expand Down Expand Up @@ -58,6 +59,7 @@ export default {
Google,
IdentityServer4,
Instagram,
Kakao,
LINE,
LinkedIn,
MailRu,
Expand Down
21 changes: 21 additions & 0 deletions src/providers/kakao.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
export default (options) => {
return {
id: 'kakao',
name: 'Kakao',
type: 'oauth',
version: '2.0',
params: { grant_type: 'authorization_code' },
accessTokenUrl: 'https://kauth.kakao.com/oauth/token',
authorizationUrl: 'https://kauth.kakao.com/oauth/authorize?response_type=code',
profileUrl: 'https://kapi.kakao.com/v2/user/me',
profile: (profile) => {
return {
id: profile.id,
name: profile.kakao_account?.profile.nickname,
email: profile.kakao_account?.email,
image: profile.kakao_account?.profile.profile_image_url
}
},
...options
}
}
32 changes: 32 additions & 0 deletions www/docs/providers/kakao.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
---
id: kakao
title: Kakao
---

## Documentation

https://developers.kakao.com/product/kakaoLogin

## Configuration

https://developers.kakao.com/docs/latest/en/kakaologin/common

## Example

```js
import Providers from `next-auth/providers`
...
providers: [
Providers.Kakao({
clientId: process.env.KAKAO_CLIENT_ID,
clientSecret: process.env.KAKAO_CLIENT_SECRET
})
]
...
```

## Instructions

### Configuration

Create a provider and a Kakao application at `https://developers.kakao.com/console/app`. In the settings of the app under Kakao Login, activate web app, change consent items and configure callback URL.

1 comment on commit ba7aed1

@vercel
Copy link

@vercel vercel bot commented on ba7aed1 Mar 6, 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.