本文简要介绍 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。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。
