Skip to content

Commit

Permalink
Update readme with credentials instructions
Browse files Browse the repository at this point in the history
  • Loading branch information
huanlui committed Jun 22, 2021
1 parent 8148bce commit 941cd31
Show file tree
Hide file tree
Showing 12 changed files with 71 additions and 8 deletions.
Binary file added .README_images/app_name.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .README_images/app_verification.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .README_images/consent_screen.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .README_images/credential.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .README_images/credentials.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .README_images/credentials2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .README_images/document_name.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .README_images/download_json.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .README_images/message.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .README_images/new_project.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added .README_images/permissions.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
79 changes: 71 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,83 @@ Python 3 is required.
pip3 install -r requirements.txt
```

### Credentials



### Credentials

### Set up GCP

1) Go to https://console.cloud.google.com/apis/credentials
2) Set up a new project
3) Go to Credentials, `Create Credentials`, select `OAuth client ID`
4) If prompted, setup OAuth consent screen, and return
5) Put client id and secret in `tw.credentials.json`
6) Repeat for `client.credentials.json`

![Set up a new project](.README_images/new_project.png)

3) Choose any name (`gcal3` in the example) and don't select any organisation

![Project name](.README_images/document_name.png)

4) Select OAuth consent screen, select `External` as User Type and click on create.

![Consent screen](.README_images/consent_screen.png)

5) Set as app name to any name, eg. `gcalsync`. Only this name, user support email and developer contact information are mandatory.

![](.README_images/app_name.png)

6) Click on `Save and Continue`

7) Then, in scopes, select `Add or remove scopes` and in `Manually add scopes` put this:

```
https://www.googleapis.com/auth/calendar
https://www.googleapis.com/auth/calendar.events
```

8) Click on `Add to table` and then in `Update`.

9) Click on `Save and Continue`

10) In test users, add your own user (Google email).

11) Click on `Save and Continue`.

12) Go to Credentials, `Create Credentials`, select `OAuth client ID`

![Credentials](.README_images/credentials.png)

13) Set application type to `Desktop app` and choose any application name. Oncen created opn

![](.README_images/credentials2.png)


14) Once created, click on the created credential.

![](.README_images/credential.png)

15) Click on the credential and download json file to the gcalsync directory, with a name format like this:

```
name.credentials.json
```

where `name` can be chosen by you to identify your account.

![Download credentials](.README_images/download_json.png)

16) Repeat all the previous steps if you want to manage other accounts.

### Run the application

The first time the application is run, a popup appears to verify your credentials. If a message indicates that Google has not
verified the application, click on `Continue`

![App verification](.README_images/app_verification.png)

Allos the permissions to edit calendars.

![](.README_images/permissions.png)

If you get a message like this, follow the instructions on it to enable calendar API.

![](.README_images/message.png)

### Documentation
https://medium.com/@bfortuner/python-unit-testing-with-pytest-and-mock-197499c4623c

0 comments on commit 941cd31

Please sign in to comment.