Skip to content
No results
  • About Me (Resume)
  • Meetup Note/Share
  • เงินทอง งอกเงย
naiwaen@DebuggingSoft วงแหวนเว็บ
  • About Me (Resume)
  • Meetup Note/Share
  • เงินทอง งอกเงย
naiwaen@DebuggingSoft วงแหวนเว็บ

[Google] Google Account เปิดใช้งาน App Password

  • AdminpingAdminping
  • August 20, 2021
  • Network & Security

สำหรับ Feature นี้ตอบโจทย์กับหลายๆคนเลยครับ มี Email อาจจะทำสำหรับแจ้งเตือนบางเรื่อง เช่น

  • Build Server Fail
  • CI/CD Test Fail
  • แจ้งเตือนประกาศเวอร์ชันที่ Build ตามรอบ หรือ Sprint นั้นๆ
  • ใช้ทดสอบของ DEV ภายในบริษัท

จาก Use-Case ทั้ง 3 เรื่อง หลายคนอาจจะแยกเป็น 3 Email แต่

  • มันก็ต้องวุ่นวายมาจัดการถือ แต่ละ Email อีก
  • Google เองไม่ยอมให้ Service ภายนอกใส่ User / Password เข้ามา Login ตรงๆ มันติดเรื่อง Security ครับ โดยใช้ Script จะพบ Error
ssmtp: Authorization failed (534 5.7.14 https://support.google.com/mail/answer/78754 v24-v6sm2921112pfl.31 - gsmtp)
  • หมายเหตุ: จริงๆ Google มันเปิดให้ทำ Less secure apps แต่พอใช้ไปสักพักตัว Options นี้มันจะถูกปิดอัตโนมัติ หากเป็นการทำงานที่มี Pattern ครับ
    Update 30-MAY-2022 Google ไม่ยอมให้ทำ Less secure apps แล้ว
  • แต่ Google มี Feature สำหรับแก้ปัญหาใช้ App Password เข้ามาแก้ปัญหาครับ

ขั้นตอนการเปิดใช้งาน App Password

  • 1. เปิดใช้งาน Two step verification
  • 2. กำหนด App Password
  • 3. Enable external access ให้กับ Google Account

1. เปิดใช้งาน Two step verification

  • เปิดในงาน Two step verification ตาม Link https://myaccount.google.com/signinoptions/two-step-verification จากนั้นเลือก Email ที่ต้องการได้เลยครับ
  • จากนั้นระบุวิธีการยืนยันตัวตน ว่าใช้
    • Smart Phone / Tablet Android ที่ Login บัญชี Google ไว้ครับ
    • หรือ OTP ที่ส่งมาจาก SMS ครับ

2. กำหนด App Password

  • เข้า Link  https://security.google.com/settings/security/apppasswords
  • ที่หน้าจอ App Password มีให้เลือกว่าจะเป็นของ
    • App ไหนที่ใช้งาน อาทิ เช่น Mail (Gmail) / YouTube หรือ อื่นๆ
    • Device ที่เอาไปใช้ครับ อาทิ เช่น Smart Phone / Tablet หรือ Windows Computer
  • สำหรับของผมตอนนี้เลือกเป็น App เป็น Mail และ Device เป็น Windows Computer
  • ระบบสร้าง Password สำหรับใช้งาน Mail บน Device เป็น Windows Computer ตามกรอบสีแดง ให้ Copy เป็นไว้ครับ เพราะ เราจะเอา App Password ไปใช้งานแทน Password จริงๆ ของเราบน Script เช่น PowerShell ครับ

3. Enable external access ให้กับ Google Account

  • เข้า Link https://accounts.google.com/DisplayUnlockCaptcha จากนั้นกด Allow
  • ระบบจะเตือนเรื่อง Two Step Verification ครับ ซึ่งเราทำเสร็จเรียบร้อยแล้ว

สรุป

  • หลังจากเปิดใช้ App Password แล้ว เวลาที่จะงานจริง ใส่ Google Account + App Password ที่ Gen ขึ้นมาครับ จะมองว่ามันเป็น Token ก็ได้ครับ
  • ถ้าจะเข้ามาจัดการ App Password ใช้ Link  https://security.google.com/settings/security/apppasswords โดยถ้าอันไหนไม่ใช้แล้ว สามารถลบได้ครับ

Share this:

  • Tweet
  • Click to email a link to a friend (Opens in new window) Email
  • Click to print (Opens in new window) Print
  • Click to share on Telegram (Opens in new window) Telegram
  • Click to share on WhatsApp (Opens in new window) WhatsApp

Like this:

Like Loading...

Related


Discover more from naiwaen@DebuggingSoft

Subscribe to get the latest posts sent to your email.

Tags
# gmail# ssmtp: Authorization failed# 534 5.7.14# App Password# Google Service# Login google account from scipt

About me

Adminping

Adminping

My name is Chatri Ngambenchawong and I am a Software Developer, Blogger, Geek and FoodMania ^__^

View Full Profile →

Donate (ร่วมสนับสนุน)

Facebook Page

Facebook Page

Categories

Archives

Pages

  • About Me (Resume)
  • Meetup Note/Share
  • นโยบายการใช้คุกกี้ (Cookies Policy)
  • นโยบายความเป็นส่วนตัวของข้อมูล (Privacy Policy)
  • เงินทอง งอกเงย

Recent Posts

  • แยกร่างมาฟัง Global Azure 2025 Thailand + AzureSecEve
  • [CR] Starbucks Chicken Club Sandwich
  • เวลามี Merge Request / Pull Request มีแนวทางการตรวจยังไง
  • Spring Test Error java.lang.ClassNotFoundException: org.junit.platform.engine.reporting.OutputDirectoryProvider
  • [CR] Starbucks Spring Onion & Cream Cheese Bagel

Meta

  • Log in
  • Entries feed
  • Comments feed
  • WordPress.org

Related Posts

[Powershell] ssh with .pem key error Bad permissions. Try removing permissions for user: NT AUTHORITY\\Authenticated Users

  • August 14, 2024

OpenSSH: Set ChrootDirectory for specific user on windows

  • September 8, 2023

How to show hidden files in WinSCP

  • September 6, 2023

ถ้าสนใจ Blog สรุปต่างๆ ลองมา Subscribe กันได้ครับ เดี๋ยวจะมีเมล์จาก donotreply@wordpress.com มาให้กด Confirm อีกทีครับ

  • About Me (Resume)
  • นโยบายการใช้คุกกี้ (Cookies Policy)
Copyright © 2025 - WordPress Theme by CreativeThemes
Manage Cookie Consent
To provide the best experiences, we use technologies like cookies to store and/or access device information. Consenting to these technologies will allow us to process data such as browsing behavior or unique IDs on this site. Not consenting or withdrawing consent, may adversely affect certain features and functions.
Functional Always active
The technical storage or access is strictly necessary for the legitimate purpose of enabling the use of a specific service explicitly requested by the subscriber or user, or for the sole purpose of carrying out the transmission of a communication over an electronic communications network.
Preferences
The technical storage or access is necessary for the legitimate purpose of storing preferences that are not requested by the subscriber or user.
Statistics
The technical storage or access that is used exclusively for statistical purposes. The technical storage or access that is used exclusively for anonymous statistical purposes. Without a subpoena, voluntary compliance on the part of your Internet Service Provider, or additional records from a third party, information stored or retrieved for this purpose alone cannot usually be used to identify you.
Marketing
The technical storage or access is required to create user profiles to send advertising, or to track the user on a website or across several websites for similar marketing purposes.
Manage options Manage services Manage {vendor_count} vendors Read more about these purposes
View preferences
{title} {title} {title}
%d