diff --git a/docs/en/authentication/jwt.md b/docs/en/authentication/jwt.md index da26c29..3155bf5 100644 --- a/docs/en/authentication/jwt.md +++ b/docs/en/authentication/jwt.md @@ -7,29 +7,11 @@ description: Comprehensive guide to setting up JWT (Service Account) authenticat HolySheets supports multiple authentication methods to securely interact with your Google Sheets. This guide focuses on **JWT (Service Account) Authentication**, providing step-by-step instructions to configure a service account in Google Cloud Console, integrate it with HolySheets, and perform a simple data insertion example. -## Table of Contents - -1. [Configuring JWT Credentials in Google Cloud Console](#configuring-jwt-credentials-in-google-cloud-console) - - [1.1. Enable Google Sheets API](#11-enable-google-sheets-api) - - [1.2. Create a Service Account](#12-create-a-service-account) - - [1.3. Generate and Download Service Account Key](#13-generate-and-download-service-account-key) - - [1.4. Share Your Google Sheet with the Service Account](#14-share-your-google-sheet-with-the-service-account) -2. [Integrating JWT with HolySheets](#integrating-jwt-with-holysheets) - - [2.1. Initializing the JWT Client](#21-initializing-the-jwt-client) - - [2.2. Integrating HolySheets with JWT](#22-integrating-holysheets-with-jwt) -3. [Inserting Data Example](#inserting-data-example) - - [3.1. Inserting a Record](#31-inserting-a-record) - - [3.2. Running the Example](#32-running-the-example) -4. [References and Additional Resources](#references-and-additional-resources) -5. [Examples Repository](#examples-repository) - ---- - ## Configuring JWT Credentials in Google Cloud Console To enable HolySheets to access your Google Sheets securely using JWT, you need to set up a **Service Account** in the Google Cloud Console. Follow these steps to configure the necessary credentials. -### 1.1. Enable Google Sheets API +## 1. Enable Google Sheets API 1. **Access Google Cloud Console:** @@ -47,7 +29,7 @@ To enable HolySheets to access your Google Sheets securely using JWT, you need t - Click on **"Google Sheets API"** from the search results. - Click **"Enable"**. -### 1.2. Create a Service Account +## 2. Create a Service Account 1. **Navigate to Service Accounts:** @@ -68,7 +50,7 @@ To enable HolySheets to access your Google Sheets securely using JWT, you need t 4. **Grant Users Access to This Service Account:** (Optional) - Click **"Done"**. -### 1.3. Generate and Download Service Account Key +## 3. Generate and Download Service Account Key 1. **Create a Key for the Service Account:** @@ -82,7 +64,7 @@ To enable HolySheets to access your Google Sheets securely using JWT, you need t - A JSON key file will be downloaded automatically. **Store this file securely**, as it contains sensitive information. - **Important:** Do not expose this file publicly or commit it to version control systems. -### 1.4. Share Your Google Sheet with the Service Account +## 4. Share Your Google Sheet with the Service Account 1. **Open Your Google Sheet:** @@ -97,11 +79,11 @@ To enable HolySheets to access your Google Sheets securely using JWT, you need t --- -## Integrating JWT with HolySheets +## 5. Integrating JWT with HolySheets With your service account credentials obtained and your Google Sheet shared with the service account, you can now integrate JWT authentication into your HolySheets project. -### 2.1. Initializing the JWT Client +## 6. Initializing the JWT Client Create a file named `jwtAuth.ts` in your project's `src` directory to handle JWT client initialization. @@ -148,7 +130,7 @@ export function initializeJWTClient() { path-to-your-service-account-key.json ``` -### 2.2. Integrating HolySheets with JWT +## 7. Integrating HolySheets with JWT Create or update your jwtIndex.ts file in the src directory to set up HolySheets with the JWT client. diff --git a/docs/en/authentication/oauth2.md b/docs/en/authentication/oauth2.md index d9e6cf7..5247dde 100644 --- a/docs/en/authentication/oauth2.md +++ b/docs/en/authentication/oauth2.md @@ -3,31 +3,11 @@ title: Authentication description: Comprehensive guide to setting up OAuth2 and JWT authentication with HolySheets. --- -# Authentication - -HolySheets supports multiple authentication methods to securely interact with your Google Sheets. This guide covers two primary authentication methods: **OAuth2** and **JWT**. Follow the steps below to configure each method and integrate them into your HolySheets project. - -## Table of Contents - -1. [OAuth2 Authentication](#oauth2-authentication) - - [1.1. Configuring OAuth2 Credentials in Google Cloud Console](#11-configuring-oauth2-credentials-in-google-cloud-console) - - [1.2. Obtaining a Refresh Token](#12-obtaining-a-refresh-token) - - [1.3. Integrating OAuth2 with HolySheets](#13-integrating-oauth2-with-holysheets) - - [1.4. Inserting Data Example](#14-inserting-data-example) -2. [JWT Authentication](#jwt-authentication) - - [2.1. Configuring JWT Credentials in Google Cloud Console](#21-configuring-jwt-credentials-in-google-cloud-console) - - [2.2. Integrating JWT with HolySheets](#22-integrating-jwt-with-holysheets) - - [2.3. Inserting Data Example](#23-inserting-data-example) -3. [References and Additional Resources](#references-and-additional-resources) -4. [Examples Repository](#examples-repository) - ---- - -## OAuth2 Authentication +# OAuth2 Authentication OAuth2 is a widely-used authentication protocol that allows your application to access user data securely. Follow the steps below to set up OAuth2 authentication with HolySheets. -### 1.1. Configuring OAuth2 Credentials in Google Cloud Console +## 1. Configuring OAuth2 Credentials in Google Cloud Console To enable HolySheets to access your Google Sheets securely, you need to configure OAuth2 credentials in the Google Cloud Console. @@ -64,7 +44,7 @@ To enable HolySheets to access your Google Sheets securely, you need to configur ``` - Click **"Update"** and then **"Save and Continue"**. - **Add Test Users:** - - In the **"Test users"** section, add your Google account email (e.g., `josetelesmaciel@gmail.com`). + - In the **"Test users"** section, add your Google account email (e.g., `youremail@emailprovider.com`). - Click **"Save and Continue"**. - **Finalize Configuration:** - Skip the optional sections and click **"Save and Continue"** until you finish. @@ -84,7 +64,7 @@ To enable HolySheets to access your Google Sheets securely, you need to configur - After creation, a dialog will display your **Client ID** and **Client Secret**. - **Copy** these values securely; you'll need them for your project. -### 1.2. Obtaining a Refresh Token +## 2. Obtaining a Refresh Token A **refresh token** allows your application to obtain new access tokens without user intervention. Follow these steps to obtain a refresh token using the **OAuth 2.0 Playground**. @@ -118,11 +98,11 @@ A **refresh token** allows your application to obtain new access tokens without - You will receive an **Access Token** and a **Refresh Token**. - **Copy the Refresh Token** and keep it secure; you'll need it for your project. -### 1.3. Integrating OAuth2 with HolySheets +## 3. Integrating OAuth2 with HolySheets With your OAuth2 credentials and refresh token obtained, integrate OAuth2 authentication into your existing HolySheets project. -#### 1.3.1. Initializing the OAuth2 Client +### 3.1. Initializing the OAuth2 Client Create a file named `auth.ts` in your project's `src` directory to handle OAuth2 client initialization. @@ -155,7 +135,7 @@ export function initializeOAuth2Client() { **Note**: Replace 'YOUR_CLIENT_ID_HERE', 'YOUR_CLIENT_SECRET_HERE', and 'YOUR_REFRESH_TOKEN_HERE' with your actual credentials obtained from the previous steps. -#### 1.3.2. Integrating HolySheets with OAuth2 +### 3.2. Integrating HolySheets with OAuth2 Create or update your index.ts file in the src directory to set up HolySheets with the OAuth2 client.