Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Hold on, we're currently generating a fresh version of this report
Generated on May 7, 2024 via composer

google/auth v1.34.0

Google Auth Library for PHP
Package summary
Share
0
issues
3
licenses
8
MIT
1
BSD-3-Clause
1
Apache-2.0
Package created
24 Apr 2015
Version published
3 Jan 2024
Maintainers
2
Total deps
10
Direct deps
5
License
Apache-2.0

Issues

0
This package has no issues

Licenses

MIT License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
sublicense
private-use
Cannot
hold-liable
Must
include-copyright
include-license
8 Packages, Including:
guzzlehttp/guzzle@7.8.1
guzzlehttp/promises@2.0.2
guzzlehttp/psr7@2.6.2
psr/cache@3.0.0
psr/http-client@1.0.3
psr/http-factory@1.0.2
ralouphie/getallheaders@3.0.3
symfony/deprecation-contracts@v3.5.0

BSD 3-Clause "New" or "Revised" License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
place-warranty
Cannot
use-trademark
hold-liable
Must
include-copyright
include-license
1 Packages, Including:
firebase/php-jwt@v6.10.0

Apache License 2.0

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
sublicense
private-use
use-patent-claims
place-warranty
Cannot
hold-liable
use-trademark
Must
include-copyright
include-license
state-changes
include-notice
1 Packages, Including:
google/auth@v1.34.0
Disclaimer

This deed highlights only some of the key features and terms of the actual license. It is not a license and has no legal value. You should carefully review all of the terms and conditions of the actual license before using the licensed material.

Sandworm is not a law firm and does not provide legal services. Distributing, displaying, or linking to this deed or the license that it summarizes does not create a lawyer-client or any other relationship.

Direct Dependencies

5
All Dependencies CSV
β“˜ This is a list of google/auth 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities
firebase/php-jwtv6.10.023.55 kBBSD-3-Clause
prod
guzzlehttp/guzzle7.8.1112.34 kBMIT
prod dev
guzzlehttp/promises2.0.225.27 kBMIT
prod dev
guzzlehttp/psr72.6.276.41 kBMIT
prod dev
psr/cache3.0.06.01 kBMIT
prod

Visualizations

Frequently Asked Questions

What does google/auth do?

The Google Auth Library for PHP, available through the GitHub repository, provides a powerful method to utilize OAuth 2.0 authorization and authentication with Google APIs. This PHP client library enables secure and efficient interaction with a variety of Google's vast services, thus streamlining the integration process.

How do you use google/auth?

The most common way to install and use Google Auth Library in your PHP applications is through Composer, a standard package manager for PHP projects. Firstly, Composer can be installed via a CURL command as shown in the provided code:

curl -sS https://getcomposer.org/installer | php

Following the installation of Composer, Google Auth can then be fetched using the require command:

composer.phar require google/auth

In the Google Auth library, the focus is the application default credentials functionality, which offers a straightforward way of obtaining authorization credentials for Google API calls.

Here's a brief example of how to use this library, specifically for accessing Google Drive files in a read-only fashion:

use Google\Auth\ApplicationDefaultCredentials;
use GuzzleHttp\Client;
use GuzzleHttp\HandlerStack;

// Add the path to your JSON credentials file
putenv('GOOGLE_APPLICATION_CREDENTIALS=/path/to/my/credentials.json');

// Define the scopes for your API call
$scopes = ['https://www.googleapis.com/auth/drive.readonly'];

// Create the middleware
$middleware = ApplicationDefaultCredentials::getMiddleware($scopes);
$stack = HandlerStack::create();
$stack->push($middleware);

// Create the HTTP client
$client = new Client([
  'handler' => $stack,
  'base_uri' => 'https://www.googleapis.com',
  'auth' => 'google_auth'  // authorize all requests
]);

// Make your API request
$response = $client->get('drive/v2/files');

// Display the result
print_r((string) $response->getBody());

It's important to note that your service account credentials JSON file needs to be securely stored and not included in your source code.

Where are the google/auth docs?

The complete reference documentation for Google Auth Library is accessible at https://googleapis.github.io/google-auth-library-php/main/. This detailed guide encompasses all necessary information for introduction, installation, usage, various features, middleware, caching, and much more. As you navigate the complexities of authorization and authentication with Google APIs, this exhaustive resource serves as a reliable partner.