Ausnahme gefangen: SSL certificate problem: certificate is not yet valid ๐Ÿ“Œ Registering OAuth clients for Google Sign-In

๐Ÿ  Team IT Security News

TSecurity.de ist eine Online-Plattform, die sich auf die Bereitstellung von Informationen,alle 15 Minuten neuste Nachrichten, Bildungsressourcen und Dienstleistungen rund um das Thema IT-Sicherheit spezialisiert hat.
Ob es sich um aktuelle Nachrichten, Fachartikel, Blogbeitrรคge, Webinare, Tutorials, oder Tipps & Tricks handelt, TSecurity.de bietet seinen Nutzern einen umfassenden รœberblick รผber die wichtigsten Aspekte der IT-Sicherheit in einer sich stรคndig verรคndernden digitalen Welt.

16.12.2023 - TIP: Wer den Cookie Consent Banner akzeptiert, kann z.B. von Englisch nach Deutsch รผbersetzen, erst Englisch auswรคhlen dann wieder Deutsch!

Google Android Playstore Download Button fรผr Team IT Security



๐Ÿ“š Registering OAuth clients for Google Sign-In


๐Ÿ’ก Newskategorie: Android Tipps
๐Ÿ”— Quelle: feedproxy.google.com

Posted by Isabella Chen, Software Engineer, and Laurence Moroney, Developer Advocate

Starting with Google Play services 8.3, we did a major revamp of the Google Sign-In APIs, supporting both client and server auth. Behind the scenes, these APIs use OAuth 2.0 tokens to ensure secure authentication and authorization. To maintain security, we provide tools in the Google Developers Console to register the clients using these tokens.

In this post, we’ll discuss the important task of registering OAuth clients for Google Sign-In, and the tools that we offer to make this as easy as possible.

Here are some scenarios that might apply to you:

  1. Start by creating a project in the Google Developers Console, which registers the client app on your behalf.
  2. If you have a backend server in your project, you’ll need an OAuth client ID for it, too.
  3. And don't forget to register OAuth clients for other test and release versions of your app, too!

In this post, we’ll cover some details on this process and address common pitfalls.

Getting Started - Create a Project in the Google Developers Console.

If you have not used Google Sign-In before, you can start integrating the API into your app by following the ‘Get a configuration file’ steps on this site. You’ll be taken to a setup wizard that will create an OAuth 2.0 client ID as shown in Figure 1.

Figure 1. Configuring your app

Once you’ve specified your app, you’ll be taken to a screen to choose and configure services such as Google Sign-In, Cloud Messaging or Google Analytics that you want your app to be able to use.

Choose Google Sign-In. In order to use it, you’ll need to get the SHA-1 of the signing certificate for your Android app. This can either be a debug or a release certificate, and for the purposes of this blog you’ll look at a debug one, but keep in mind that you’ll need to repeat this process for each package / certificate pair you end up using (described in the last section below).

You can get the debug SHA-1 using the keytool command like this:

keytool -list -v -keystore ~/.android/debug.keystore -alias androiddebugkey -storepass android -keypass android

Once you have your SHA-1, enter it as seen in Figure 2.

Figure 2. Enabling Google Sign-in

Now that your project is set up, you can get started with integrating the Sign-In API. But if you need to configure your project to work with a backend server or additional package name / keystores, keep reading the sections below.

Server Config - Ensure your server is registered within the same project.

If you have your own web or cloud server with data for your application, you’ll need OAuth credentials for your backend. Details on doing this can be found in the ID token and server auth code documentation.

Before using these flows, you’ll need to make sure you register your web server correctly in the Google Developers Console. Once there, you’ll be asked to select your project. See Figure 3.

Figure 3. Going directly to a project in the Google Developers Console.

Once you’ve selected your project, press the ‘Continue’ button, and you’ll go directly to the Credentials tab where all credential types are managed. Check the “OAuth 2.0 client IDs” section, and you will see the “Web client” and “Android client for com.my.package.name” that were created for you by the setup wizard. See Figure 4.

Figure 4. The Credentials Tab on the Developers Console - Web server OAuth client info

Take note of the Client ID for for your Web client, you’ll need it for both your app and server as illustrated below. (If you’ve created your project in the past and there’s no OAuth 2.0 client ID with Type “Web application”, then you will need to create one by selecting ‘New Credentials’ -> ‘OAuth client ID’.)

If you use an ID token flow for backend authentication, when you start developing your Android app, request an ID token in your GoogleSignInOptions, supplying the web client ID for your server:

GoogleSignInOptions gso =
    new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)
        .requestIdToken(serverClientId)
  .requestEmail()
  .build();

And then on your server, set the same OAuth client ID for your web application to be the audience:

GoogleIdTokenVerifier verifier =
    new GoogleIdTokenVerifier.Builder(transport, jsonFactory)
        .setAudience(Arrays.asList(serverClientId))
        .setIssuer("https://accounts.google.com")
        .build();

Successful verification will allow you to authenticate and issue a session for this newly signed-in user.

Alternatively, if you are using the server auth code flow for backend access to Google APIs, request a server auth code in your GoogleSignInOptions on Android, again supplying the web client ID for your server:

GoogleSignInOptions gso =
    new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)
        .requestScopes(new Scope(Scopes.DRIVE_APPFOLDER))
  .requestServerAuthCode(serverClientId)
  .requestEmail()
  .build();

And then on the server, both the OAuth client ID and the “Client secret” will be useful. The server SDK from Google can directly consume a downloaded JSON configuration file. You can click the download icon to download the JSON file (as shown in Figure 4) and use below code to construct GoogleClientSecrets:

GoogleClientSecrets clientSecrets =
    GoogleClientSecrets.load(
        JacksonFactory.getDefaultInstance(),
        new FileReader(PATH_TO_CLIENT_SECRET_FILE));

At which point you can access authenticated Google APIs on behalf of the signed-in user. Note that the “client secret” is really a secret that you should never reveal in your Android client.

Handling multiple environments - Registering other client IDs for your project.

Note that it can be common for apps to have different package names as well as different certificates (and thus SHA-1 keys) for various types of environment (such for different developers or test and release environments). Google uses your package name together with SHA-1 signing-certificate fingerprint to uniquely identify your Android application. It’s important to register every package name + SHA1 fingerprint pair in Google Developers Console.

For example, to register the release version of this package, you can do so by selecting ‘New Credentials’ -> ‘OAuth client ID’, shown in Figure 5 below, and then following the steps to add the package name and production keystore SHA-1.

Figure 5. The Credentials Tab on the Developers Console - create additional OAuth client ID

Now you are ready to handle the different environments where your app might be running and release to your users!

Hopefully, this has been helpful to you in understanding how to register for OAuth keys to keep your apps and servers secure. For more information, check out the Google Developers homepage for Identity.

...













๐Ÿ“Œ Registering OAuth clients for Google Sign-In


๐Ÿ“ˆ 63.06 Punkte

๐Ÿ“Œ Registering OAuth clients for Google Sign-In


๐Ÿ“ˆ 63.06 Punkte

๐Ÿ“Œ CVE-2022-2133 | OAuth Single Sign On Plugin up to 6.22.5 on WordPress oAuth Access Token improper authentication


๐Ÿ“ˆ 38.67 Punkte

๐Ÿ“Œ Handling OAuth 2 Sign-In and Sign-Up Distinctly with NextAuth.js


๐Ÿ“ˆ 34.88 Punkte

๐Ÿ“Œ Openshift OAuth Server /oauth/token/request Request cross site scripting


๐Ÿ“ˆ 28.3 Punkte

๐Ÿ“Œ OAuth 2.0 Explained: The Complete Guide to Understanding OAuth


๐Ÿ“ˆ 28.3 Punkte

๐Ÿ“Œ Improving user safety in OAuth flows through new OAuth Custom URI scheme restrictions


๐Ÿ“ˆ 28.3 Punkte

๐Ÿ“Œ CVE-2023-45144 | identity-oauth-ui up to 1.5 OAuth Authorization Page cross site scripting (GHSA-h2rm-29ch-wfmh)


๐Ÿ“ˆ 28.3 Punkte

๐Ÿ“Œ GitLab Community Edition 10.3 Oauth Sign-In weak authentication


๐Ÿ“ˆ 24.52 Punkte

๐Ÿ“Œ GitLab Community Edition 10.3 Oauth Sign-In schwache Authentisierung


๐Ÿ“ˆ 24.52 Punkte

๐Ÿ“Œ Medium CVE-2022-2133: Miniorange Oauth single sign on


๐Ÿ“ˆ 24.52 Punkte

๐Ÿ“Œ CVE-2022-2083 | Simple Single Sign On Plugin up to 4.1.0 on WordPress OAuth client_secret improper authentication


๐Ÿ“ˆ 24.52 Punkte

๐Ÿ“Œ CVE-2022-3119 | OAuth Client Single Sign On Plugin up to 3.0.3 on WordPress Setting improper authentication


๐Ÿ“ˆ 24.52 Punkte

๐Ÿ“Œ CVE-2023-1093 | OAuth Single Sign On Plugin up to 6.24.1 on WordPress cross-site request forgery


๐Ÿ“ˆ 24.52 Punkte

๐Ÿ“Œ GitLab Community Edition 10.3 Oauth Sign-In schwache Authentisierung


๐Ÿ“ˆ 24.52 Punkte

๐Ÿ“Œ CVE-2023-1092 | OAuth Single Sign On Free Plugin on WordPress cross-site request forgery


๐Ÿ“ˆ 24.52 Punkte

๐Ÿ“Œ Symantec Web Security up to 3.0.1.84 License Registering Interface denial of service


๐Ÿ“ˆ 24.43 Punkte

๐Ÿ“Œ Self-registering compact k3OS clusters to Rancher Server via cloud-init


๐Ÿ“ˆ 24.43 Punkte

๐Ÿ“Œ Facebook sues company for registering impostor domains


๐Ÿ“ˆ 24.43 Punkte

๐Ÿ“Œ Facebook sues companies for registering impostor domains


๐Ÿ“ˆ 24.43 Punkte

๐Ÿ“Œ Dropcontact: Registering with email [ +70 Chars ] Lead to Disclose some informations [Django Debug Mode ]


๐Ÿ“ˆ 24.43 Punkte

๐Ÿ“Œ Researcher Takes Over .IO Domains by Registering Name Servers


๐Ÿ“ˆ 24.43 Punkte

๐Ÿ“Œ Linux Academy: Is registering for a free account the same as starting the "free 7-day trial"?


๐Ÿ“ˆ 24.43 Punkte

๐Ÿ“Œ Domain Broker - Your only place for registering domains


๐Ÿ“ˆ 24.43 Punkte

๐Ÿ“Œ Angular registering animation triggers


๐Ÿ“ˆ 24.43 Punkte

๐Ÿ“Œ Valve: Web API key registration allows registering multiple keys by reusing `request_id`


๐Ÿ“ˆ 24.43 Punkte

๐Ÿ“Œ Domain Broker v2 - Your only place for registering domains


๐Ÿ“ˆ 24.43 Punkte

๐Ÿ“Œ Domain Broker v2 - Your only place for registering domains


๐Ÿ“ˆ 24.43 Punkte

๐Ÿ“Œ Zero-Day Bug In Verisign And IaaS Services Allowed Registering of Malicious Domains With Homoglyph


๐Ÿ“ˆ 24.43 Punkte

๐Ÿ“Œ Philippines Starts Registering Millions for National ID Cards


๐Ÿ“ˆ 24.43 Punkte

๐Ÿ“Œ Shopify: Staff with no permissions can listen to Shopify Ping conversions by registering to its different WebSocket Events


๐Ÿ“ˆ 24.43 Punkte

๐Ÿ“Œ Microsoft isย blocking Tutanota email addresses from registering a MS Teamsย account


๐Ÿ“ˆ 24.43 Punkte

๐Ÿ“Œ Difference between registering a component locally and globally


๐Ÿ“ˆ 24.43 Punkte

๐Ÿ“Œ Registering SQL Server on Azure Virtual Machines with New IaaS Agent Extension Benefits (Ep. 12)


๐Ÿ“ˆ 24.43 Punkte

๐Ÿ“Œ One-click loyalty sign ups/sign-ins with Google Pay | Demo


๐Ÿ“ˆ 22.73 Punkte

matomo