- 필수 사항


1) Oracle Client 설치

- 설치시 시스템 변수 Path에 자동으로 경로가 들어간다

ex) D:\oracle\oracle_11.1.0.6.0\product\11.1.0\client_8\bin;


2) tnsnames.ora파일 생성


3) 환경변수 설정

시스템 변수 Path에 오라클 클라이언트 위치, tnsnames.ora의 위치 추가


오라클 클라이언트 위치는 자동으로 추가되기 때문에 tnsnames.ora의 위치만 추가하면 된다.

ex) D:\oracle\oracle_11.1.0.6.0\product\11.1.0\client_8\network\admin;


이렇게 하면 토드의 TNS 탭에 목록이 생긴다~~~

'실무 > 프로그래밍 | DB' 카테고리의 다른 글

[SNS] 페이스북 로그인 계정 연동  (1) 2016.12.20
SNS 가입 연동 가이드 - 네이버  (0) 2016.12.20

한 페이지 안에 페이스북 계정으로 로그인해서 정보 가져오기


Line19 : 페북에서 제공하는 버튼이 아닌 내가 원하는 이미지를 버튼으로 만들기 (custom button)

Line21 ~ Line27 : 계정연동 성공시 정보 뿌려주기


- 소스

<!DOCTYPE html>
<html>
<head>
<title>Facebook Login JavaScript Example</title>
<meta charset="UTF-8">
</head>
<body>
<!--
  Below we include the Login Button social plugin. This button uses
  the JavaScript SDK to present a graphical Login button that triggers
  the FB.login() function when clicked.
-->

<!-- <fb:login-button scope="public_profile,email" onlogin="checkLoginState();">
</fb:login-button> -->

<!-- <div id="response">
</div> -->
<button type="button" class="button facebook" id="loginBtn">페이스북 계정</button>

			<div id="access_token"></div>
			<div id="user_id"></div>
			<div id="name"></div>
			<div id="email"></div>
			<div id="gender"></div>
			<div id="birthday"></div>
			<div id="id"></div>
<script>
function getUserData() {
	/* FB.api('/me', function(response) {
		document.getElementById('response').innerHTML = 'Hello ' + response.name;
		console.log(response);
	}); */
	FB.api('/me', {fields: 'name,email,gender,birthday'}, function(response) {
	    console.log(JSON.stringify(response));
	    $("#name").text("이름 : "+response.name);
        $("#email").text("이메일 : "+response.email);
        $("#gender").text("성별 : "+response.gender);
        $("#birthday").text("생년월일 : "+response.birthday);
        $("#id").text("아이디 : "+response.id);
	});
}
 
window.fbAsyncInit = function() {
	//SDK loaded, initialize it
	FB.init({
		appId      : '나의 app id',
		cookie     : true,  // enable cookies to allow the server to access 
		        // the session
		xfbml      : true,  // parse social plugins on this page
		version    : 'v2.8' // use graph api version 2.8
	});
 
	//check user session and refresh it
	FB.getLoginStatus(function(response) {
		if (response.status === 'connected') {
			//user is authorized
			//document.getElementById('loginBtn').style.display = 'none';
			getUserData();
		} else {
			//user is not authorized
		}
	});
};
 
//load the JavaScript SDK
(function(d, s, id){
	var js, fjs = d.getElementsByTagName(s)[0];
	if (d.getElementById(id)) {return;}
	js = d.createElement(s); js.id = id;
	js.src = "//connect.facebook.com/ko_KR/sdk.js";
	fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
 
//add event listener to login button
document.getElementById('loginBtn').addEventListener('click', function() {
	//do the login
	FB.login(function(response) {
		if (response.authResponse) {
			access_token = response.authResponse.accessToken; //get access token
            user_id = response.authResponse.userID; //get FB UID
            console.log('access_token = '+access_token);
            console.log('user_id = '+user_id);
            $("#access_token").text("접근 토큰 : "+access_token);
            $("#user_id").text("FB UID : "+user_id);
			//user just authorized your app
			//document.getElementById('loginBtn').style.display = 'none';
			getUserData();
		}
	}, {scope: 'email,public_profile,user_birthday', 
		return_scopes: true});
}, false);
</script>

</body>
</html>







- 실행 결과




버튼은 임의로 넣음  -  페북 로그인 계정 연동 버튼임

생년월일은 월/일/년도로 뿌려짐







참고 사이트

1. 권한 참조 - Facebook 로그인

2. How to get birthday via Facebook API? - 생년월일 정보 가져오기

3. did not get public profile information and email by Facebook java script sdk [duplicate] - 프로필 정보 가져오기

4. Facebook API – Login with the JavaScript SDK - 강추!!

5. How to change facebook login button with my custom image - 커스텀 버튼

6. [자바스크립트] 페이스북 SDK/API 연동하기(SNS 로그인 등)

7. 페이스북 로그인 API 테스트

8. facebook oauth 로그인 연동

9. 위키백과 - OAuth

'실무 > 프로그래밍 | DB' 카테고리의 다른 글

[DB] 토드 - TNS 설정  (0) 2017.06.08
SNS 가입 연동 가이드 - 네이버  (0) 2016.12.20

네이버 아이디로 로그인 적용 가이드 ( https://developers.naver.com/products/login/userguide )


1. HOLLYGARDEN

네이버 디벨로퍼 페이지에서 예시 들어준 참고할 만한 사이트



네이버로 가입하기를 하면 이름만 입력하면 간편하게 회원가입을 할 수 있다.

(메일 주소는 네이버에서 값을 가져오기 때문에 입력 안해도 됨)

나머지 상세 정보를 마이페이지>회원정보수정을 통해 추가 입력 할 수 있다.






회원가입 버튼을 누르진 않았지만 개인정보 이용 동의 버튼을 눌렀을 경우 연결된다.







2. 미미박스



SNS계정(네이버)으로 간편 로그인 버튼을 눌렀을 경우

회원가입 화면으로 넘어간다. 일반 회원가입 페이지와 같음. 입력할게 많다!!!







1번 사이트와 마찬가지로 가입완료를 하지 않았어도 외부사이트로 연결 목록에 들어가 있다.



'실무 > 프로그래밍 | DB' 카테고리의 다른 글

[DB] 토드 - TNS 설정  (0) 2017.06.08
[SNS] 페이스북 로그인 계정 연동  (1) 2016.12.20