-
-
Notifications
You must be signed in to change notification settings - Fork 545
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove discontinued GoogleOpenId backend
It was discontinued on the server side in 2015, in favor of OpenID Connect (our GoogleOpenIdConnect backend). https://support.google.com/accounts/answer/6206245 Fixes #462. Fixes #472. Signed-off-by: Anders Kaseorg <[email protected]>
- Loading branch information
Showing
2 changed files
with
0 additions
and
109 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
import datetime | ||
import json | ||
import unittest2 | ||
|
||
|
@@ -10,7 +9,6 @@ | |
|
||
from ..models import User | ||
from .oauth import OAuth1Test, OAuth2Test | ||
from .open_id import OpenIdTest | ||
from .open_id_connect import OpenIdConnectTestMixin | ||
|
||
|
||
|
@@ -95,100 +93,6 @@ def test_with_anonymous_key_and_secret(self): | |
self.do_login() | ||
|
||
|
||
JANRAIN_NONCE = datetime.datetime.now().strftime('%Y-%m-%dT%H:%M:%SZ') | ||
|
||
|
||
class GoogleOpenIdTest(OpenIdTest): | ||
backend_path = 'social_core.backends.google.GoogleOpenId' | ||
expected_username = 'FooBar' | ||
discovery_body = ''.join([ | ||
'<?xml version="1.0" encoding="UTF-8"?>', | ||
'<xrds:XRDS xmlns:xrds="xri://$xrds" xmlns="xri://$xrd*($v*2.0)">', | ||
'<XRD>', | ||
'<Service priority="0">', | ||
'<Type>http://specs.openid.net/auth/2.0/signon</Type>', | ||
'<Type>http://openid.net/srv/ax/1.0</Type>', | ||
'<Type>http://specs.openid.net/extensions/ui/1.0/mode/popup</Type>', | ||
'<Type>http://specs.openid.net/extensions/ui/1.0/icon</Type>', | ||
'<Type>http://specs.openid.net/extensions/pape/1.0</Type>', | ||
'<URI>https://www.google.com/accounts/o8/ud</URI>', | ||
'</Service>', | ||
'<Service priority="10">', | ||
'<Type>http://specs.openid.net/auth/2.0/signon</Type>', | ||
'<Type>http://openid.net/srv/ax/1.0</Type>', | ||
'<Type>http://specs.openid.net/extensions/ui/1.0/mode/popup</Type>', | ||
'<Type>http://specs.openid.net/extensions/ui/1.0/icon</Type>', | ||
'<Type>http://specs.openid.net/extensions/pape/1.0</Type>', | ||
'<URI>https://www.google.com/accounts/o8/ud?source=mail</URI>', | ||
'</Service>', | ||
'<Service priority="10">', | ||
'<Type>http://specs.openid.net/auth/2.0/signon</Type>', | ||
'<Type>http://openid.net/srv/ax/1.0</Type>', | ||
'<Type>http://specs.openid.net/extensions/ui/1.0/mode/popup</Type>', | ||
'<Type>http://specs.openid.net/extensions/ui/1.0/icon</Type>', | ||
'<Type>http://specs.openid.net/extensions/pape/1.0</Type>', | ||
'<URI>https://www.google.com/accounts/o8/ud?source=gmail.com</URI>', | ||
'</Service>', | ||
'<Service priority="10">', | ||
'<Type>http://specs.openid.net/auth/2.0/signon</Type>', | ||
'<Type>http://openid.net/srv/ax/1.0</Type>', | ||
'<Type>http://specs.openid.net/extensions/ui/1.0/mode/popup</Type>', | ||
'<Type>http://specs.openid.net/extensions/ui/1.0/icon</Type>', | ||
'<Type>http://specs.openid.net/extensions/pape/1.0</Type>', | ||
'<URI>', | ||
'https://www.google.com/accounts/o8/ud?source=googlemail.com', | ||
'</URI>', | ||
'</Service>', | ||
'<Service priority="10">', | ||
'<Type>http://specs.openid.net/auth/2.0/signon</Type>', | ||
'<Type>http://openid.net/srv/ax/1.0</Type>', | ||
'<Type>http://specs.openid.net/extensions/ui/1.0/mode/popup</Type>', | ||
'<Type>http://specs.openid.net/extensions/ui/1.0/icon</Type>', | ||
'<Type>http://specs.openid.net/extensions/pape/1.0</Type>', | ||
'<URI>https://www.google.com/accounts/o8/ud?source=profiles</URI>', | ||
'</Service>', | ||
'</XRD>', | ||
'</xrds:XRDS>' | ||
]) | ||
server_response = urlencode({ | ||
'janrain_nonce': JANRAIN_NONCE, | ||
'openid.assoc_handle': 'assoc-handle', | ||
'openid.claimed_id': 'https://www.google.com/accounts/o8/id?' | ||
'id=some-google-id', | ||
'openid.ext1.mode': 'fetch_response', | ||
'openid.ext1.type.email': 'http://axschema.org/contact/email', | ||
'openid.ext1.type.first_name': 'http://axschema.org/namePerson/first', | ||
'openid.ext1.type.last_name': 'http://axschema.org/namePerson/last', | ||
'openid.ext1.type.old_email': 'http://schema.openid.net/contact/email', | ||
'openid.ext1.value.email': '[email protected]', | ||
'openid.ext1.value.first_name': 'Foo', | ||
'openid.ext1.value.last_name': 'Bar', | ||
'openid.ext1.value.old_email': '[email protected]', | ||
'openid.identity': 'https://www.google.com/accounts/o8/id?' | ||
'id=some-google-id', | ||
'openid.mode': 'id_res', | ||
'openid.ns': 'http://specs.openid.net/auth/2.0', | ||
'openid.ns.ext1': 'http://openid.net/srv/ax/1.0', | ||
'openid.op_endpoint': 'https://www.google.com/accounts/o8/ud', | ||
'openid.response_nonce': JANRAIN_NONCE + 'by95cT34vX7p9g', | ||
'openid.return_to': 'http://myapp.com/complete/google/?' | ||
'janrain_nonce=' + JANRAIN_NONCE, | ||
'openid.sig': 'brT2kmu3eCzb1gQ1pbaXdnWioVM=', | ||
'openid.signed': 'op_endpoint,claimed_id,identity,return_to,' | ||
'response_nonce,assoc_handle,ns.ext1,ext1.mode,' | ||
'ext1.type.old_email,ext1.value.old_email,' | ||
'ext1.type.first_name,ext1.value.first_name,' | ||
'ext1.type.last_name,ext1.value.last_name,' | ||
'ext1.type.email,ext1.value.email' | ||
}) | ||
|
||
def test_login(self): | ||
self.do_login() | ||
|
||
def test_partial_pipeline(self): | ||
self.do_partial_pipeline() | ||
|
||
|
||
class GoogleRevokeTokenTest(GoogleOAuth2Test): | ||
def test_revoke_token(self): | ||
self.strategy.set_settings({ | ||
|