passport-kakao-oauth2

1.0.0 • Public • Published

Passport-kakao

Kakao oauth2 passport login module.

Install

npm install passport-kakao-oauth2

How to use

const passport = require('passport')
const KakaoStrategy = require('passport-kakao').Strategy

passport.use(new KakaoStrategy({
    clientID : clientID,
    clientSecret: clientSecret,
    callbackURL : callbackURL
  },
  (accessToken, refreshToken, profile, done) => {
    User.findOrCreate(..., (err, user) => {
      if (err) { return done(err) }
      return done(null, user)
    })
  }
))

Profile information

You can get the following properties from the user profile.

key value Note
provider String kakao
id Number User kakao ID
_raw String User JSON stringified profile information
_json Object User JSON profile information

Sample

  1. Set "appKey" of ./sample/sample.js to you app key.
  2. Run the app and go to 127.0.0.1:3000/login in your browser.
cd ./sample
npm install
node app

Package Sidebar

Install

npm i passport-kakao-oauth2

Weekly Downloads

0

Version

1.0.0

License

MIT

Unpacked Size

34.1 kB

Total Files

17

Last publish

Collaborators

  • hisaeri