Class AuthorizationException
संग्रह की मदद से व्यवस्थित रहें
अपनी प्राथमिकताओं के आधार पर, कॉन्टेंट को सेव करें और कैटगरी में बांटें.
अनुमतिअपवाद
उपयोगकर्ता को अनुमति कार्ड दिखाने के लिए ट्रिगर करने के लिए, गड़बड़ी की जानकारी दी जा सकती है.
CardService.newAuthorizationException()
.setAuthorizationUrl('http://auth.com/')
.setResourceDisplayName('Example Resource')
.throwException();
ज़्यादा जानकारी वाला दस्तावेज़
printJson()
इस ऑब्जेक्ट को JSON फ़ॉर्मैट में प्रिंट करता है. यह सिर्फ़ डीबग करने के लिए है.
वापसी का टिकट
String
setAuthorizationUrl(authUrl)
अनुमति देने के अनुरोध से उपयोगकर्ता को जिस यूआरएल पर ले जाया जाता है उसे सेट करता है. ज़रूरी है.
पैरामीटर
नाम | टाइप | ब्यौरा |
authUrl | String | सेट किया जाने वाला अनुमति देने वाला यूआरएल. |
वापसी का टिकट
AuthorizationException
— चेन करने के लिए यह ऑब्जेक्ट.
setCustomUiCallback(callback)
कस्टम अनुमति वाला प्रॉम्प्ट जनरेट करने के लिए, कॉल किए जाने वाले फ़ंक्शन का नाम. ज़रूरी नहीं.
पैरामीटर
नाम | टाइप | ब्यौरा |
callback | String | अनुमति के लिए कस्टम प्रॉम्प्ट जनरेट करने वाले फ़ंक्शन का नाम. |
वापसी का टिकट
AuthorizationException
— चेन करने के लिए यह ऑब्जेक्ट.
setResourceDisplayName(name)
अनुमति मांगते समय, उपयोगकर्ता को दिखाया जाने वाला नाम सेट करता है. ज़रूरी है.
पैरामीटर
नाम | टाइप | ब्यौरा |
name | String | डिसप्ले नेम. |
वापसी का टिकट
AuthorizationException
— चेन करने के लिए यह ऑब्जेक्ट.
throwException()
इस अपवाद को ट्रिगर करता है.
जब तक कुछ अलग से न बताया जाए, तब तक इस पेज की सामग्री को Creative Commons Attribution 4.0 License के तहत और कोड के नमूनों को Apache 2.0 License के तहत लाइसेंस मिला है. ज़्यादा जानकारी के लिए, Google Developers साइट नीतियां देखें. Oracle और/या इससे जुड़ी हुई कंपनियों का, Java एक रजिस्टर किया हुआ ट्रेडमार्क है.
आखिरी बार 2025-07-26 (UTC) को अपडेट किया गया.
[null,null,["आखिरी बार 2025-07-26 (UTC) को अपडेट किया गया."],[[["\u003cp\u003e\u003ccode\u003eAuthorizationException\u003c/code\u003e triggers an authorization card to obtain user authorization.\u003c/p\u003e\n"],["\u003cp\u003eIt allows setting an authorization URL, a resource display name, and optionally, a custom authorization prompt.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers use \u003ccode\u003esetAuthorizationUrl()\u003c/code\u003e, \u003ccode\u003esetResourceDisplayName()\u003c/code\u003e, and \u003ccode\u003esetCustomUiCallback()\u003c/code\u003e to configure the authorization request.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003ethrowException()\u003c/code\u003e initiates the authorization flow, prompting the user to grant access.\u003c/p\u003e\n"],["\u003cp\u003eDebugging is facilitated by \u003ccode\u003eprintJson()\u003c/code\u003e which outputs the object's JSON representation.\u003c/p\u003e\n"]]],[],null,["# Class AuthorizationException\n\nAuthorizationException\n\nAn error that can be returned to trigger an authorization card to be shown to the user.\n\n```javascript\nCardService.newAuthorizationException()\n .setAuthorizationUrl('http://auth.com/')\n .setResourceDisplayName('Example Resource')\n .throwException();\n``` \n\n### Methods\n\n| Method | Return type | Brief description |\n|-----------------------------------------------------------------|-----------------------------|---------------------------------------------------------------------------------|\n| [printJson()](#printJson()) | `String` | Prints the JSON representation of this object. |\n| [setAuthorizationUrl(authUrl)](#setAuthorizationUrl(String)) | [AuthorizationException](#) | Sets the authorization URL that user is taken to from the authorization prompt. |\n| [setCustomUiCallback(callback)](#setCustomUiCallback(String)) | [AuthorizationException](#) | The name of a function to call to generate a custom authorization prompt. |\n| [setResourceDisplayName(name)](#setResourceDisplayName(String)) | [AuthorizationException](#) | Sets the name that is displayed to the user when asking for authorization. |\n| [throwException()](#throwException()) | `void` | Triggers this exception to be thrown. |\n\nDetailed documentation\n----------------------\n\n### `print``Json()`\n\nPrints the JSON representation of this object. This is for debugging only.\n\n#### Return\n\n\n`String`\n\n*** ** * ** ***\n\n### `set``Authorization``Url(authUrl)`\n\nSets the authorization URL that user is taken to from the authorization prompt. Required.\n\n#### Parameters\n\n| Name | Type | Description |\n|-------------|----------|-------------------------------|\n| `auth``Url` | `String` | The authorization URL to set. |\n\n#### Return\n\n\n[AuthorizationException](#) --- This object, for chaining.\n\n*** ** * ** ***\n\n### `set``Custom``Ui``Callback(callback)`\n\nThe name of a function to call to generate a custom authorization prompt. Optional.\n\n#### Parameters\n\n| Name | Type | Description |\n|------------|----------|------------------------------------------------------------------------|\n| `callback` | `String` | The name of the function that generates a custom authorization prompt. |\n\n#### Return\n\n\n[AuthorizationException](#) --- This object, for chaining.\n\n*** ** * ** ***\n\n### `set``Resource``Display``Name(name)`\n\nSets the name that is displayed to the user when asking for authorization. Required.\n\n#### Parameters\n\n| Name | Type | Description |\n|--------|----------|-------------------|\n| `name` | `String` | The display name. |\n\n#### Return\n\n\n[AuthorizationException](#) --- This object, for chaining.\n\n*** ** * ** ***\n\n### `throw``Exception()`\n\nTriggers this exception to be thrown."]]