'PDKPR008E Attribute name [xyz] does not exist' error when retrieving password using .NET SDK

'PDKPR008E Attribute name [xyz] does not exist' error when retrieving password using .NET SDK

102
Created On 11/10/26 11:01 AM - Last Modified 11/10/26 15:54 PM


Symptom


The following error is consistently thrown when running the .NET SDK sample code:

CyberArk.AAM.NetStandardPasswordSDK.Exceptions.PSDKException: 'PDKPR008E Attribute name [xyz] does not exist'


Environment


11.1;11;11.2;11.3;11.4;11.5;11.6;11.7;12.0;12.1;12.2;11.9;11.8;12.4;12.3;12.5;12.6 Privileged Access Manager (PAM, self-hosted) Credential Provider Windows or Linux operating system
Credential Provider NET Standard SDK
.NET runtime: .NET 5, .NET 6, .NET 7
Thai language set as Windows Display Language or language of the thread set as Thai.


Cause


The problem can be reproduced in a Windows and Linux machines when thread locale is set to Thai. For Windows it is typical when Display Language is set as Thai.

If Windows language is not Thai but thread set locale to “th-TH” using Thread.CurrentThread.CurrentCulture the issue is also visible.

Please note that for the other non-Latin scripts the problem is not visible, for example Credential Provider works properly with ja-JP (Japan), zh-CN (China), km-KH (Kambodia), ar-SA (Arabic) and others.

The issue can be reproduced only when using .NET 5, .NET 6 and .NET 7.
For .NET 3.1, NetFramework 4.7.2 and NetFramework 4.8.0 everything is ok.

The root cause of the problem is change of globalisation API from NLS to ICU starting from .NET 5 (Windows 10 May 2019 Update). ICU is not fully backward compatible with NLS.
https://learn.microsoft.com/en-us/dotnet/core/compatibility/globalization/5.0/icu-globalization-api



Resolution


There are two solution for the issue:

  1. Change the Windows Display Language to different language than Thai, e.g. English US.
  2. Change locale of the thread before setting attributes (and optionally change it back to original locale).
  3. Switch back to NLS API

Solution #2

CultureInfo en = new CultureInfo("en-US", false);
CultureInfo ci = Thread.CurrentThread.CurrentCulture;
 
PSDKPasswordRequest passRequest = new PSDKPasswordRequest();
Thread.CurrentThread.CurrentCulture = en; //set to english
passRequest.AppID = "appid";
passRequest.Reason = "reason";
Thread.CurrentThread.CurrentCulture = ci; //back to current language


Modification of Assembly Neutral Language does not resolve the issue.

Solution #3

It is possible to use run-time switch to force use of NLS (which does not cause problems) from ICU APIs.

Set true  to use NLS and solve the issue.

 Setting nameValuesIntroduced
runtimeconfig.jsonSystem.Globalization.UseNlsfalse - Use ICU globalization APIs
true - Use NLS globalization APIs
.NET 5
Environment variableDOTNET_SYSTEM_GLOBALIZATION_USENLSfalse - Use ICU globalization APIs
true - Use NLS globalization APIs
.NET 5

See more on that on Microsoft documentation:



Actions
  • Print
  • Copy Link

    https://knowledgebase.paloaltonetworks.com/KCSArticleDetail?id=kA1hj0000000tZHCAY&lang=en_US&refURL=http%3A%2F%2Fknowledgebase.paloaltonetworks.com%2FKCSArticleDetail