기본 콘텐츠로 건너뛰기

meteor 0.3.9 에서 사용자 인증을 써보자.

예전에 everyAuth 에 대한 글을 쓴적이 있는데
https://github.com/meteor/meteor/wiki/Getting-Started-with-Auth
meteor wiki에 위와 같은 글이 있더라.
발빠르다 meteor. 투자받더니 탄력이 붙었는지 쭉쭉 잘나가는군.
일단 meteor 설치부터 다시하자.
이전에 Quick start 가이드대로

curl https://install.meteor.com | /bin/sh

이렇게 설치했지만.
이번엔 git 에서 auth Branch를 따서 갈 것이므로 수동 설치하자.

git clone git://github.com/meteor/meteor.git
cd meteor
수동설치래봤자 적절한 곳에 clone 하고
인스톨 하는게 전부인데.

auth는 다른 branch에 있기 때문에 일단 clone 하고 해당 경로에 진입만한 상태에서
git branch -r 로 리모트 브랜치를 확인해보자

  origin/HEAD -> origin/master
  origin/auth
  origin/auth-email
  origin/auth-test-isolation
  origin/auth-twitter
  origin/avital
  origin/avital-remove
  origin/avital-watch
  origin/david-handlebars
  origin/dev-bundle-bump
  origin/devel
  origin/email
  origin/forms
  origin/jade
  origin/master
  origin/release-0.1
  origin/release-0.1-templates
  origin/spark
  origin/spiderable
  origin/test-isolation
  origin/version-bump
  origin/webgl
  origin/wrappedjs
  origin/{ref}squashed-auth

이렇게 주욱 나올텐데 우리가 필요한 건

  origin/auth

요놈이다.
git checkout -t origin/auth
(0.4.2 기준 git checkout -t origin/devel 로 변경)
해서 브랜치를 변경하고

$ git branch
* auth
  master

이렇게 확인해서 auth로 옮겨간 것을 확인하고 install.sh 를 실행해주자.
./install.sh
그 다음 내용을 확인해보면


$ meteor list
absolute-url            Generate absolute URLs pointing to the application
accounts                A user account system
accounts-facebook       Login service for Facebook accounts
accounts-google         Login service for Google accounts
accounts-passwords      Password support for accounts.
accounts-twitter        Login service for Twitter accounts
accounts-ui             Simple templates to add login widgets to an app.
accounts-weibo          Login service for Sina Weibo accounts
amplify                 Cross browser API for Persistant Storage, PubSub and Req
autopublish             Automatically publish all data in the database to every
backbone                A minimalist client-side MVC framework
bootstrap               UX/UI framework from Twitter
code-prettify           Syntax highlighting of code, from Google
coffeescript            Javascript dialect with fewer braces and semicolons
email                   Send email messages
force-ssl               Require this application always use transport layer encr
handlebars              Simple semantic templating language
htmljs                  Easy macros for generating DOM elements in Javascript
http                    Make HTTP calls to remote servers
insecure                Allow all database writes by default
jquery                  Manipulate the DOM using CSS selectors
jquery-history          pushState module from the jQuery project
jquery-layout           Easily create arbitrary multicolumn layouts
jquery-waypoints        Execute a function when the user scrolls past an element
less                    The dynamic stylesheet language.
localstorage-polyfill   Simulates the localStorage API on IE 6,7 using userData
madewith                Made With Meteor badge
sass                    Sassy CSS pre-processor.
showdown                Markdown-to-HTML processor
spiderable              Makes the application crawlable to web spiders.
stylus                  Expressive, dynamic, robust CSS.
underscore              Collection of small helper functions (map, each, bind, .

못보던 package들이 많이 생겼는데 accounts 라는 것들이 보인다. 심지어 weibo 도 있네;;

여기까지 왔으면 이제 사용하면 된다.


meteor create auth_example
cd auth_example
해서 만들고
meteor add accounts-google accounts-facebook accounts-twitter accounts-passwords accounts-ui
google, facebook, twitter, 일반인증까지 전부 넣자.

auth_example.html 을 열어서

<head>
  <title> auth_example </title>
</head>

<body>
  {{> loginButtons}}
  {{> hello}}
</body>

<template name="hello">
  <h1>Hello World!</h1>
  {{greeting}}
  <input type="button" value="Click" />
</template>


loginButtons 라는 template 을 추가해주자.
아마 브라우저에 Sign in 이라는 링크가 보일테고
Sign in with Facebook 같은 걸 누르면

Facebook API key not set. Configure app details with Meteor.accounts.facebook.config() and Meteor.accounts.facebook.setSecret()

이렇게 나올거다.
설정해주자.
https://developers.facebook.com/apps/<APP_ID>/summary?save=1 에서 만들어놓았던

App ID, App Secret, Website with Facebook Login 의 URL

이렇게 세가지를 가져와서
client/server 양쪽에 들어가는 공통 js 에
Meteor.accounts.facebook.config(APP_ID, APP_URL);

App ID, URL 을 각각 넣어주고
server 쪽 js 에
Meteor.accounts.facebook.setSecret(APP_SECRET);

App Secret 을 넣어준다. 당연히 Secret 은 노출되면 안되니까.

이번 업데이트로 필요없어졌다. app정보는 Collection 안에 들어간다. http://spectrumdig.blogspot.kr/2012/09/meteor-auth-branch-922.html
내용에 다시 정리하였다.

나머지 내용은
https://github.com/meteor/meteor/wiki/Getting-Started-with-Auth 를 참조하자.

(0.4.2 관련 최신 내용)
http://spectrumdig.blogspot.kr/2012/10/meteor-auth-branch-rc-release-candidated.html

댓글

  1. help me~~ same problem!
    =========================================================
    hoho@hoho-VirtualBox:~/meteor$ sudo ./install.sh
    Installing in /usr/local
    It's the first time you've run Meteor from a git checkout.
    I will download a kit containing all of Meteor's dependencies.

    curl: (35) error:14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure

    gzip: stdin: unexpected end of file
    tar: Child returned status 1
    tar: Error is not recoverable: exiting now
    Failed to install dependency kit.

    답글삭제
  2. Error when Installing Meteor in Ubuntu
    curl: (35) error:14077410:SSL routines:SSL23_GET_SERVER_HELLO:sslv3 alert handshake failure Installation failed.
    에러가 나서 찾아보니
    $ openssl s_client -connect install.meteor.com:443
    실행해서 뭔가 바꿔주라고 하는거 같은데
    저는 어떻게 하라는건지 잘 이해가 안가네요 ㅠㅠ

    http://pastebin.com/AdvXTuH5

    답글삭제
  3. 대장님 해결했습니다.
    git clone 이후
    cd meteor
    ./admin/gernerate-dev-bundle.sh
    를 한번 돌려주고
    ./install.sh 하니 되네요
    보니까 왠 ubuntu ntfs 파일시스템에서 생기는 문제 같더군요 ㅎㅎ
    http://frauzufall.de/2012/meteor-ubuntu-ntfs/

    답글삭제
    답글
    1. 12.04 에선 해야되나 보더라구요. 11버전 대에선 그냥 되었는데.

      삭제

댓글 쓰기

이 블로그의 인기 게시물

세상 간단한 https(+secured websocket): Caddy

nginx, apache2 같은 걸로 매번 certbot 연동을 통해 https 하는게 지겨워서 알아보니 Caddy라는게 있더라. 설치법은 강하게 크기 위해 알아서 해본다. # cat /etc/caddy/Caddyfile your.shitty.site:8123 {   proxy / localhost:9123 {     websocket     transparent   } } 이건 외부에서 8123으로 들어오는 걸 내부적으로 9123로 맞춰서 https 맞춰주는 reverse proxy. 만일 port를 생략하면 # cat /etc/caddy/Caddyfile your.shitty.site {   proxy / localhost:9123 {     websocket     transparent   } } 기본포트인 443으로 되어 https://your.shitty.site 로 접속이 된다. 요새 말썽이던 cloudflare 버리고 netlify domain이랑 caddy를 쓰니까 앓던 이가 빠진 느낌. 이 조합은 당분간 계속 써야겠다 싶다.

LG G Pro 2 Custom Rom +Rooting 기록

선 루팅 https://forum.xda-developers.com/lg-g3/general/guide-root-lg-firmwares-kitkat-lollipop-t3056951 1.2버전 스크립트 모드로. echo Looking for LG serial port.. echo. adb.exe wait-for-device 여기에서 정체 상태여서 강제로 adb kill-server 했더니 알아서 재부팅하심. 폰에선 "펌웨어 업데이트"화면이 나오고 Phone found at COM5! Rooting phone.. If you don't see the SuperSu installer script runs within about a minute, then the root failed. Author : blog.lvu.kr SPECIAL COMMAND : ENTER, LEAVE ## 이런 상황이 됨. #이 느린 속도로 하나씩 증가하고 있음. 한 시간 기다려도 성과없음. 뭐 몇번해봐도 안되고 결국 불안하긴 하지만 kingroot.net  로 설치 롤리팝이니까  https://drive.google.com/file/d/0B4kfGU1z_PClQ3AyM2lKOGR1S3M/view  이걸 받아서 압축 풀기. d838recovery.bat 만 있어서 당황스럽긴한데 실행하고 1번 하니까 리커버리 모드 진입까진 잘 되는 듯. adb sideload 라는게 있어서 해봄. Advance에서 adb sideload 선택하고 USB연결한 PC에서 adb sideload RR-N-v5.8.5-20171010-d838-Final.zip 하니까 착착 잘 진행됨. 이제 흉측한 U+LTE 가 없어짐. ㅇㅋ 군더더기 없고 깔끔한데 남은 건 gapps 를 설치해야함. http://opengapps.org/  를 권해줘서 갔는데 지옥 느림. ARM + 7.1 + stock 이 기본이...