Google Authentication
Google Cloud Platform is a cloud computing services that runs on the same infrastructure that Google uses internally.
GCP Console
Connect to Console.
Step 1: Create new project (optional)
INFO
If you already have a scrapoxy
project, you can skip this step.
- On the top left, click on the current project
- And click on
NEW PROJECT
.
- Enter
scrapoxy
as Project name; - And click on
CREATE
.
Wait for the project to be created. A notification appears when it's done:
Click on SELECT PROJECT
.
Step 2: Configure Consent Screen
- On the left menu, click on
APIs & Services
; - And click on
OAuth consent screen
.
There are two types of consent screen:
- Internal: if are a company and own a G Suite account
- External: if you are a person (with a
@gmail.com
account for example)
Select the type you want and click on CREATE
.
- Enter
Scrapoxy
as App name; - Select your email address as User support email;
- Enter your email address as Developer contact information;
- And click on
SAVE AND CONTINUE
.
- Click on
ADD OR REMOVE SCOPES
; - Select the following scopes:
/auth/usersinfo.email
/auth/userinfo.profile
/openid
- Click on
UPDATE
. - And click on
SAVE AND CONTINUE
.
- Click on
ADD USERS
; - If you have an external account, enter the gmail address of the person you want to access to Scrapoxy (including your address);
- Click on
ADD
. - And click on
SAVE AND CONTINUE
.
Click on BACK TO DASHBOARD
.
Step 3: Add client
- On the left menu, click on
APIs & Services
; - And click on
Credentials
.
- Click on
+ CREATE CREDENTIALS
; - And click on
OAuth client ID
.
- Select
Web application
as Application type; - Enter
Scrapoxy Client
as Name; - Enter
http://localhost:8890/api/users/auths/google
as Authorized redirect URIs (replacehttp://localhost:8890
by the external URL of your Scrapoxy instance) - And click on
CREATE
.
INFO
Google only accepts HTTPS URLS.
- Remember the Client ID;
- Remember the Client secret;
Scrapoxy
With Docker
Open the terminal and run the following command:
docker run -d -p 8888:8888 -p 8890:8890 -e FRONTEND_URL=http://localhost:8890 -e AUTH_GOOGLE_CLIENT_ID=my_client_id -e AUTH_GOOGLE_CLIENT_SECRET=my_client_secret -e BACKEND_JWT_SECRET=secret1 -e FRONTEND_JWT_SECRET=secret2 fabienvauchelles/scrapoxy
Replace:
my_client_id
andmy_client_secret
with the values you copied earlier;http://localhost:8890
by the external URL of your Scrapoxy instance (HTTPS only).
Scrapoxy will automatically bootstrap the Google authentication:
With NPM
On Linux
Open the terminal and run the following command:
FRONTEND_URL=http://localhost:8890 AUTH_GOOGLE_CLIENT_ID=my_client_id AUTH_GOOGLE_CLIENT_SECRET=my_client_secret BACKEND_JWT_SECRET=secret1 FRONTEND_JWT_SECRET=secret2 npx --yes scrapoxy
Replace:
my_client_id
andmy_client_secret
with the values you copied earlier;http://localhost:8890
by the external URL of your Scrapoxy instance (HTTPS only).
On Windows
Open the Command Prompt and run the following command:
set FRONTEND_URL=http://localhost:8890
set AUTH_GOOGLE_CLIENT_ID=my_client_id
set AUTH_GOOGLE_CLIENT_SECRET=my_client_secret
set BACKEND_JWT_SECRET=secret1
set FRONTEND_JWT_SECRET=secret2
npx --yes scrapoxy
Replace:
my_client_id
andmy_client_secret
with the values you copied earlier;http://localhost:8890
by the external URL of your Scrapoxy instance (HTTPS only).