{"_id":"passport-naver","_rev":"18-cc9e27621dc463759bbc5bc3f9e375c3","name":"passport-naver","description":"Naver authentication strategy for Passport","dist-tags":{"latest":"1.0.6"},"versions":{"1.0.0":{"name":"passport-naver","version":"1.0.0","description":"Naver authentication strategy for Passport","keywords":["passport","naver","auth","oauth","authentication","oauth2"],"repository":{"type":"git","url":"git://github.com/terzeron/passport-naver.git"},"bugs":{"url":"https://github.com/terzeron/passport-naver/issues"},"author":{"name":"Young-il Cho","email":"youngil.cho@navercorp.com","url":"http://github.com/terzeron"},"contributors":[{"name":"Chanhee Kim","email":"chanhee.kim@navercorp.com"}],"licenses":[{"type":"MIT","url":"http://www.opensource.org/licenses/MIT"}],"main":"./lib","dependencies":{"passport-oauth":"~0.1.4","xml2json":"~0.4.0"},"homepage":"https://github.com/terzeron/passport-naver","gitHead":"1418374c0253d40287b1a5ce77298d32a144ef67","_id":"passport-naver@1.0.0","scripts":{},"_shasum":"e4687ddf660e1fbd7d8efe9090674c0bb03a2a3b","_from":".","_npmVersion":"1.4.16","_npmUser":{"name":"terzeron","email":"youngil.cho@navercorp.com"},"maintainers":[{"name":"terzeron","email":"youngil.cho@navercorp.com"}],"dist":{"shasum":"e4687ddf660e1fbd7d8efe9090674c0bb03a2a3b","tarball":"https://registry.npmjs.org/passport-naver/-/passport-naver-1.0.0.tgz","integrity":"sha512-E3w3ApatWLueOhS6R7VmtKRDGMdA1TDaEcJnCsnzJ6SCJaDfWMAq7bjdncGh4WDpylMr+cat4/4K546H9KHH9A==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD/73xn2EGsTp4UdHz1E1NPx+czk/An+0x2Tb/GlQ8ahQIhAPmuoiJPwbHe0T38oTL8kxDV+2gN6EeCSmYYolanEscW"}]}},"1.0.1":{"name":"passport-naver","version":"1.0.1","description":"Naver authentication strategy for Passport","keywords":["passport","naver","auth","oauth","authentication","oauth2"],"repository":{"type":"git","url":"git://github.com/terzeron/passport-naver.git"},"bugs":{"url":"https://github.com/terzeron/passport-naver/issues"},"author":{"name":"Young-il Cho","email":"youngil.cho@navercorp.com","url":"http://github.com/terzeron"},"contributors":[{"name":"Chanhee Kim","email":"chanhee.kim@navercorp.com"}],"licenses":[{"type":"MIT","url":"http://www.opensource.org/licenses/MIT"}],"main":"./lib","dependencies":{"passport-oauth":"~0.1.4","xml2js":"^0.4.4"},"homepage":"https://github.com/terzeron/passport-naver","gitHead":"902acf55baf864be853b2980266e5b3c143c598d","_id":"passport-naver@1.0.1","scripts":{},"_shasum":"d1488451316c6617ec320099cd626efb6fa15e99","_from":".","_npmVersion":"1.4.16","_npmUser":{"name":"terzeron","email":"youngil.cho@navercorp.com"},"maintainers":[{"name":"terzeron","email":"youngil.cho@navercorp.com"}],"dist":{"shasum":"d1488451316c6617ec320099cd626efb6fa15e99","tarball":"https://registry.npmjs.org/passport-naver/-/passport-naver-1.0.1.tgz","integrity":"sha512-xYLErcwPAgP0LLZuEl5qzlkt2aNlxqDzom9E9Sfm3+81DrXJepk9K9a3dPqkDUB8mTMIBIKTmWxsPU+zfT7ESw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCpPTBfTVJXSneG593D1VmYV3KljoSLD4/4t6IckrLhKgIgCeXzdM3rG4j1Irx1raStOx+wsXiwVnjjQ6mMCu0sbPw="}]}},"1.0.2":{"name":"passport-naver","version":"1.0.2","description":"Naver authentication strategy for Passport","keywords":["passport","naver","auth","oauth","authentication","oauth2"],"repository":{"type":"git","url":"git://github.com/naver/passport-naver.git"},"bugs":{"url":"https://github.com/naver/passport-naver/issues"},"author":{"name":"Young-il Cho","email":"youngil.cho@navercorp.com","url":"http://github.com/terzeron"},"contributors":[{"name":"Chanhee Kim","email":"chanhee.kim@navercorp.com"}],"licenses":[{"type":"MIT","url":"http://www.opensource.org/licenses/MIT"}],"main":"./lib","dependencies":{"passport-oauth":"~0.1.4","xml2js":"^0.4.4"},"homepage":"https://github.com/naver/passport-naver","gitHead":"a92947eb8e810c4b7577a0eb07d97c54b6144cb2","_id":"passport-naver@1.0.2","scripts":{},"_shasum":"e2aa9c79487384a8815e0a44541ab9245b494c1c","_from":".","_npmVersion":"1.4.23","_npmUser":{"name":"terzeron","email":"youngil.cho@navercorp.com"},"maintainers":[{"name":"terzeron","email":"youngil.cho@navercorp.com"}],"dist":{"shasum":"e2aa9c79487384a8815e0a44541ab9245b494c1c","tarball":"https://registry.npmjs.org/passport-naver/-/passport-naver-1.0.2.tgz","integrity":"sha512-5JS545x5qGr6RMflFUuJCQg6sDXXGrhZxZ4n2cPUGMnBPRmy6ktdMmlZu4Qkjs8tZ4orVjyeXGTehkGxIdzqGA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHo5clASAFtg4yRHW4Uhvndse+BwXrUwu/lUEk8kQhyXAiBPnLhmhIWwpoDKyX8ai7HHEEVZq/pnNcQpr6+EVSB+EA=="}]}},"1.0.3":{"name":"passport-naver","version":"1.0.3","description":"Naver authentication strategy for Passport","keywords":["passport","naver","auth","oauth","authentication","oauth2"],"repository":{"type":"git","url":"git://github.com/naver/passport-naver.git"},"bugs":{"url":"https://github.com/naver/passport-naver/issues"},"author":{"name":"Young-il Cho","email":"youngil.cho@navercorp.com","url":"http://github.com/terzeron"},"contributors":[{"name":"Chanhee Kim","email":"chanhee.kim@navercorp.com"},{"name":"Seunglak Choi","email":"seunglak@gmail.com"}],"licenses":[{"type":"MIT","url":"http://www.opensource.org/licenses/MIT"}],"main":"./lib","dependencies":{"passport-oauth":"~0.1.4","xml2js":"^0.4.4"},"homepage":"https://github.com/naver/passport-naver","_id":"passport-naver@1.0.3","_shasum":"20434425885857bcf4fb11fc25ad44565a411396","_from":".","_npmVersion":"1.4.9","_npmUser":{"name":"seunglak","email":"seunglak@gmail.com"},"maintainers":[{"name":"terzeron","email":"youngil.cho@navercorp.com"},{"name":"seunglak","email":"seunglak@gmail.com"}],"dist":{"shasum":"20434425885857bcf4fb11fc25ad44565a411396","tarball":"https://registry.npmjs.org/passport-naver/-/passport-naver-1.0.3.tgz","integrity":"sha512-qdAA877xrq8iQXCxRwCWX1tAevKGOdUWIj5q5f4a92xFN7W0Wen+4M6vdnpb8SuI/sX9TqeidBA8GKo1ADiLDg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC+bERbwIU7h+1AiDn4dXRAdud2sMMBc1wf8R5chxQ6cwIhAKzfQ3T51SNCiOcuhE3xtLBU/mQh78YJpr764VaYCMXE"}]}},"1.0.4":{"name":"passport-naver","version":"1.0.4","description":"Naver authentication strategy for Passport","keywords":["passport","naver","auth","oauth","authentication","oauth2"],"repository":{"type":"git","url":"git://github.com/naver/passport-naver.git"},"bugs":{"url":"https://github.com/naver/passport-naver/issues"},"author":{"name":"Young-il Cho","email":"youngil.cho@navercorp.com","url":"http://github.com/terzeron"},"contributors":[{"name":"Chanhee Kim","email":"chanhee.kim@navercorp.com"},{"name":"Seunglak Choi","email":"seunglak@gmail.com"}],"licenses":[{"type":"MIT","url":"http://www.opensource.org/licenses/MIT"}],"main":"./lib","dependencies":{"passport-oauth":"~0.1.4","xml2js":"^0.4.4"},"homepage":"https://github.com/naver/passport-naver","gitHead":"205e337cb344b8f13665cca4351b95aec42e29cb","_id":"passport-naver@1.0.4","scripts":{},"_shasum":"b4874ea75c4bc04e990d6752d61d98526caae4bb","_from":".","_npmVersion":"1.4.14","_npmUser":{"name":"seunglak","email":"seunglak@gmail.com"},"maintainers":[{"name":"terzeron","email":"youngil.cho@navercorp.com"},{"name":"seunglak","email":"seunglak@gmail.com"}],"dist":{"shasum":"b4874ea75c4bc04e990d6752d61d98526caae4bb","tarball":"https://registry.npmjs.org/passport-naver/-/passport-naver-1.0.4.tgz","integrity":"sha512-+O/G0kKOeEn8mNc7aGCdKNJ66THBeP4RJVNkm1tT8r3OcjXWDqiCBy4QH17wQutDyJLJUelF6fhjEpOra7429Q==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCID2tp6E79wUni6MOKVch9blawANSTb4ifB3k7AZ/adXUAiALmsN3OpH6WWvhrL3cb2VMIymslxhNR4Y3g9iZ6IolWw=="}]}},"1.0.6":{"name":"passport-naver","version":"1.0.6","description":"Naver authentication strategy for Passport","keywords":["passport","naver","auth","oauth","authentication","oauth2"],"repository":{"type":"git","url":"git://github.com/naver/passport-naver.git"},"bugs":{"url":"https://github.com/naver/passport-naver/issues"},"author":{"name":"Young-il Cho","email":"youngil.cho@navercorp.com","url":"http://github.com/terzeron"},"contributors":[{"name":"Chanhee Kim","email":"chanhee.kim@navercorp.com"},{"name":"Seunglak Choi","email":"seunglak@gmail.com"},{"name":"MooYeol Lee","email":"mooyoul@gmail.com","url":"https://github.com/mooyoul"}],"licenses":[{"type":"MIT","url":"http://www.opensource.org/licenses/MIT"}],"main":"./lib","dependencies":{"passport-oauth":"^1.0.0","underscore":"^1.8.3"},"homepage":"https://github.com/naver/passport-naver","gitHead":"601b805c77a0cda5e8a4cbf7df2b91fc515fbb59","_id":"passport-naver@1.0.6","_npmVersion":"5.0.3","_nodeVersion":"8.1.3","_npmUser":{"name":"vanity95","email":"chanhee.kim@navercorp.com"},"dist":{"integrity":"sha512-5XEbJesiPVshwE0cTDvbbJrOiYSJ9VFRJTctqiZL1Xip6qOi9n7d49UesOqavLT+Ry8C7aw3zdzbmWosqHcQ/Q==","shasum":"a3602c4a3af53306ab2ff9e91d4a35a3c028da9a","tarball":"https://registry.npmjs.org/passport-naver/-/passport-naver-1.0.6.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDITIYr1o8NczswyrElIxiU8HRowGNRNkR3HwbI/6FU8AiA0j7uAzAbfpuY/cLIOTlzVnGcnW57V4sMVjArQTxY5nw=="}]},"maintainers":[{"name":"seunglak","email":"seunglak@gmail.com"},{"name":"terzeron","email":"youngil.cho@navercorp.com"},{"name":"vanity95","email":"chanhee.kim@navercorp.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/passport-naver-1.0.6.tgz_1503447646519_0.4708008465822786"}}},"readme":"# Passport-Naver\n\n[Passport](http://passportjs.org/) strategies for authenticating with [Naver](http://www.naver.com/)\nusing OAuth 2.0.\n\nThis module lets you authenticate using Naver in your Node.js applications.\nBy plugging into Passport, Naver authentication can be easily and\nunobtrusively integrated into any application or framework that supports\n[Connect](http://www.senchalabs.org/connect/)-style middleware, including\n[Express](http://expressjs.com/).\n\n## Install\n\n    $ npm install passport-naver\n\n## Usage of OAuth 2.0\n\n#### Configure Strategy\n\nThe Naver OAuth 2.0 authentication strategy authenticates users using a Naver\naccount and OAuth 2.0 tokens.  The strategy requires a `verify` callback, which\naccepts these credentials and calls `done` providing a user, as well as\n`options` specifying a client ID, client secret, and callback URL.\n\n    var NaverStrategy = require('passport-naver').Strategy;\n\n    passport.use(new NaverStrategy({\n            clientID: config.naver.clientID,\n            clientSecret: config.naver.clientSecret,\n            callbackURL: config.naver.callbackURL\n\t\t},\n        function(accessToken, refreshToken, profile, done) {\n            User.findOne({\n                'naver.id': profile.id\n            }, function(err, user) {\n                if (!user) {\n                    user = new User({\n                        name: profile.displayName,\n                        email: profile.emails[0].value,\n                        username: profile.displayName,\n                        provider: 'naver',\n                        naver: profile._json\n                    });\n                    user.save(function(err) {\n                        if (err) console.log(err);\n                        return done(err, user);\n                    });\n                } else {\n                    return done(err, user);\n                }\n            });\n        }\n    ));\n\n\n#### Authenticate Requests\n\nUse `passport.authenticate()`, specifying the `'naver'` strategy, to\nauthenticate requests.\n\nFor example, as route middleware in an [Express](http://expressjs.com/)\napplication:\n\n    // Setting the naver oauth routes\n    app.route('/auth/naver')\n        .get(passport.authenticate('naver', {\n            failureRedirect: '#!/auth/login'\n        }), users.signin);\n\n    // creates an account if no account of the new user\n    app.route('/auth/naver/callback')\n        .get(passport.authenticate('naver', {\n            failureRedirect: '#!/auth/login'\n        }), users.createAccount, users.authCallback);\n\n\n#### Re-authentication\n\nRe-authentication is the act of asking a user to re-enter their Naver password whenever they sign in your service. This is useful to prevent man-in-the-middle hijacking while the user session of Naver is alive.\n\nHere is an example that triggers re-authentication using an authType:\n\n    passport.use(new NaverStrategy({\n            clientID: config.naver.clientID,\n            clientSecret: config.naver.clientSecret,\n            callbackURL: config.naver.callbackURL,\n            svcType: 0,\n            authType: 'reauthenticate'  // enable re-authentication\n        },\n\n\n## App Registration for the Secret Generation\n\nYou need to register your application from Naver Developer Center.\n<[Naver Developer Center](https://developer.naver.com/openapi/register/login.nhn)>\n\nYou can get client id & secret for your application after the approval process of Naver Corp.\n\nAfter the client id & secret are issued, assign them to the following variables.\n  \n            clientID: config.naver.clientID,\n            clientSecret: config.naver.clientSecret,\n            callbackURL: config.naver.callbackURL,\n\n\n## Examples\n\nYou can execute the following application from the 'examples' directory.\n\t\n\t$ npm install \n\t$ node app.js\n\n\tvar express = require('express')\n\t\t, passport = require('passport')\n\t\t, session = require('express-session')\n\t\t, NaverStrategy = require('../lib/index.js').Strategy;\n\t\t\n\tvar client_id = '************ your app client id ************';\n\tvar client_secret = '************ your app client secret ************';\n\tvar callback_url = '************ your app callback url ************';\n\t\n\tpassport.serializeUser(function(user, done) {\n\t\tdone(null, user);\n\t});\n\t\n\tpassport.deserializeUser(function(obj, done) {\n\t\tdone(null, obj);\n\t});\n\t\n\tpassport.use(new NaverStrategy({\n\t    clientID: client_id,\n\t    clientSecret: client_secret,\n\t    callbackURL: callback_url,\n        svcType: 0  // optional. see http://gamedev.naver.com/index.php/%EC%98%A8%EB%9D%BC%EC%9D%B8%EA%B2%8C%EC%9E%84:OAuth_2.0_API\n\t}, function(accessToken, refreshToken, profile, done) {\n\t\tprocess.nextTick(function () {\n\t\t\t//console.log(\"profile=\");\n\t\t\t//console.log(profile);\n\t\t\t// data to be saved in DB\n\t\t\tuser = {\n\t\t\t\tname: profile.displayName,\n\t\t\t\temail: profile.emails[0].value,\n\t\t\t\tusername: profile.displayName,\n\t\t\t\tprovider: 'naver',\n\t\t\t\tnaver: profile._json\n\t\t\t};\n\t\t\t//console.log(\"user=\");\n\t\t\t//console.log(user);\n\t\t\treturn done(null, profile);\n\t\t});\n\t}));\n\t\n\tvar app = express();\n\t\n\tapp.use(session({secret: 'keyboard cat'}));\n\tapp.use(passport.initialize());\n\tapp.use(passport.session());\n\t\n\tapp.set('view engine', 'jade');\n\tapp.set('views', __dirname + '/views/');\n\t\n\tapp.get('/', function(req, res){\n\t\tres.render('index', { user: req.user });\n\t});\n\t\n\tapp.get('/account', ensureAuthenticated, function(req, res) {\n\t\tconsole.log(req.user);\n\t\tres.render('account', { user: req.user });\n\t});\n\t\n\tapp.get('/login', function(req, res){\n\t\tres.render('login', { user: req.user });\n\t});\n\t\n\t// Setting the naver oauth routes\n\tapp.get('/auth/naver', \n\t\tpassport.authenticate('naver', null), function(req, res) {\n\t    \tconsole.log('/auth/naver failed, stopped');\n\t    });\n\t\n\t// creates an account if no account of the new user\n\tapp.get('/auth/naver/callback', \n\t\tpassport.authenticate('naver', {\n\t        failureRedirect: '#!/auth/login'\n\t    }), function(req, res) {\n\t    \tres.redirect('/'); \n\t    });\n\t\n\tapp.get('/logout', function(req, res){\n\t\treq.logout();\n\t\tres.redirect('/');\n\t});\n\t\n\tapp.listen(3000);\n\t\n\tfunction ensureAuthenticated(req, res, next) {\n\t\tif (req.isAuthenticated()) { return next(); }\n\t\tres.redirect('/login');\n\t}\n\n\n## Thanks to \n\n  - [Jared Hanson](http://github.com/jaredhanson)\n  - Chanhee Kim(chanhee.kim@navercorp.com)\n\n## Author\n\n  - [Young-il Cho](http://github.com/terzeron)\n  - [Seunglak Choi](http://github.com/seunglak)\n  - [MooYeol Lee](https://github.com/mooyoul) at [Law&Company](http://lawcompany.co.kr)\n  \n## License\n\n[The MIT License](http://opensource.org/licenses/MIT)\n\nCopyright (c) 2014 Naver Corp.\n","maintainers":[{"name":"seunglak","email":"seunglak@gmail.com"},{"name":"terzeron","email":"youngil.cho@navercorp.com"},{"name":"vanity95","email":"chanhee.kim@navercorp.com"}],"time":{"modified":"2022-06-23T13:05:33.928Z","created":"2014-07-18T07:30:04.848Z","1.0.0":"2014-07-18T07:30:04.848Z","1.0.1":"2014-07-18T07:32:24.488Z","1.0.2":"2014-08-07T02:44:52.638Z","1.0.3":"2014-11-17T03:31:15.229Z","1.0.4":"2015-03-01T15:57:19.822Z","1.0.6":"2017-08-23T00:20:47.406Z"},"homepage":"https://github.com/naver/passport-naver","keywords":["passport","naver","auth","oauth","authentication","oauth2"],"repository":{"type":"git","url":"git://github.com/naver/passport-naver.git"},"contributors":[{"name":"Chanhee Kim","email":"chanhee.kim@navercorp.com"},{"name":"Seunglak Choi","email":"seunglak@gmail.com"},{"name":"MooYeol Lee","email":"mooyoul@gmail.com","url":"https://github.com/mooyoul"}],"author":{"name":"Young-il Cho","email":"youngil.cho@navercorp.com","url":"http://github.com/terzeron"},"bugs":{"url":"https://github.com/naver/passport-naver/issues"},"readmeFilename":"README.md","users":{"helloyako":true,"gagagiga":true}}