laptop and a wrench

不具合

OAuthenticationManager is not working as expected in ArcGIS Runtime SDK for Xamarin Forms.

最後に公開された状態: July 16, 2021 ArcGIS Runtime SDK
不具合 ID 番号 BUG-000138488
送信されましたMarch 25, 2021
最終更新日June 5, 2024
適用対象ArcGIS Runtime SDK
見つかったバージョン100.10
オペレーティング システムWindows OS
オペレーティング システムのバージョン10.0 64 Bit
ステータスNon-Reproducible

参考情報

This issue is caused by an incorrect OAuth workflow configuration in the client application code, where two separate workflows have been combined: one intended for authenticating specific users and one intended for authenticating applications.

対処法

User-based authentication

To support user-based authentication with OAuth, the recommended approach is OAuth Authorization Code. In this case the TokenAuthenticationType must be set to OAuthAuthorizationCode. Refer to ArcGIS Developers: ArcGIS Identity for more information.

Example:

var serverInfo = new ServerInfo(new Uri("https://www.arcgis.com/sharing/rest"))

{

  TokenAuthenticationType = TokenAuthenticationType.OAuthAuthorizationCode,

  OAuthClientInfo = new OAuthClientInfo("...", null)

};

Application-based authentication

  • To support application-based authentication with OAuth, it is necessary to use the Client Credential approach with a client ID and client secret. In this case the TokenAuthenticationType must be set to OAuthClientCredentials. Refer to ArcGIS Developers: Application credentials for more information.

Example: 

var serverInfo = new ServerInfo(new Uri("https://www.arcgis.com/sharing/rest"))

{

  TokenAuthenticationType = TokenAuthenticationType.OAuthClientCredentials,

  OAuthClientInfo = new OAuthClientInfo("...", null, "...")

};

Notes:

  • It is not necessary to issue separate REST requests for tokens, instead the ArcGIS Runtime API supports this process automatically via the AuthenticationManager. 
  • If a manual refresh of the token is required, application code should call OAuthTokenCredential.RefreshAsync().
  • Various properties of the credential can be accessed via API properties on OAuthTokenCredential, such as UserName

再現の手順

不具合 ID: BUG-000138488

ソフトウェア:

  • ArcGIS Runtime SDK

バグのステータスが変更されたときに通知を受け取る

Esri Support アプリのダウンロード

このトピックについてさらに調べる

ArcGIS エキスパートのサポートを受ける

テクニカル サポートへのお問い合わせ

Esri Support アプリのダウンロード

ダウンロード オプションに移動