2011-03-21 4 views
0

사용자를 인증하고 일정, 연락처 및 메일에 대한 액세스 권한을 얻기 위해 연합 로그인에 Tornado의 라이브러리를 사용하려고합니다. 그러나 "mydomain.dyndns.info가 Google 계정의 일부 정보를 요청하고 있습니다."라는 메시지가 표시되면 나열된 유일한 글 머리 기호는 "이메일 주소"입니다. 결과적으로 요청을 승인 한 후 반환 된 사용자 객체를 검사하면 사용자 객체에 'access_token'속성이 없습니다.Google Federated OAuth/OpenID with Tornado : 내 범위를 무시하는 이유는 무엇입니까?

def get(self): 
    scope_list = ['https://mail.google.com/','http://www.google.com/m8/feeds/','http://www.google.com/calendar/feeds/'] 
    ... 
    self.authorize_redirect(scope_list, callback_uri=self._switch_command('auth_callback'), ax_attrs=["name","email"]) 
def _on_auth(self, user): 
    print 'in on auth' 
    if user: 
     self.set_the_user(user['email']) 
     session.set_data('usertoken_' + user['email'], user['access_token']) 
    self.redirect('/') 

이 뱉어 있다는 URI는 다음과 같습니다 :

https://www.google.com/accounts/o8/ud 
?openid.ns=http%3A%2F%2Fspecs.openid.net%2Fauth%2F2.0 
&openid.claimed_id=http%3A%2F%2Fspecs.openid.net%2Fauth%2F2.0%2Fidentifier_select 
&openid.identity=http%3A%2F%2Fspecs.openid.net%2Fauth%2F2.0%2Fidentifier_select 
&openid.return_to=http%3A%2F%2Fmydomain.dyndns.info%3A333%2Fauth%2Fauth_callback%3Fperms%3Dgmail%26perms%3Dcontacts%26perms%3Dcalendar 
&openid.realm=http%3A%2F%2Fmydomain.dyndns.info%3A333%2F 
&openid.mode=checkid_setup 
&openid.ns.oauth=http%3A%2F%2Fspecs.openid.net%2Fextensions%2Foauth%2F1.0 
&openid.oauth.consumer=mydomain.dyndns.info 
&openid.oauth.scope=https%3A%2F%2Fmail.google.com%2F+http%3A%2F%2Fwww.google.com%2Fm8%2Ffeeds%2F+http%3A%2F%2Fwww.google.com%2Fcalendar%2Ffeeds%2F 
&openid.ns.ax=http%3A%2F%2Fopenid.net%2Fsrv%2Fax%2F1.0 
&openid.ax.type.fullname=http%3A%2F%2Faxschema.org%2FnamePerson 
&openid.ax.type.lastname=http%3A%2F%2Faxschema.org%2FnamePerson%2Flast 
&openid.ax.type.firstname=http%3A%2F%2Faxschema.org%2FnamePerson%2Ffirst 
&openid.ax.mode=fetch_request 
&openid.ax.type.email=http%3A%2F%2Faxschema.org%2Fcontact%2Femail 
&openid.ax.required=firstname%2Cfullname%2Clastname%2Cemail 

아이디어 : 여기

코드의 1. 아마도 이것이 내가 로컬에서 실행 해요 사실 함께 할 수있는 뭔가가 dyndns 전달자 뒤에있는 기계? 2. 토네이도의 문서에 "인증을 위해 Google을 사용하거나 사용자를 대신하여 Google 자원에 액세스하는 데 응용 프로그램 등록이 필요하지 않습니다."-하지만 아마도 더 이상 사실이 아닙니다.

누군가가 생각을 갖고 있다면 정말 고맙겠습니다.

답변

0

알아 냈어. 애플리케이션 속성 google_consumer_key 및 google_consumer_secret를 설정해야합니다. https://www.google.com/accounts/ManageDomains

을 :

application = tornado.web.Application(urlhandlers, cookie_secret=cookie_secret, google_consumer_key=google_consumer_key, google_consumer_secret=google_consumer_secret) 

당신은 여기 가서 그들을 얻을