Skip to content

Commit

Permalink
feat(provider): add LINE provider (#1091)
Browse files Browse the repository at this point in the history
  • Loading branch information
bebax authored and balazsorban44 committed Feb 1, 2021
1 parent a18ec09 commit ea1d09b
Show file tree
Hide file tree
Showing 6 changed files with 62 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/providers/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import GitHub from './github'
import GitLab from './gitlab'
import Google from './google'
import IdentityServer4 from './identity-server4'
import LINE from './line'
import LinkedIn from './linkedin'
import MailRu from './mailru'
import Mixer from './mixer'
Expand Down Expand Up @@ -50,6 +51,7 @@ export default {
GitLab,
Google,
IdentityServer4,
LINE,
LinkedIn,
MailRu,
Mixer,
Expand Down
22 changes: 22 additions & 0 deletions src/providers/line.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
export default (options) => {
return {
id: 'line',
name: 'LINE',
type: 'oauth',
version: '2.0',
scope: 'profile openid',
params: { grant_type: 'authorization_code' },
accessTokenUrl: 'https://api.line.me/oauth2/v2.1/token',
authorizationUrl: 'https://access.line.me/oauth2/v2.1/authorize?response_type=code',
profileUrl: 'https://api.line.me/v2/profile',
profile: (profile) => {
return {
id: profile.userId,
name: profile.displayName,
email: null,
image: profile.pictureUrl
}
},
...options
}
}
1 change: 1 addition & 0 deletions www/docs/configuration/providers.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ NextAuth.js is designed to work with any OAuth service, it supports OAuth 1.0, 1
* [GitLab](/providers/gitlab)
* [Google](/providers/google)
* [IdentityServer4](/providers/identity-server4)
* [LINE](/providers/line)
* [LinkedIn](/providers/linkedin)
* [Mail.ru](/providers/mailru)
* [Mixer](/providers/mixer)
Expand Down
2 changes: 1 addition & 1 deletion www/docs/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ You can use also NextAuth.js with any database using a custom database adapter,

### What authentication services does NextAuth.js support?

NextAuth.js includes built-in support for signing in with Amazon Cognito, Apple, Atlassian, Auth0, Azure Active Directory B2C, Basecamp, Battle.net, Box, Bungie, Discord, Facebook, Foursquare, FusionAuth, GitHub, GitLab, Google, IdentityServer4, LinkedIn, Mail.ru, Mixer, Netlify, Okta, Slack, Spotify, Strava, Twitch, Twitter, VK and Yandex. (See also: [Providers](/configuration/providers))
NextAuth.js includes built-in support for signing in with Amazon Cognito, Apple, Atlassian, Auth0, Azure Active Directory B2C, Basecamp, Battle.net, Box, Bungie, Discord, Facebook, Foursquare, FusionAuth, GitHub, GitLab, Google, IdentityServer4, LINE, LinkedIn, Mail.ru, Mixer, Netlify, Okta, Slack, Spotify, Strava, Twitch, Twitter, VK and Yandex. (See also: [Providers](/configuration/providers))

NextAuth.js also supports email for passwordless sign in, which is useful for account recovery or for people who are not able to use an account with the configured OAuth services (e.g. due to service outage, account suspension or otherwise becoming locked out of an account).

Expand Down
35 changes: 35 additions & 0 deletions www/docs/providers/line.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
id: line
title: LINE
---

## Documentation

https://developers.line.biz/en/docs/line-login/integrate-line-login/

## Configuration

https://developers.line.biz/console/

## Example

```js
import Providers from `next-auth/providers`
...
providers: [
Providers.LINE({
clientId: process.env.LINE_CLIENT_ID,
clientSecret: process.env.LINE_CLIENT_SECRET
})
]
...
```

## Instructions

### Configuration

Create a provider and a LINE login channel at `https://developers.line.biz/console/`. In the settings of the channel under LINE Login, activate web app and configure the following:

- Callback URL
- http://localhost:3000/api/auth/callback/line
1 change: 1 addition & 0 deletions www/sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ module.exports = {
'providers/gitlab',
'providers/google',
'providers/identity-server4',
'providers/line',
'providers/linkedin',
'providers/mailru',
'providers/mixer',
Expand Down

0 comments on commit ea1d09b

Please sign in to comment.