本文簡要介紹 python 語言中 arcgis.gis.Item.register 的用法。
用法:
register(app_type, redirect_uris=None, http_referers=None, privileges=None)返回:
表示‘success’或‘error’的字典
register方法向企業注冊應用程序項,從而為該應用程序生成 APPID 和 APPSECRET(在 OAuth 語言中也分別稱為 client_id 和 client_secret)。成功注冊後,Registered App 類型關鍵字將附加到應用項。注意:
register方法可供項目所有者使用。Parameter
Description
app_type
必需的字符串。注冊的應用程序類型,指示它是瀏覽器應用程序、本機應用程序、服務器應用程序還是多接口應用程序。值:瀏覽器、本機、服務器或多個
redirect_uris
可選列表。 access_token 或授權代碼將在成功授權後交付的 URI。授權時指定的redirect_uri必須與注冊的URI之一匹配,否則授權將被拒絕。
還可以為授權授予指定特殊值 urn:ietf:wg:oauth:2.0:oob。這將導致授權代碼被傳送到門戶 URL (/oauth2/approval)。此值通常由沒有 Web 服務器或可以交付代碼的自定義 URI 方案的應用程序使用。
該值是一個 JSON 字符串數組。
http_referers
可選列表。
APIKey的使用將受到限製的 http 引薦來源網址列表。注意:也可以為非 apiKey 類型的應用程序配置 Http Referrers。此處配置的列表將用於驗證在訪問共享 API 時發送的應用令牌。推薦人檢查不會應用於用戶令牌。
privileges
可選列表。此
APIKey可用的權限列表。注意:也可以為非
API Key類型的應用程序配置權限。當使用應用令牌訪問項目端點時,此處配置的列表將用於授予對項目的訪問權限。這些檢查不會應用於用戶令牌,他們可以根據當前的項目共享模型繼續訪問項目。使用應用令牌,如果未配置權限列表,則可以訪問應用所有者的所有項目。例子:
# Usage Example >>> item.register(app_type = "browser", >>> redirect_uris = [ "https://app.example.com", "urn:ietf:wg:oauth:2.0:oob" ], >>> http_referers = [ "https://foo.com", "https://bar.com" ], >>> privileges = ["portal:apikey:basemaps", "portal:app:access:item:itemId", >>> "premium:user:geocode", "premium:user:networkanalysis"] )
相關用法
- Python ArcGIS Item.reassign_to用法及代碼示例
- Python ArcGIS Item.related_items用法及代碼示例
- Python ArcGIS Item.publish用法及代碼示例
- Python ArcGIS Item.share用法及代碼示例
- Python ArcGIS Item.status用法及代碼示例
- Python ArcGIS Item.delete_relationship用法及代碼示例
- Python ArcGIS Item.download用法及代碼示例
- Python ArcGIS Item.delete用法及代碼示例
- Python ArcGIS Item.copy用法及代碼示例
- Python ArcGIS Item.move用法及代碼示例
- Python ArcGIS Item.create_tile_service用法及代碼示例
- Python ArcGIS Item.add_comment用法及代碼示例
- Python ArcGIS Item.copy_feature_layer_collection用法及代碼示例
- Python ArcGIS Item.export用法及代碼示例
- Python ArcGIS Item.update_thumbnail用法及代碼示例
- Python ArcGIS Item.add_relationship用法及代碼示例
- Python ArcGIS Item.update用法及代碼示例
- Python ArcGIS Item.usage用法及代碼示例
- Python ArcGIS Item.get_thumbnail用法及代碼示例
- Python ArcGIS ImageryLayer.thumbnail用法及代碼示例
- Python arcgis.apps.hub.Initiative.update用法及代碼示例
- Python ArcGIS ImageryLayer.draw_graph用法及代碼示例
- Python arcgis.apps.hub.IndicatorManager.add用法及代碼示例
- Python arcgis.apps.hub.InitiativeManager.add用法及代碼示例
- Python ArcGIS ImageryLayer.compute_stats_and_histograms用法及代碼示例
注:本文由純淨天空篩選整理自arcgis.com大神的英文原創作品 arcgis.gis.Item.register。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。
