Prerequisites
- Register application at https://developers.naver.com/apps/#/register
- Select the "네아로 (네이버 아이디로 로그인)" API
- Store the "Client ID"
Installation
$ npm install naver-id-login
Usage
Initialization
Login
A new popup window opens where the user is promted to type in their username
and password
login(clientId: string, callbackUrl: string): Promise<Login>
Login response object
Login window close error object
Handling callback
In local route /callback/naver
(the chosen callbackUrl
during login()
)
handleTokenResponse(): void
naver.handleTokenResponse
Get Profile
getProfile(accessToken?: string): Promise<Profile>
If naver.login()
has successfully been called, the accessToken
is stored and the accessToken
can be omitted.
However, if you want to get profiles from different logged in users you can override the stored accessToken
.
Profile response object