API การตรวจสอบสิทธิ์ผ่านเว็บ
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
ตัวรวมต้องใช้โฮสต์เว็บในการเปลี่ยนเส้นทางผู้ใช้เพื่อวัตถุประสงค์ในการตรวจสอบสิทธิ์ การตรวจสอบสิทธิ์นี้แตกต่างกัน แต่มีวัตถุประสงค์เดียวกับการตรวจสอบสิทธิ์ที่การตรวจสอบสิทธิ์ของ Android มีให้
โฮสต์เว็บนี้ต้องมีเว็บไซต์ที่เหมาะกับอุปกรณ์เคลื่อนที่
โฮสต์เว็บต้องกำหนดคำขอเว็บบนอุปกรณ์เคลื่อนที่เทียบกับคำขอเว็บบนเดสก์ท็อปตามค่าส่วนหัว User Agent หน้าที่แสดงในคำขอเว็บบนอุปกรณ์เคลื่อนที่ต้องเหมาะกับอุปกรณ์เคลื่อนที่ทั้งบน Android และ iOS นอกจากค่าส่วนหัว User Agent แล้ว ไคลเอ็นต์จะไม่ให้คำแนะนำอื่นเกี่ยวกับสภาพแวดล้อมที่ผู้ใช้รายนี้ส่งคำขอ (เดสก์ท็อปหรือเว็บ)
เซิร์ฟเวอร์ต้องใช้โปรโตคอล HTTPS โดยใช้ GET ผู้ผสานการทำงานเป็นผู้กำหนดเส้นทางและโฮสต์ ผู้ผสานการทำงานต้องรองรับ URL ที่มีความยาว 2,048 อักขระ ซึ่งรวมถึงสคีม โฮสต์ พอร์ต เส้นทาง และพารามิเตอร์
พารามิเตอร์ทั้งหมดจะได้รับการเข้ารหัส UTF-8 ก่อนที่จะเข้ารหัส URL
ส่งคำขอ
เมื่อร้องขอ Google จะให้พารามิเตอร์ต่อไปนี้เป็นพารามิเตอร์ของ URL
ช่อง |
gspMajorVersion
|
int
หมายเลขเวอร์ชันหลักสำหรับคำขอนี้
|
gspAuthenticationRequest
|
AuthenticationRequest
คำขอตรวจสอบสิทธิ์
|
gspAssociationId
|
string
หากมี ข้อมูลนี้จะมีตัวระบุที่ผู้ผสานการทำงานระบบใช้เพื่อค้นหาข้อมูลเข้าสู่ระบบสำหรับผู้ใช้ที่ทดสอบ หากไม่เห็นส่วนนี้ ผู้ใช้จะมีตัวเลือกในการเปลี่ยนการระบุบัญชี
|
gspCallbackUrl
|
string
URL ที่จะเปลี่ยนเส้นทางผู้ใช้ไป เพื่อดำเนินการตามขั้นตอนการตรวจสอบสิทธิ์ให้เสร็จสมบูรณ์ใน Google ค่านี้มีการเข้ารหัส URL
|
คำตอบ
เมื่อการตรวจสอบสิทธิ์เสร็จสมบูรณ์แล้ว จะต้องเปลี่ยนเส้นทางผู้ใช้ไปยัง gspCallbackUrl
โดยใช้ HTTPS GET URL นี้ต้องมีพารามิเตอร์การค้นหาต่อไปนี้
ช่อง |
gspResult
|
int
100
|
การตรวจสอบสิทธิ์สำเร็จ
|
201
|
ผู้ใช้ยกเลิกการโฟลว์ด้วยตนเองและควรล้มเลิกกระบวนการดังกล่าว
|
202
|
การตรวจสอบสิทธิ์ล้มเหลวด้วยเหตุผลที่ร้ายแรงและควรล้มเลิกกระบวนการดังกล่าว
|
|
gspAuthenticationResponse
|
AuthenticationResponse
การตอบกลับการตรวจสอบสิทธิ์
|
สงวนลิขสิทธิ์ Java เป็นเครื่องหมายการค้าจดทะเบียนของ Oracle และ/หรือบริษัทในเครือ
อัปเดตล่าสุด 2025-07-25 UTC
[[["เข้าใจง่าย","easyToUnderstand","thumb-up"],["แก้ปัญหาของฉันได้","solvedMyProblem","thumb-up"],["อื่นๆ","otherUp","thumb-up"]],[["ไม่มีข้อมูลที่ฉันต้องการ","missingTheInformationINeed","thumb-down"],["ซับซ้อนเกินไป/มีหลายขั้นตอนมากเกินไป","tooComplicatedTooManySteps","thumb-down"],["ล้าสมัย","outOfDate","thumb-down"],["ปัญหาเกี่ยวกับการแปล","translationIssue","thumb-down"],["ตัวอย่าง/ปัญหาเกี่ยวกับโค้ด","samplesCodeIssue","thumb-down"],["อื่นๆ","otherDown","thumb-down"]],["อัปเดตล่าสุด 2025-07-25 UTC"],[[["Integrators must implement a mobile-friendly web host to redirect users for authentication, similar to Android authentication but utilizing a web-based approach."],["The web host should distinguish between mobile and desktop requests using the user-agent header and deliver a mobile-friendly experience for both Android and iOS."],["The server must use HTTPS GET with a definable path and host, supporting URLs up to 2,048 characters, including parameters encoded in UTF-8 before URL encoding."],["Google provides URL parameters for the request including version, authentication request, association ID (for credential lookup), and a callback URL for redirection after authentication."],["Upon authentication completion, the user is redirected to the provided callback URL with parameters indicating the result (success, cancellation, or failure) and an authentication response."]]],["Integrators must host a mobile-friendly website for user authentication, distinguishing between mobile and desktop requests via the user-agent header. The server must utilize HTTPS GET, with a definable path and host, supporting URLs up to 2,048 characters. Google provides parameters like `gspMajorVersion`, `gspAuthenticationRequest`, `gspAssociationId`, and `gspCallbackUrl` within the request. Upon authentication completion, the user is redirected to `gspCallbackUrl` via HTTPS GET, including `gspResult` and `gspAuthenticationResponse` parameters. All parameters are UTF-8 and URL-encoded.\n"]]