Clean up Google sign in (#258)
This is unnecessary; we are just using browser login Updates tailscale/corp#18202 Signed-off-by: kari-ts <kari@tailscale.com>pull/259/head
parent
af2e33d130
commit
facf6406c3
@ -1,43 +0,0 @@
|
||||
// Copyright (c) Tailscale Inc & AUTHORS
|
||||
// SPDX-License-Identifier: BSD-3-Clause
|
||||
|
||||
package com.tailscale.ipn;
|
||||
|
||||
import android.app.Activity;
|
||||
import android.content.Intent;
|
||||
import android.content.Context;
|
||||
|
||||
import com.google.android.gms.auth.api.signin.GoogleSignIn;
|
||||
import com.google.android.gms.auth.api.signin.GoogleSignInAccount;
|
||||
import com.google.android.gms.auth.api.signin.GoogleSignInClient;
|
||||
import com.google.android.gms.auth.api.signin.GoogleSignInOptions;
|
||||
|
||||
// Google implements helpers for Google services.
|
||||
public final class Google {
|
||||
static String getIdTokenForActivity(Activity act) {
|
||||
GoogleSignInAccount acc = GoogleSignIn.getLastSignedInAccount(act);
|
||||
return acc.getIdToken();
|
||||
}
|
||||
|
||||
static void googleSignIn(Activity act, String serverOAuthID, int reqCode) {
|
||||
act.runOnUiThread(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
GoogleSignInOptions gso = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)
|
||||
.requestIdToken(serverOAuthID)
|
||||
.requestEmail()
|
||||
.build();
|
||||
GoogleSignInClient client = GoogleSignIn.getClient(act, gso);
|
||||
Intent signInIntent = client.getSignInIntent();
|
||||
App.startActivityForResult(act, signInIntent, reqCode);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
static void googleSignOut(Context ctx) {
|
||||
GoogleSignInOptions gso = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)
|
||||
.build();
|
||||
GoogleSignInClient client = GoogleSignIn.getClient(ctx, gso);
|
||||
client.signOut();
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue