Fix an oversight that wouldn't let us use oauth for dasher
b/12457993 Change-Id: I1ec31a17e292a76b26db5b5e75c51929d38c1f2d
This commit is contained in:
parent
2043ad73ef
commit
3cba65acec
@ -539,10 +539,11 @@ public class AccountSetupBasics extends AccountSetupActivity
|
||||
final String domain = emailParts[1].trim();
|
||||
mProvider = AccountSettingsUtils.findProviderForDomain(this, domain);
|
||||
if (mProvider == null) {
|
||||
// TODO: STOPSHIP: Need better error handling here.
|
||||
Toast.makeText(AccountSetupBasics.this,
|
||||
"No provider, can't proceed", Toast.LENGTH_SHORT).show();
|
||||
return;
|
||||
// Right now the only provider we support is google. Assume that domain for now.
|
||||
// This will let us authenticate dasher accounts.
|
||||
// TODO: STOPSHIP: we really need UI to allow this user to pick
|
||||
// "authenticate with google" or some such.
|
||||
mProvider = AccountSettingsUtils.findProviderForDomain(this, "google.com");
|
||||
}
|
||||
|
||||
try {
|
||||
|
@ -50,7 +50,6 @@ public class OAuthAuthenticationActivity extends Activity implements
|
||||
|
||||
@Override
|
||||
public boolean shouldOverrideUrlLoading(WebView wv, String url) {
|
||||
LogUtils.d(TAG, "shouldOverrideUrlLoading %s", url);
|
||||
// TODO: This method works for Google's redirect url to https://localhost.
|
||||
// Does it work for the general case? I don't know what redirect url other
|
||||
// providers use, or how the authentication code is returned.
|
||||
@ -62,8 +61,6 @@ public class OAuthAuthenticationActivity extends Activity implements
|
||||
deparameterizedUrl = url.substring(0,i);
|
||||
}
|
||||
|
||||
LogUtils.d(TAG, "deparementerized url %s, redirect uri %s", deparameterizedUrl,
|
||||
mProvider.redirectUri);
|
||||
if (TextUtils.equals(deparameterizedUrl, mProvider.redirectUri)) {
|
||||
final Uri uri = Uri.parse(url);
|
||||
// Check the params of this uri, they contain success/failure info,
|
||||
@ -151,7 +148,7 @@ public class OAuthAuthenticationActivity extends Activity implements
|
||||
final OAuthAuthenticator authenticator = new OAuthAuthenticator();
|
||||
final AuthenticationResult result = authenticator.requestAccess(
|
||||
getContext(), mProviderId, mCode);
|
||||
LogUtils.d(Logging.LOG_TAG, "authentication result %s", result);
|
||||
LogUtils.d(Logging.LOG_TAG, "authentication %s", result);
|
||||
return result;
|
||||
// TODO: do I need a better UI for displaying exceptions?
|
||||
} catch (AuthenticationFailedException e) {
|
||||
|
Loading…
Reference in New Issue
Block a user