You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Building POS Samples fails when signing the MPOS MSIX due to error "Export-PfxCertificate : Using ProtectTo parameter requires running as a domain account."
#93
Closed
lukedgr opened this issue
Nov 10, 2021
· 2 comments
Attempting to build the POS sample fails during MPOS app package signing when running as a user that is not attached to a domain and a signing cert does not already exist. See error and screenshot below.
Error Message:
"Export-PfxCertificate : Using ProtectTo parameter requires running as a domain account."
Screenshot:
The text was updated successfully, but these errors were encountered:
This issue is due to a known limitation with the powershell APIs for creating a signing certificate. If the user is not signed in using a domain account we're not able to automatically generate the signing certificate for the MPOS solution due to a limitation with the Export-PfxCertificate powershell command and the ProtectTo option. To resolve this issue please follow these steps below to create a test certificate and for more details on app signing please refer to this article.
Follow the steps in this article to create a test certificate for package signing.
Note: The publisherName for the certificate should match the "PackagePublisher" specified in the solution's CustomizationPackage.props file.
Copy the created certificate to the ModernPOS project folder
Update the ModernPos packaging project (jsproj) to reference the new test certificate by updating the "PackageCertificateKeyFile"
For future reference, the PFX file used to sign the ModernPOS package cannot be password-protected. To create PFX without a password the following commands can be used:
When exporting directly from the store using the thumbprint: (reference)
Export-PfxCertificate -cert "Cert:\CurrentUser\My<Certificate Thumbprint>" -FilePath .pfx -Password (new-object System.Security.SecureString)
The command must be run from a PowerShell command prompt.
When exporting from .cer and .pvk files:
Pvk2Pfx /pvk .pvk /pi /spc .cer /pfx .pfx /po ""
If the private key doesn't have a password /pi and /po can be omitted.
madyke
transferred this issue from microsoft/Dynamics365Commerce.InStore
May 22, 2023
Attempting to build the POS sample fails during MPOS app package signing when running as a user that is not attached to a domain and a signing cert does not already exist. See error and screenshot below.
Error Message:
"Export-PfxCertificate : Using ProtectTo parameter requires running as a domain account."
Screenshot:
The text was updated successfully, but these errors were encountered: