Parse-server를 기반으로 응용 프로그램을 개발 중이며 소셜 로그를 제공하고 싶습니다. 이 안내서는 설명서 http://docs.parseplatform.org/js/guide/#linking-users에 있습니다.Parse-server social login
Google에서 소셜 로그인을 구현하기 시작했습니다. 나는 단계를 수행 않았다
1) 내가 (로그인에 user._linkWith 기능을 클라이언트 측에서 hello.js에 의해 인증을 호출 않았다
var api = new ParseServer({
...
auth:{
google: {}
},
...
});
2) ParseServer 설정 선)
다음 추가 그것을 디버깅시hello.init({
google: 'My Google id'
});
hello.on('auth.login', function(auth) {
// Call user information, for the given network
hello(auth.network).api('me').then(function(r) {
const user = new Parse.User();
user._linkWith(auth.network, auth.authResponse).then(function(user){
console.log('You are logged in successfully.');
});
});
});
는 I 제공자 객체 준비 때 _linkWith() 함수에 실패하였습니다. 모든 공급자를 저장해야하는 개체 AuthProviders는 비어 있습니다. 그것 때문에 문 공급자 = authProviders [ '구글'];은 정의되지 않은 상태가됩니다. 호출하기 provider.authenticate (...);은 "정의되지 않은 속성 '인증을 읽을 수 없습니다."
무엇이 잘못되었거나 잘못 되었나요?
답장을 보내 주셔서 감사합니다.
Honza는
이 옵션은 "ID"와 함께 "authData"필드를 가질 수 (구문 분석 JS 가이드의 예와는 달리) 보인다 자격 증명을 내부 중첩 :
이
내가 사용하고 코드의 조각이다 그것. 그렇지 않은 경우이 대답이 적용됩니다. 나는 번들 된 FacebookUtils에서 Facebook을위한 예제를 발견했다. https://github.com/parse-community/Parse-SDK-JS/blob/master/src/FacebookUtils.js를 참조한다. 다른 써드 파티 인증 공급자? Parse Server JavaScript 가이드는 authenticationProvider 등록을 완전히 언급하지 못합니다. –