認証済み電話番号(Android)電話番号ヒント(Android)
Intelligent Tracking Prevention(ITP)ブラウザでの One Tap
macOS サポートの追加
認証済み電話番号
電話番号ヒント
ITP ブラウザの One Tap
ユーザーのコンバージョンの増加業界をリードするセキュリティパスワード管理に伴うリスクの削減専用のログインページや登録ページにリダイレクトせずにログインや登録を実現パーソナライズしたプロンプトによる重複アカウントの削減と再訪ユーザーの自動ログイン
macOS プラットフォーム拡張
サポートの終了予定
Android での Smart Lock for Passwords のサポート終了ウェブサイト向け Google ログインのサポート終了
Smart Lock for Passwords のサポート終了
ウェブサイト向け Google ログインのサポート終了
Google Identity は、データの保護において Google を信頼してくださっている Google アカウント ユーザーに充実した機能を提供すべく、日々努力を重ねています。同時に、ユーザーにすばらしい体験を提供するアプリを作るデベロッパー コミュニティにも貢献したいと考えています。Google とデベロッパーとの連携により、ユーザーは次の 3 つの重要な方法でデータの共有を管理できるようになっています。
Google は日々、デフォルトで安全で、設計上プライベートなプロダクトを構築することを通して、ユーザーが自分のデータを管理できるようにすることに注力しています。しかし、一般的なオンラインのセキュリティ脆弱性は、Google のプロダクト以外の部分、すなわちオンライン アカウントに不適切なパスワードでログインすることによって生じています。データ漏洩によって毎日膨大な数のパスワードが漏れ出し、ユーザーの個人情報が危険にさらされています。Google が最優先しているのは、オンラインのユーザーの安全を守ることです。そこで私たちは、個人情報を安全に保つための新しいツールや機能の開発に継続的に取り組んでいます。
この度(元記事公開当時)、Google Identity Services という新しい一連の Identity API をリリースします。これは、複数の ID サービスを 1 つのソフトウェア開発キット(SDK)にまとめたものです。この SDK には、Google でログインするためのボタンや、簡単に利用できる新しい認証プロンプトである One Tap が含まれています。Google でログインと One Tap は、パートナーのウェブサイトやアプリにログインするのにパスワードではなく、安全なトークンを利用します。
この取り組みは、プライバシーやセキュリティを損なわない ID ソリューションを提供することを目的として始まりました。そして今回、それが実現できました。新しい Google Identity Services は、業界トップクラスの Google のセキュリティと、簡単なログインによる究極の利便性を組み合わせることで、ユーザーを安全に保ちつつ、新しいユーザーの獲得やリピーターのシームレスなログインを促進する体験を提供します。
One Tap は、先回り型のシームレスなログイン プロンプトで、ユーザーがウェブサイトやアプリを使ってパーソナライズされたコンテンツに安全にアクセスする際に役立ちます。従来のログインボタンとは異なり、One Tap はどんなページからでもプロンプトを表示できます。そのため、ユーザーをランディング ページにリダイレクトする必要はなく、ユーザーのナビゲーションの意図が妨げられることはありません。One Tap プロンプトは、ウェブサイトでは右上から下に向かって、モバイル デバイスでは下から上に向かってスライドして表示されます。ユーザーは、1 回タップするだけでログインや登録をすることができ、認証情報を覚えたり、パスワードを作成したりする必要はありません。パートナーは、この認証ソリューションを使って大きな成果を上げています。劇的に手間が少なくなることで、ウェブサイトやアプリでのユーザーのログイン率や登録率が増加しました。
Google Identity Services プロダクトは、クリック ジャッキングやピクセル トラッキングなどの脆弱性、その他の脅威からの保護も考慮されています。そのため、ユーザーは安心してウェブサイトやアプリを利用できます。すべての Google アカウントには、強固な不正利用対策や不正防止システムが適用されています。そのため、Google Identity Services を使うことで、重複アカウントや不正アカウントによるリスクを軽減でき、サポートの負荷も減少します。
さらに、Google でログインするためのボタンの改善版をロールアウトし、リピーターに対してユーザー固有の詳細情報を表示するようにしました。これにより、選択されるユーザー アカウントが表示されるようになります。Google でログインするボタンでは、ウェブ全体での UI/UX の整合性も向上しており、プラットフォーム全体で信頼性とセキュリティを向上することができます。
Google は、デベロッパーの実装プロセスを簡単にし、最低限のコードで実現できるように懸命に作業を進めています。ぜひこの新しい API スイートを使い、ビジネスの成長にお役立てください。新しい Google Identity Services の実装を始めるには、デベロッパー サイトで技術ドキュメントをご覧ください。技術サポートを受けたい方は、Stack Overflow で google-signin タグをチェックしてください。
差出人: SMS メッセージ: あなたの 1 回限りのコードは 1234 です。
implementation "com.google.android.gms:play-services-auth:17.0.0" implementation "com.google.android.gms:play-services-auth-api-phone:17.1.0"
smsRetriever.startSmsUserConsent( senderPhoneNumber /* または null */)
val consentIntent = extras.getParcelable<Intent>( SmsRetriever.EXTRA_CONSENT_INTENT) startActivityForResult( consentIntent, SMS_CONSENT_REQUEST)
val message = data. getStringExtra( SmsRetriever.EXTRA_SMS_MESSAGE)
「たった半日で認証を実装することができました。以前は、独自のソリューションの作成には何週間もかかり、プロバイダの API に変更が発生するたびにアップデートしなければなりませんでした」- Amine Laadhari, Fabulous CTO
「Firebase Authentication は最低限の設定しか必要としないので、短時間で簡単にソーシャル アカウントへのサインアップが実装できました。コンソールで提供されるユーザー管理機能もすばらしく、簡単に認証システムを実装できました」- Marc Yeongho Kim, Malang Studio CEO 兼 創立者
getAccountName
getId
dependencies { compile 'com.google.android.gms:play-services-auth:9.0.0' }
keytool -list -v -keystore ~/.android/debug.keystore -alias androiddebugkey -storepass android -keypass android
GoogleSignInOptions gso = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN) .requestIdToken(serverClientId) .requestEmail() .build();
GoogleIdTokenVerifier verifier = new GoogleIdTokenVerifier.Builder(transport, jsonFactory) .setAudience(Arrays.asList(serverClientId)) .setIssuer("https://accounts.google.com") .build();
GoogleSignInOptions gso = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN) .requestScopes(new Scope(Scopes.DRIVE_APPFOLDER)) .requestServerAuthCode(serverClientId) .requestEmail() .build();
GoogleClientSecrets clientSecrets = GoogleClientSecrets.load( JacksonFactory.getDefaultInstance(), new FileReader(PATH_TO_CLIENT_SECRET_FILE));
GoogleApiClient
// Don’t do it this way! GoogleApiClient gac = new GoogleApiClient.Builder(this, this, this) .addApi(Games.API) .addScope(Plus.SCOPE_PLUS_LOGIN) // The bad part .build(); // Don’t do it this way!
plus.login
// This way you won’t get a consent screen GoogleApiClient gac = new GoogleApiClient.Builder(this, this, this) .addApi(Games.API) .build(); // This way you won’t get a consent screen
.addApi(Games.API, new GamesOptions.Builder() .setRequireGooglePlus(true).build())
Games.getCurrentPlayerId()
Plus.PeopleApi.load
com.google.android.gms.games
tokeninfo
GetServerAuthCode
Games.getGamesServerAuthCode(googleApiClient, “your_server_client_id”)
// Good way { GetServerAuthCodeResult result = Games.getGamesServerAuthCode(gac, clientId).await(); if (result.isSuccess()) { String authCode = result.getCode(); // Send code to server. } } // Good way
www.googleapis.com/games/v1/applications/<app_id>/verify/
"Authorization:OAuth <access_token>"
getGamesServerAuthCode()
GoogleSignInOptions gso = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN) .requestIdToken(getString(R.string.server_client_id)) .requestEmail() .build();
GoogleIdTokenVerifier verifier = new GoogleIdTokenVerifier.Builder(transport, jsonFactory) // Here is where the audience is set -- checking that it really is your server // based on your Server’s Client ID .setAudience(Arrays.asList(ENTER_YOUR_SERVER_CLIENT_ID_HERE)) // Here is where we verify that Google issued the token .setIssuer("https://accounts.google.com").build(); GoogleIdToken idToken = verifier.verify(idTokenString); if (idToken != null) { Payload payload = idToken.getPayload(); String userId = payload.getSubject(); // You can also access the following properties of the payload in order // for other attributes of the user. Note that these fields are only // available if the user has granted the 'profile' and 'email' OAuth // scopes when requested. Even when requested, some fields may be null. // String email = payload.getEmail(); // boolean emailVerified = Boolean.valueOf(payload.getEmailVerified()); // String name = (String) payload.get("name"); // String pictureUrl = (String) payload.get("picture"); // String locale = (String) payload.get("locale"); // String familyName = (String) payload.get("family_name"); // String givenName = (String) payload.get("given_name");
GoogleSignInOptions gso = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN) .requestEmail() .build();
Intent signInIntent = Auth.GoogleSignInApi.getSignInIntent(mGoogleApiClient); startActivityForResult(signInIntent, RC_SIGN_IN);
@Override public void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); // Result returned from launching the Intent from GoogleSignInApi.getSignInIntent(...); if (requestCode == RC_SIGN_IN) { GoogleSignInResult result = Auth.GoogleSignInApi.getSignInResultFromIntent(data); handleSignInResult(result); } }
OptionalPendingResult opr = Auth.GoogleSignInApi.silentSignIn(mGoogleApiClient);
if (pendingResult.isDone()) { doStuffWith(pendingResult.get()); } else { // There's no immediate result ready, displays some progress indicator and waits for the // async callback. showProgressIndicator(); pendingResult.setResultCallback(new ResultCallback() { @Override public void onResult(@NonNull GoogleSignInResult result) { updateButtonsAndStatusFromSignInResult(result); hideProgressIndicator(); } }); }