OAuth 2.0 लाइब्रेरी और सैंपल
संग्रह की मदद से व्यवस्थित रहें
अपनी प्राथमिकताओं के आधार पर, कॉन्टेंट को सेव करें और कैटगरी में बांटें.
Gmail की आईएमएपी और एसएमटीपी सेवाओं को ऐक्सेस करने के लिए, OAuth 2.0 ऑथराइज़ेशन का इस्तेमाल शुरू करना इन लाइब्रेरी और सैंपल की मदद से आसान हो जाता है.
Java कोड का नमूना
JavaMail 1.5.2 या इसके बाद के वर्शन में, IMAP के लिए OAuth की सुविधा पहले से मौजूद होती है.
अगर आपको किसी पुराने वर्शन का इस्तेमाल करना है या अपना खुद का कोड लागू करना है, तो Java का सैंपल कोड देखें.
सैंपल डाउनलोड करने के लिए, OAuth2 की मदद से Gmail में पुष्टि करने के लिए टूल और सैंपल कोड पर जाएं.
Python कोड का नमूना
PHP नमूना
जब तक कुछ अलग से न बताया जाए, तब तक इस पेज की सामग्री को Creative Commons Attribution 4.0 License के तहत और कोड के नमूनों को Apache 2.0 License के तहत लाइसेंस मिला है. ज़्यादा जानकारी के लिए, Google Developers साइट नीतियां देखें. Oracle और/या इससे जुड़ी हुई कंपनियों का, Java एक रजिस्टर किया हुआ ट्रेडमार्क है.
आखिरी बार 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)"]]