-
-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(provider): add LINE provider (#1091)
- Loading branch information
1 parent
a18ec09
commit ea1d09b
Showing
6 changed files
with
62 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters