2009-10-09 5 views
8

Google 페더레이션 로그인을 프리미어 앱 계정과 통합하려고하는데 문제가 있습니다.호스트 앱용 Google 연동 로그인 (OpenID + Oauth) - 종점 변경

모든 매개 변수 (아래 참조)를 사용하여 https://www.google.com/accounts/o8/ud에 요청을 보내면 request_token과 요청한 속성 목록이 모두 Attribute Exchange이됩니다. 이것은 응용 프로그램 데이터베이스에 사용자를 저장하기 위해 속성 exhange (AX)를 통해 전자 메일이 필요하므로 나중에 API requests to scopes (예 : 달력, 연락처 등)에 대한 요청 토큰이 필요하므로 완벽합니다.

그러나, (여기 endpoint이라한다) 해당 URL을 사용하는 것은 문제가 자신의 호스팅 애플리케이션 (Gmail, 캘린더, )에 로그인 한 사용자를 유지하지 않습니다.

엔드 포인트를 https://www.google.com/a/thedomain.com/o8/ud?be=o8으로 변경하면 모든 것이 변경됩니다. 나는 자동으로 다른 구글 앱 (gmail 등)에 로그인했다. 그러나 해당 끝점을 사용하여 요청 토큰을 또는에만 AX를 통해 가져옵니다. 분명하게 thats는 특히 잡종이 아니다. 그것의 아주 많은 것 또는 다른 것. 내가 작업이 Hybird 접근 방식을 얻으려고 노력 일 동안 고전을 면치 못하고 한

parameters = { 
    'openid.ns': 'http://specs.openid.net/auth/2.0', 
    'openid.claimed_id': 'http://specs.openid.net/auth/2.0/identifier_select', 
    'openid.identity': 'http://specs.openid.net/auth/2.0/identifier_select', 
    'openid.return_to':'http://our.domain.com/accounts/callback/', 
    'openid.realm': 'http://our.domain.com/', 
    'openid.assoc_handle': assoc_handle, 
    'openid.mode': 'checkid_setup', 

    'openid.ns.ext2': 'http://specs.openid.net/extensions/oauth/1.0', 
    'openid.ext2.consumer': 'our.domain.com', 
    'openid.ext2.scope': 'https://mail.google.com/mail/feed/atom', 

    'openid.ns.ax':'http://openid.net/srv/ax/1.0', 
    'openid.ax.mode':'fetch_request', 
    'openid.ax.required':'firstname,lastname,email', 
    'openid.ax.type.firstname':'http://axschema.org/namePerson/first', 
    'openid.ax.type.lastname':'http://axschema.org/namePerson/last', 
    'openid.ax.type.email':'http://axschema.org/contact/email',  
} 
return HttpResponseRedirect(end_point + '?' + urllib.urlencode(parameters)) 

이 (assoc_handle 이전에 오픈 ID 초기 요청에 의해 성공적으로 설정) https://www.google.com/accounts/o8/ud 엔드 포인트

예 요청 싸움 대부분의 불투명 한 오류 메시지 (This page is invalid ... 감사 Google) 및 일관성없는 문서의 부족. 나는이 시점에 도달 할 수있는 모든 코드 샘플을 트롤링했다. 어떤 도움을 주시면 감사하겠습니다 ...

답변

7

기록과 후손, 그리고 이것의 붕괴가 올 수있는 다른 사람들을 위해 나는 우스꽝스런 대답을 기록 할 것입니다.

궁극적으로 문제가 호출되었습니다

return HttpResponseRedirect(
    'https://www.google.com/a/thedomain.com/o8/ud?be=o8' 
    + '?' 
    + urllib.urlencode(parameters) 
) 

당신이 그것을 발견 할 수 있습니까? 예, 문제의 원인이되는 물음표가 명시 적으로 포함되었습니다. 한 번에 두 개의 쿼리 문자열이 존재하지 않습니다.

관련 문제