auth: Convert GoogleMobileOAuth2Backend to accept a realm object.

This commit is contained in:
Tim Abbott
2017-11-21 12:23:07 -08:00
parent 37acfb4e90
commit a7d51127fb
3 changed files with 14 additions and 9 deletions

View File

@@ -645,8 +645,10 @@ def api_fetch_api_key(request, username=REQ(), password=REQ()):
# type: (HttpRequest, str, str) -> HttpResponse
return_data = {} # type: Dict[str, bool]
if username == "google-oauth2-token":
subdomain = get_subdomain(request)
realm = get_realm(subdomain)
user_profile = authenticate(google_oauth2_token=password,
realm_subdomain=get_subdomain(request),
realm=realm,
return_data=return_data)
else:
if not ldap_auth_enabled(realm=get_realm_from_request(request)):