| Bug-ID-Nummer |
BUG-000138488 |
| Eingereicht | March 25, 2021 |
| Zuletzt geändert | June 5, 2024 |
| Gilt für | ArcGIS Runtime SDK |
| Gefunden in Version | 100.10 |
| Betriebssystem | Windows OS |
| Betriebssystemversion | 10.0 64 Bit |
| Status | Non-Reproducible
Dieses Problem konnte bei Tests durch das Entwicklungsteam nicht reproduziert werden. Problemen wird u. U. dieser Status zugewiesen, wenn sie nicht reproduziert werden können oder in einer Entwicklungsversion der Software nicht mehr relevant sind. Es wurde jedoch kein Fix zur Problembehebung installiert. Weitere Erläuterungen finden Sie ggf. im Abschnitt "Zusätzliche Informationen" des jeweiligen Problems.
|
Zusätzliche Informationen
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.
Workaround
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
Schritte zur Reproduzierung