{"_id":"@1000ship/passport-kakao","name":"@1000ship/passport-kakao","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@1000ship/passport-kakao","version":"1.0.0","description":"kakao oauth2 login module - Modified by 1000ship","main":"./dist/passport-kakao","keywords":["passport","kakao","kakaotalk","oauth2"],"repository":{"type":"git","url":"git://github.com/1000ship/passport-kakao.git"},"author":{"name":"dev.1000ship@gmail.com"},"license":"MIT","dependencies":{"passport-oauth2":"^1.7.0"},"devDependencies":{"@types/chai":"^4.3.10","@types/mocha":"^10.0.4","@types/node":"^20.9.0","@types/passport-oauth2":"^1.4.15","@typescript-eslint/eslint-plugin":"^6.11.0","@typescript-eslint/parser":"^6.11.0","chai":"^4.3.10","eslint":"^8.53.0","mocha":"^10.2.0","prettier":"^3.1.0","rimraf":"^5.0.5","ts-node":"^10.9.1","tsc":"^2.0.4","tslint":"^5.20.1","tslint-config-prettier":"^1.18.0","typescript":"^5.2.2"},"scripts":{"test":"mocha -r node_modules/ts-node/register ./tests/**/*.spec.ts","clean":"rimraf dist/*","build":"yarn clean && yarn tsc","lint":"eslint -c .eslintrc.js src/**/*.ts","format":"prettier --write \"src/*.{ts,tsx,json,md}\""},"gitHead":"c0bcf826897edeb77774358e030f6caf5b28de5c","bugs":{"url":"https://github.com/1000ship/passport-kakao/issues"},"homepage":"https://github.com/1000ship/passport-kakao#readme","_id":"@1000ship/passport-kakao@1.0.0","_nodeVersion":"16.19.1","_npmVersion":"8.3.1","dist":{"integrity":"sha512-Dif7gHc6YuQVLmfgfPS7WE+Mjbex1GAT9UESVJGNvyJSS3Rlf3HSwAWlJDGUYZW0jwfZV5LlduV0ddg86HKOBg==","shasum":"a1fc6538fce133443d0c76b017ffc2ea9a44e280","tarball":"https://registry.npmjs.org/@1000ship/passport-kakao/-/passport-kakao-1.0.0.tgz","fileCount":6,"unpackedSize":8054,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCZRBA9xQOcU2J48fWUq3mc1ys3AuxAGbn6pQybpYWG3wIhAN/kZ6B8fEF970KZ1Ee74ljLLet3YR0tHdy/bg2iQ3hq"}]},"_npmUser":{"name":"dantechun","email":"dev.1000ship@gmail.com"},"directories":{},"maintainers":[{"name":"dantechun","email":"dev.1000ship@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/passport-kakao_1.0.0_1699903079494_0.2402696388005483"},"_hasShrinkwrap":false}},"time":{"created":"2023-11-13T19:17:59.381Z","1.0.0":"2023-11-13T19:17:59.789Z","modified":"2023-11-13T19:18:00.107Z"},"maintainers":[{"name":"dantechun","email":"dev.1000ship@gmail.com"}],"description":"kakao oauth2 login module - Modified by 1000ship","homepage":"https://github.com/1000ship/passport-kakao#readme","keywords":["passport","kakao","kakaotalk","oauth2"],"repository":{"type":"git","url":"git://github.com/1000ship/passport-kakao.git"},"author":{"name":"dev.1000ship@gmail.com"},"bugs":{"url":"https://github.com/1000ship/passport-kakao/issues"},"license":"MIT","readme":"# passport-kakao\n\nkakao oauth2 로그인과 passport 모듈 연결체.\n\n## install\n\n```sh\nnpm install passport-kakao\n```\n\n## how to use\n\n- https://developers.kakao.com/ 에서 애플리케이션을 등록한다.\n- 방금 추가한 애플리케이션의 제품 설정 - 카카오 로그인에 들어가서 활성화 설정을 ON으로 한 뒤 저장한다.\n- 설정 - 일반에서, 플랫폼 추가를 누른 후 웹 플랫폼을 추가한다.\n- 웹 플랫폼 설정의 사이트 도메인에 자신의 사이트 도메인을 추가한다. (ex : http://localhost:3000)\n- 프로그램 상에서는 아래와 같이 사용한다.\n\n> clientSecret을 활성화 한 경우 해당 파라메터를 같이 넘겨줘야한다.\n\n```javascript\nconst passport = require('passport')\nconst KakaoStrategy = require('passport-kakao').Strategy\n\npassport.use(new KakaoStrategy({\n    clientID : clientID,\n    clientSecret: clientSecret, // clientSecret을 사용하지 않는다면 넘기지 말거나 빈 스트링을 넘길 것\n    callbackURL : callbackURL\n  },\n  (accessToken, refreshToken, profile, done) => {\n    // 사용자의 정보는 profile에 들어있다.\n    User.findOrCreate(..., (err, user) => {\n      if (err) { return done(err) }\n      return done(null, user)\n    })\n  }\n))\n```\n\n> 기본 callbackPath는 `/oauth` 이고 https://developers.kakao.com 에서 수정할 수 있다. 하지만 callbackURL은 `사이트 도메인/oauth` 로 설정하는 것을 권장함. (ex : http://myhomepage.com:3000/oauth )\n\n##\n\n## profile property\n\nprofile에는 아래의 property들이 설정되어 넘겨진다.\n\n| key      | value  | 비고                                       |\n| -------- | ------ | ------------------------------------------ |\n| provider | String | kakao 고정                                 |\n| id       | Number | 사용자의 kakao id                          |\n| \\_raw    | String | 사용자 정보 조회로 얻어진 json string      |\n| \\_json   | Object | 사용자 정보 조회로 얻어진 json 원본 데이터 |\n\n## simple sample\n\n### 설치 & 실행\n\n1. `./sample/server/app.ts` 의 `appKey` 를 https://developers.kakao.com 에서 발급받은 JS appKey 값으로 셋팅.\n2. command line 에서 아래의 커맨드 실행\n3. 브라우져를 열고 `localhost:3000/login` 을 입력 후 이후 과정을 진행한다.\n\n```\ncd ./sample/server\nnpm install\nnpm start\n```\n\n## 기타\n\npassport-oauth 모듈과 passport-facebook 모듈을 참고함.\n","readmeFilename":"README.md"}