Giter Site home page Giter Site logo

nanogp's Introduction

nanogp

Add-on for nanogallery2 to access Google Photos content.

Since february 9, 2017, Google Photos can no more be accessed without account owner's explicit authorization. Permanent authorization is only possible for server side applications.

nanogp is a PHP application which delivers Google Photos content to nanogallery2.

- --> WARNING: please use NANOGP only with a Google Photos account which does not contain any personal or privat data.
- All your photos albums can be accessed by NANOGP. This may be used by malicious people.
- 
- --> ### SO, USE A DEDICATED GOOGLE PHOTOS ACCOUNT. ###

Pre-requisites:

Web server with PHP version > 5.2
Cannot be run on localhost (workaround, use http://lvh.me instead)

Installation procedure

  • Create a folder named nanogp on your web server.
  • Copy the content of the dist folder in this folder.

Upgrade procedure

Copy the content of the dist folder to your server, but never overwrite the tools.php file.
If you overwrite it, you'll need to set the configuration again.

Configuration

Settings are defined in admin/config.php:

  $cfg_client_id = 'yyy';
  $cfg_client_secret = 'zzz';

cfg_client_id and cfg_client_secret can be obtained from the Google developers console.

Enable Google API - Google developers console

Create and configure a new projet.

  1. Open page: https://console.developers.google.com

  2. Create a new project named nanogallery2gp-YOUR-INSTANCE-NAME (the project name should be unique, so replace YOUR-INSTANCE-NAME with the name of your own instance)

step 1

step 2

  1. Create a consent screen

Select your email address

Define the "product nameshown to user": "nanogallery2gp-YOUR-INSTANCE-NAME"

Others fields are optional

step 3

  1. Create credentials kind OAuth Client ID

step 4

Application type: "Web application"
Name: "nanogallery2gp-YOUR-INSTANCE-NAME"

Define the authorized redirect URLs: enter the full path to your authorize.php

step 5

And you get your personal and confidential Client ID and client secret

step 6

Grant authorization

Once the settings are defined, you need to grant authorization to your Google Photos account.
Use a browser to open the authorize.php page: http://your_webserver/nanogp/authorize.php

(if you want to grant authorization again, follow steps from the section Manually revoke authorization).

Security

The admin folder should only be accessible to your PHP applications.
For example, with deny from all set in .htaccess file.

Manually revoke authorization

OAuth2

More about OAuth2: https://developers.google.com/identity/protocols/OAuth2WebServer

nanogp's People

Contributors

kris-b avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.