미디어위키 GoogleLogin 확장기능 설치

미디어위키 GoogleLogin 확장기능 설치

1 사전 작업[ | ]

2 로그인 URL 확인[ | ]

  • 자신의 미디어위키에서 Special:Login으로 이동하여 URL 확인
예: http://zetawiki.com/wiki/%ED%8A%B9%EC%88%98:%EB%A1%9C%EA%B7%B8%EC%9D%B8[1]

3 구글 OAuth 클라이언트 ID 발급[ | ]

  • https://console.developers.google.com/ 접속
  • 사이드바의 "APIs & auth" 아래 APIs 클릭
  • "Social APIs" 아래 Google+ API 클릭
  • [Enable API] 클릭
  • 사이드바의 "APIs & auth" 아래 Credentials 클릭
  • Add credetails 클릭 --- OAuth 2.0 client ID 선택
  • "Create client ID" --- Application type: (O) Web application --- Authorized JavaScript origins: http://도메인 --- Authorized redirect URIs: 로그인유알엘[2] --- [Create]

팝업 창에 OAuth client 정보가 나옴

OAuth client
Here is your client ID
433689212898-71q726xatrq2miz64wgfcsb542tthiq8.apps.googleusercontent.com
Here is your client secret
AkMcqGpUHs8xAV7TNvRzX7s_

4 설치본 URL 확인[ | ]

예: https://extdist.wmflabs.org/dist/extensions/GoogleLogin-REL1_25-675dcd6.tar.gz

5 wget으로 다운로드[ | ]

[root@zetawiki ~]# wget https://extdist.wmflabs.org/dist/extensions/GoogleLogin-REL1_25-675dcd6.tar.gz
... (생략)
Saving to: “GoogleLogin-REL1_25-675dcd6.tar.gz”

100%[======================>] 331,736     71.5K/s   in 4.5s    

2015-09-02 23:38:24 (71.5 KB/s) - “GoogleLogin-REL1_25-675dcd6.tar.gz” saved [331736/331736]

6 압축 해제[ | ]

[root@zetawiki ~]# tar -xzf GoogleLogin-REL1_25-675dcd6.tar.gz -C /var/www/html/w/extensions
[root@zetawiki ~]# ll /var/www/html/w/extensions | grep GoogleLogin
drwxr-xr-x  9  998  998   4096 Jul 19 04:05 GoogleLogin

7 LocalSettings.php 수정[ | ]

require_once 'Google/autoload.php';
require_once "$IP/extensions/GoogleLogin/GoogleLogin.php";
$wgGLAppId = '클라이언트아이디';
$wgGLSecret = '클라이언트시크릿';

8 update 스크립트 수행[ | ]

[root@zetawiki ~]# cd /var/www/html/w/maintenance/
[root@zetawiki maintenance]# php update.php
MediaWiki 1.25.2 Updater

Your composer.lock file is up to date with current dependencies!
... (생략)
Set the local repo temp zone container to be private.
Purging caches...done.

Done in 0:02.
  • 추가로 필요한 mw_user_google_user[3] 테이블이 생성되었다.

9 테스트[ | ]

  • 자신의 미디어위키에서 로그아웃 후 특수:로그인으로 이동
  • (구글 로그인 안되어 있다면) 구글 로그인
  • 앱이 사용하는 권한 확인
  • 사용할 이름을 목록에서 선택 또는 입력
축하합니다! 당신은 위키 계정 Jmnote2을 생성하였고 구글 계정과 연동하였습니다.

10 같이 보기[ | ]

11 참고[ | ]

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}