storyteller:naver-oauth

v1.0.0•Published 2 months ago

naver-oauth

An implementation of the NAVER OAuth flow. See the Meteor Guide for more details.

How to register the NAVER application, copy Client ID / Client Secret, and write settings.json is in the storyteller:naver-config-ui README.

Configuration

Put the keys from NAVER Developers 개요 in Meteor settings. service-configuration loads this block at startup:

1{
2  "packages": {
3    "service-configuration": {
4      "naver": {
5        "loginStyle": "popup",
6        "clientId": "YOUR_NAVER_CLIENT_ID",
7        "secret": "YOUR_NAVER_CLIENT_SECRET"
8      }
9    }
10  }
11}

Keep secret out of public. Register the callback <ROOT_URL>/_oauth/naver exactly in the NAVER console, including the port for local testing.

If you are not using settings, upsert the same fields on the server:

1ServiceConfiguration.configurations.upsert(
2  { service: 'naver' },
3  {
4    $set: {
5      loginStyle: 'popup',
6      clientId: 'YOUR_NAVER_CLIENT_ID',
7      secret: 'YOUR_NAVER_CLIENT_SECRET',
8    },
9  },
10)

loginStyle

popup or redirect. popup is recommended.

clientId

Client ID from NAVER Developers → 내 애플리케이션 → 개요.

secret

Client Secret from the same 개요 tab.

Calling login

Use Meteor.loginWithNaver from storyteller:accounts-naver:

1Meteor.loginWithNaver({ loginStyle: 'popup' }, (error) => {
2  if (error) {
3    /* handle error */
4  }
5})

Integrations

This package is part of bozhao:link-accounts, which links multiple login services on one account.