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 支持应用程序

发现关于本主题的更多内容

获取来自 ArcGIS 专家的帮助

联系技术支持部门

下载 Esri 支持应用程序

转至下载选项