diff --git a/src/providers/index.js b/src/providers/index.js index 2076bbe833..cfba2313fd 100644 --- a/src/providers/index.js +++ b/src/providers/index.js @@ -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' @@ -50,6 +51,7 @@ export default { GitLab, Google, IdentityServer4, + LINE, LinkedIn, MailRu, Mixer, diff --git a/src/providers/line.js b/src/providers/line.js new file mode 100644 index 0000000000..31da925cd3 --- /dev/null +++ b/src/providers/line.js @@ -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 + } +} diff --git a/www/docs/configuration/providers.md b/www/docs/configuration/providers.md index fc912f0a42..a0568fada2 100644 --- a/www/docs/configuration/providers.md +++ b/www/docs/configuration/providers.md @@ -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) diff --git a/www/docs/faq.md b/www/docs/faq.md index af59083188..086d904e55 100644 --- a/www/docs/faq.md +++ b/www/docs/faq.md @@ -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). diff --git a/www/docs/providers/line.md b/www/docs/providers/line.md new file mode 100644 index 0000000000..b56f62a1a7 --- /dev/null +++ b/www/docs/providers/line.md @@ -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 \ No newline at end of file diff --git a/www/sidebars.js b/www/sidebars.js index a2f9abbb64..9a777d8c8a 100644 --- a/www/sidebars.js +++ b/www/sidebars.js @@ -43,6 +43,7 @@ module.exports = { 'providers/gitlab', 'providers/google', 'providers/identity-server4', + 'providers/line', 'providers/linkedin', 'providers/mailru', 'providers/mixer',