當前位置: 首頁>>編程示例 >>用法及示例精選 >>正文


JavaScript ArcGIS new OAuthInfo用法及代碼示例

基本信息

以下是所在類或對象的基本信息。

AMD: require(["esri/identity/OAuthInfo"], (OAuthInfo) => { /* code goes here */ });

ESM: import OAuthInfo from "@arcgis/core/identity/OAuthInfo";

類: esri/identity/OAuthInfo

繼承: OAuthInfo > Accessor

自從:用於 JavaScript 4.0 的 ArcGIS API

用法說明

new OAuthInfo函數(或屬性)的定義如下:

new OAuthInfo (properties)


參數:

類型說明
properties Object
可選的

請參閱屬性以獲取可以傳遞到構造函數中的所有屬性的列表。

例子:

require(["esri/identity/OAuthInfo", "esri/identity/IdentityManager"],
function (OAuthInfo, esriId)
{
  let info = new OAuthInfo({
    appId: "<put client id here>",
    flowType: "authorization-code" // this is needed for popups, otherwise it will revert to implicit flow
    popup: true // make sure to set callback page to one that supports authentication type
  });

  esriId.registerOAuthInfos([info]);
})

相關用法


注:本文由純淨天空篩選整理自arcgis.com大神的英文原創作品 new OAuthInfo。非經特殊聲明,原始代碼版權歸原作者所有,本譯文未經允許或授權,請勿轉載或複製。