رموز الدخول ذات الاستخدام المحدود
توفِّر رموز الدخول المحدودة الاستخدام حماية من الطلبات من الانتحال وإعادة تشغيل الهجمات، ما يضمن تنفيذ الإجراء الذي أرسله المستخدم. ويتم تحقيق الحماية عن طريق إضافة معلمة رمز مميز فريدة إلى معلمات الطلب والتحقق منها عند استدعاء الإجراء.
يجب إنشاء معلمة الرمز المميّز كمفتاح لا يمكن استخدامه إلا لإجراء معيّن ولمستخدم محدّد فقط. قبل تنفيذ الإجراء المطلوب، يجب أن تتحقق من صلاحية الرمز المميز وأنه يطابق الرمز الذي أنشأته للمستخدم. وفي حال تطابق الرمز المميّز، يمكن تنفيذ الإجراء ويصبح الرمز المميّز غير صالح للطلبات المستقبلية.
يجب إرسال رموز الدخول إلى المستخدم كجزء من السمة url
في HttpActionHandler. على سبيل المثال، إذا كان طلبك يعالج طلبات الموافقة على الرقم http://www.example.com/approve?requestId=123
، ننصحك بتضمين معلَمة accessToken
إضافية إليه والاستماع إلى الطلبات المرسَلة إلى http://www.example.com/approve?requestId=123&accessToken=xyz
.
عليك الجمع بين requestId=123
وaccessToken=xyz
مسبقًا للتأكد من أنّه لا يمكن استنتاج accessToken
من requestId
. يجب رفض أي طلب موافقة يتضمّن requestId=123
وليس accessToken
أو يتضمّن accessToken
لا يساوي xyz
. وبعد الموافقة على هذا الطلب، يجب رفض أي طلب في المستقبل يحمل المعرّف نفسه ورمز الدخول نفسه.
إنّ محتوى هذه الصفحة مرخّص بموجب ترخيص Creative Commons Attribution 4.0 ما لم يُنصّ على خلاف ذلك، ونماذج الرموز مرخّصة بموجب ترخيص Apache 2.0. للاطّلاع على التفاصيل، يُرجى مراجعة سياسات موقع Google Developers. إنّ Java هي علامة تجارية مسجَّلة لشركة Oracle و/أو شركائها التابعين.
تاريخ التعديل الأخير: 2024-09-03 (حسب التوقيت العالمي المتفَّق عليه)
[null,null,["تاريخ التعديل الأخير: 2024-09-03 (حسب التوقيت العالمي المتفَّق عليه)"],[[["Limited-Use Access Tokens enhance security by mitigating request spoofing and replay attacks, ensuring actions are performed by the intended user."],["These tokens function as unique keys, valid for a specific action and user, verified before the action is executed and invalidated afterward."],["Access tokens are transmitted via the `url` property of the `HttpActionHandler`, requiring developers to include an `accessToken` parameter for verification."],["To ensure security, a unique combination of `requestId` and `accessToken` should be pre-generated, with any request lacking the correct token being rejected."],["Upon successful execution of a request with a valid token, subsequent requests using the same token should be denied to prevent replay attacks."]]],["The core concept is using Limited-Use Access Tokens to secure user actions. A unique token, tied to a specific action and user, is added to request parameters (e.g., in a URL). Before an action executes, the system verifies the token's validity and user association. Valid tokens are then invalidated to prevent reuse. The system should generate the access token, ensuring it's unpredictable from the request ID and reject requests with missing or invalid tokens.\n"]]