ספריות ודוגמאות של OAuth 2.0
קל לארגן דפים בעזרת אוספים
אפשר לשמור ולסווג תוכן על סמך ההעדפות שלך.
הספריות והדוגמאות הבאות מאפשרות להתחיל בקלות להשתמש בהרשאה מסוג OAuth 2.0 כדי לגשת לשירותי Gmail IMAP ו-SMTP.
דוגמה ל-Java
JavaMail 1.5.2 ואילך תומך באופן מקורי ב-OAuth ל-IMAP.
אם אתם צריכים להשתמש בגרסה ישנה יותר או ליצור הטמעה משלכם, תוכלו לעיין בקוד לדוגמה ב-Java.
כדי להוריד את הדוגמה, אפשר לעיין במאמר כלים וקוד לדוגמה לאימות ב-Gmail באמצעות OAuth2.
דוגמה של Python
דוגמה ל-PHP
אלא אם צוין אחרת, התוכן של דף זה הוא ברישיון Creative Commons Attribution 4.0 ודוגמאות הקוד הן ברישיון Apache 2.0. לפרטים, ניתן לעיין במדיניות האתר Google Developers. Java הוא סימן מסחרי רשום של חברת Oracle ו/או של השותפים העצמאיים שלה.
עדכון אחרון: 2025-08-29 (שעון UTC).
[null,null,["עדכון אחרון: 2025-08-29 (שעון UTC)."],[],[],null,["# OAuth 2.0 Libraries and Samples\n\nThe following libraries and samples make it easy to get started using OAuth 2.0\nauthorization to access the Gmail IMAP and SMTP services.\n\nJava Sample\n-----------\n\nJavaMail 1.5.2 or later [natively supports OAuth for IMAP](https://javaee.github.io/javamail/OAuth2).\nIf you need to use an older version, or create your own implementation, see the\n[Java sample code](https://github.com/google/gmail-oauth2-tools/wiki/JavaSampleCode).\nTo download the sample, refer to\n[Tools and sample code for authenticating to Gmail with OAuth2](https://github.com/google/gmail-oauth2-tools).\n\nPython Sample\n-------------\n\n- [Getting Started](https://github.com/google/gmail-oauth2-tools/wiki/OAuth2DotPyRunThrough)\n- [Download](https://raw.githubusercontent.com/google/gmail-oauth2-tools/master/python/oauth2.py)\n\nPHP Sample\n----------\n\n- [Getting Started](https://github.com/google/gmail-oauth2-tools/wiki/PhpSampleCode)\n- [Download](https://github.com/google/gmail-oauth2-tools/blob/master/php/oauth2.php)"]]