Download the PHP package happyr/google-site-authenticator-bundle without Composer

On this page you can find all versions of the php package happyr/google-site-authenticator-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package google-site-authenticator-bundle

Happyr Google Site Authenticator Bundle

Latest Version Build Status Code Coverage Quality Score Total Downloads

In some situations you want a website to make API request on the behalf of you (not your users). Example when you want to fetch website data from Google Analytics or upload database dumps to Google Drive. The solution Google offers for this is a Domain-Wide Delegation of Authority. But that solution requires you be a paying customer on Google Apps. I wanted a free solution so I created this bundle.

This bundle is using a normal OAuth for a web application, but it authenticates your google account (or accounts) but not your users'. It saves the access token in a cache until you manually revoke it.

Read all of this README file to understand how to get started and authenticated

Install

Use composer to get the bundle. You do also have to get a PSR-6 cache implementation.

Activate this bundle in AppKernel.

Include the routing.yml and make sure it is protected from normal users.

Get API credentials

You will find all information on the Google Console. Go in to the console and click on "APIs" in the sidebar to select those API you want to use.

To retrieve the API-key and secret, click on "Credentials" in the sidebar and then "Create new ClientID". And create a client ID for a web application. Make sure to specify the correct Authorized redirect URIs. If you used the configuration above you should use the following url:

When you are done you will get a client id and a client secret. Save those for the next section.

Configure

This bundle will fetch an access token and save it to cache. The PHPCacheAdapterBundle is an excellent bundle for this. You may use one of many predefined cache providers like; file_system, apc, mongodb etc. Read more about caching here: http://www.php-cache.com/

It also allows you to create your own cache provider. Here is an example configuration:

To configure the Happyr Google Site Authenticator bundle you need to add your API credentials and select a service extending Psr\Cache\CacheItemInterface. If you are using the configuration above you could use the following values:

You will find all available scopes here.

The config above will configure a token called google_drive. You may, of course, configure more tokens. To get a Google_Client instance with those credentials:

Authenticating

To make sure you fetch an access token you need to navigate to http://www.domain.com/admin/authenticate-google and click on Authenticate. You will be asked to sign in with your Google account and grant the permissions. The access token retrieved will be saved by the cache service. You want to make sure this is stored for a very long time.

When you are authenticated you may use happyr.google.client_provider to get an authenticated client.


All versions of google-site-authenticator-bundle with dependencies

PHP Build Version
Package Version
Requires php Version ^7.1
psr/cache Version ^1.0
psr/cache-implementation Version ^1.0
google/apiclient Version ~1.1, <=1.1.7
symfony/config Version ^4.4 || ^5.0
symfony/dependency-injection Version ^4.4 || ^5.0
symfony/event-dispatcher Version ^4.4 || ^5.0
symfony/http-kernel Version ^4.4 || ^5.0
symfony/framework-bundle Version ^4.4 || ^5.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package happyr/google-site-authenticator-bundle contains the following files

Loading the files please wait ....