# Hướng dẫn cấu hình đăng nhập bằng Google

## Hướng dẫn lấy thông tin cấu hình trên Google

{% hint style="danger" %}

#### Các thông tin trong hình bên dưới chỉ mang tính chất tham khảo. Bạn cần thay đổi cho phù hợp.

{% endhint %}

Truy cập đường dẫn sau

```
https://console.developers.google.com/project
```

{% hint style="info" %}
Bạn đăng nhập vào bằng email của tổ chức (Ví dụ: <hoang@cohota.com>)
{% endhint %}

Sau đó bạn nhấn nút "Create Project", nhập các thông tin cần thiết và nhấn nút "Create"

![](/files/-MFVd-AkKU4YDX1DYXVA)

Tiếp theo bạn nhấn nút 3 gạch ngang ở góc trên bên trái -> Chọn "**APIs & Services**" -> Chọn "**OAuth consent screen".**

{% hint style="info" %}
Bạn sẽ thấy hai lựa chọn "Internal" và "External":

* Internal: cho phép đăng nhập bằng các email nội bộ. Ví dụ: Khi chọn tùy chọn này, bạn chỉ có thể đăng nhập bằng tài khoản có đuôi @cohota.com.
* External: cho phép mọi tài khoản email của Google có thể đăng nhập.
  {% endhint %}

Ở đây mình chọn là Internal và nhấn nút "Create".

![](/files/-MFVg7CLqAnIeXKIuH9P)

Tiếp theo bạn nhập thông tin như **Application name**, **Application logo** của bạn.

![](/files/-MFViyXNLmoH2Y2E4G43)

{% hint style="warning" %}
Lưu ý: **Application name** là tên hiển thị khi ai đó đăng nhập vào Project của bạn. Ví dụ như hình bên dưới "Tiếp tục với Cohota". "Cohota" là **Application name**.
{% endhint %}

![](/files/-MFVlVKUrkPVYidntwWe)

Ở phần **Authorized domains** bạn nhập tên miền của bạn. **Application Privacy Policy link** bạn nhập tới trang **Privacy Policy** của bạn, nếu không bạn có thể điền tên miền của bạn như **Authorized domains**. Sau đó bạn nhấn "Save".

![](/files/-MFVkVvin6-1eao-Hadz)

Sau đó, bạn chọn "**Credentials"** ở thanh công cụ bên trái, nhấn nút "**Create credentials"** và chọn "**OAuth client ID**". Ở phần **Application type** bạn chọn "Web application". Nhập tên vào "Name". Bỏ qua phần **Authorized JavaScript origins.** Phần **Authorized redirect URIs**, bạn nhấn nút "Add URI". Lúc này bạn cần vào trang LMS của mình để sao chép "Redirect URI" (Cách lấy Redirect URI bạn có thể tham khảo [tại đây](https://docs.cohota.com/dang-nhap/huong-dan-dang-nhap-bang-single-sign-on)) và dán vào ô này. Sau đó bạn nhấn "Create".&#x20;

Khi bạn đã có "**Your Client ID**" và "**Your Client Secret**", bạn có thể cấu hình đăng nhập Google cho LMS của mình (Cách cấu hình bạn có thể tham khảo [tại đây](https://docs.cohota.com/dang-nhap/huong-dan-dang-nhap-bang-single-sign-on)).


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.cohota.com/dang-nhap/huong-dan-cau-hinh-dang-nhap-bang-google.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
