From efad2b43d33af4b71df77de633010b762832c3d2 Mon Sep 17 00:00:00 2001 From: Ryan Newington Date: Tue, 31 Jan 2023 19:48:49 +1100 Subject: [PATCH 01/18] Set up CI with Azure Pipelines [skip ci] --- azure-pipelines.yml | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 azure-pipelines.yml diff --git a/azure-pipelines.yml b/azure-pipelines.yml new file mode 100644 index 0000000..7794d8f --- /dev/null +++ b/azure-pipelines.yml @@ -0,0 +1,38 @@ +pool: + vmImage: 'windows-latest' + +variables: + solution: '**/*.sln' + buildPlatform: 'Any CPU' + buildConfiguration: 'Release' + build.version.major: 1 + build.version.minor: 0 + build.version.revision: $[counter(format('{0}.{1}', variables['build.version.major'], variables['build.version.minor']), 1000)] + build.version: $(build.version.major).$(build.version.minor).$(build.version.revision).0 + build.versionShort: $(build.version.major).$(build.version.minor).$(build.version.revision) + build.date: $[format('{0:yyyy}-{0:MM}-{0:dd}T{0:HH}:{0:mm}:{0:ss}', pipeline.startTime)] + +steps: +- task: NuGetToolInstaller@1 + +- task: DotNetCoreCLI@2 + displayName: dotnet build + inputs: + command: build + publishWebProjects: false + arguments: '-c $(buildConfiguration) -p:Version=$(build.version)' + projects: '**/*.csproj' + zipAfterPublish: false + +- task: DotNetCoreCLI@2 + displayName: dotnet pack + inputs: + command: 'pack' + +- task: DotNetCoreCLI@2 + displayName: dotnet push + inputs: + command: 'push' + packagesToPush: '$(Build.ArtifactStagingDirectory)/*.nupkg' + nuGetFeedType: 'internal' + publishVstsFeed: '91a552bc-359d-4f28-bdbd-f36f71cfdf81' From b22254b3dc77b15dcdb06dd334a5906a9f730358 Mon Sep 17 00:00:00 2001 From: Ryan Newington Date: Wed, 1 Feb 2023 07:45:41 +1100 Subject: [PATCH 02/18] Update azure-pipelines.yml --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 7794d8f..11a39f2 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -21,7 +21,7 @@ steps: command: build publishWebProjects: false arguments: '-c $(buildConfiguration) -p:Version=$(build.version)' - projects: '**/*.csproj' + projects: 'src/Lithnet.CredentialProvider/Lithnet.CredentialProvider.csproj' zipAfterPublish: false - task: DotNetCoreCLI@2 From 6c46c3f69ebc4deda1cc37962f23bf3d62399304 Mon Sep 17 00:00:00 2001 From: Ryan Newington Date: Wed, 1 Feb 2023 08:08:33 +1100 Subject: [PATCH 03/18] Update README.md --- README.md | 174 +++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 172 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index bb33aec..4cfed04 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,172 @@ -# windows-credential-provider -A library for creating secure Windows Credential Providers in .NET +![](https://github.com/lithnet/miis-powershell/wiki/images/logo-ex-small.png) + +# Windows Credential Provider +A library for creating secure Windows Credential Providers in .NET, without the COM complications. + +The Lithnet Credential Provider for Windows provides an easy way to create a credential provider, without having to implement the COM components. The COM components are still there, but abstracted away into a fully managed implementation. + +## Getting started +* Create a new Class Library project. You can use .NET Framework 4.7.2 or higher, or you can use .NET Core 3.1 or higher) to create your provider +* Install the package from nuget `Install-Package Lithnet.CredentialProvider` +* Create a new class an inherit from `redentialProviderBase`, as shown below, replacing the `ProgId` and `Guid` values with ones of your own + +```cs +[ComVisible(true)] +[ClassInterface(ClassInterfaceType.None)] +[ProgId("MyCredentialProvider")] +[Guid("00000000-0000-0000-0000-000000000000")] +public class MyCredentialProvider : CredentialProviderBase +{ +} +``` + +* Override the `IsUsageScenarioSupported` method, to specify which scenarios you want to support with your credential provider + +```cs +public override bool IsUsageScenarioSupported(UsageScenario cpus, CredUIWinFlags dwFlags) +{ + switch (cpus) + { + case UsageScenario.Logon: + case UsageScenario.UnlockWorkstation: + case UsageScenario.CredUI: + case UsageScenario.ChangePassword: + return true; + + default: + return false; + } +} +``` + +* Override the `GetControls` method, and provide the controls to render your UI. You can conditionally render based on the current scenario +```cs +public override IEnumerable GetControls(UsageScenario cpus) +{ + yield return new TextboxControl("UsernameField", "Username"); + var password = new SecurePasswordTextboxControl("PasswordField", "Password"); + yield return password; + + if (cpus == UsageScenario.ChangePassword) + { + var confirmPassword = new SecurePasswordTextboxControl("ConfirmPasswordField", "Confirm password"); + yield return confirmPassword; + yield return new SubmitButtonControl("SubmitButton", "Submit", confirmPassword); + } + else + { + yield return new SubmitButtonControl("SubmitButton", "Submit", password); + } +} +``` + +* Windows will ask for the tiles to show. You can determine if you want to show a generic tile (that is, a tile not associated with a user), or a user-specific tile. Windows will provide the list of known users for you to create tiles for. +```cs +public override bool ShouldIncludeUserTile(CredentialProviderUser user) +{ + return true; +} + +public override bool ShouldIncludeGenericTile() +{ + return true; +} + +public override CredentialProviderCredential1Tile CreateGenericTile() +{ + return new MyTile(this); +} + +public override CredentialProviderCredential1Tile CreateUserTile(CredentialProviderUser user) +{ + return new MyTile(this, user); +} +``` + +* Create your tile class. Inherit from `CredentialProviderCredential2Tile` if you want to create personalized tiles supported by Windows 8 and later, or `CredentialProviderCredential1Tile` if you only want to implement a generic tile. Grab the instances of your controls in the `Initialize` method, so you can attach to their properties to read and respond to value changes. Finally, override the `GetCredentials` method, which is called when the user clicks the submit button. + +```cs +public class MyTile : CredentialProviderCredential2Tile +{ + private TextboxControl UsernameControl; + private SecurePasswordTextboxControl PasswordControl; + private SecurePasswordTextboxControl PasswordConfirmControl; + + public MyTile(CredentialProviderBase credentialProvider) : base(credentialProvider) + { + } + + public MyTile(CredentialProviderBase credentialProvider, CredentialProviderUser user) : base(credentialProvider, user) + { + } + + public string Username + { + get => UsernameControl.Text; + set => UsernameControl.Text = value; + } + + public SecureString Password + { + get => PasswordControl.Password; + set => PasswordControl.Password = value; + } + + public SecureString ConfirmPassword + { + get => PasswordConfirmControl.Password; + set => PasswordConfirmControl.Password = value; + } + + public override void Initialize() + { + if (UsageScenario == UsageScenario.ChangePassword) + { + this.PasswordConfirmControl = this.Controls.GetControl("ConfirmPasswordField"); + } + + this.PasswordControl = this.Controls.GetControl("PasswordField"); + this.UsernameControl = this.Controls.GetControl(C"UsernameField"); + + Username = this.User?.QualifiedUserName; + } + + protected override CredentialResponseBase GetCredentials() + { + string username; + string domain; + + if (Username.Contains("\\")) + { + domain = Username.Split('\\')[0]; + username = Username.Split('\\')[1]; + } + else + { + username = Username; + domain = Environment.MachineName; + } + + var spassword = Controls.GetControl(ControlKeys.Password).Password; + + return new CredentialResponseSecure() + { + IsSuccess = true, + Password = spassword, + Domain = domain, + Username = username + }; + } +} +``` + +## How can I contribute to the project? +* Found an issue and want us to fix it? [Log it](https://github.com/lithnet/windows-credential-provider/issues) +* Want to fix an issue yourself or add functionality? Clone the project and submit a pull request + +## Enteprise support +Enterprise support is not currently offered for this product. + +## Keep up to date +* [Visit our blog](http://blog.lithnet.io) +* [Follow us on twitter](https://twitter.com/lithnet_io)![](http://twitter.com/favicon.ico) From 2f3c6fb7244303e7e209bcbdc35e87c845893990 Mon Sep 17 00:00:00 2001 From: Ryan Newington Date: Wed, 1 Feb 2023 08:10:48 +1100 Subject: [PATCH 04/18] Update azure-pipelines.yml --- azure-pipelines.yml | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 11a39f2..3c4a805 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -7,7 +7,7 @@ variables: buildConfiguration: 'Release' build.version.major: 1 build.version.minor: 0 - build.version.revision: $[counter(format('{0}.{1}', variables['build.version.major'], variables['build.version.minor']), 1000)] + build.version.revision: $[counter(format('{0}.{1}', variables['build.version.major'], variables['build.version.minor']), 0)] build.version: $(build.version.major).$(build.version.minor).$(build.version.revision).0 build.versionShort: $(build.version.major).$(build.version.minor).$(build.version.revision) build.date: $[format('{0:yyyy}-{0:MM}-{0:dd}T{0:HH}:{0:mm}:{0:ss}', pipeline.startTime)] @@ -24,11 +24,6 @@ steps: projects: 'src/Lithnet.CredentialProvider/Lithnet.CredentialProvider.csproj' zipAfterPublish: false -- task: DotNetCoreCLI@2 - displayName: dotnet pack - inputs: - command: 'pack' - - task: DotNetCoreCLI@2 displayName: dotnet push inputs: From 0aaa303a8ea74a8330e3dc62adea80971c1b0880 Mon Sep 17 00:00:00 2001 From: Ryan Newington Date: Wed, 1 Feb 2023 08:20:10 +1100 Subject: [PATCH 05/18] Update azure-pipelines.yml --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 3c4a805..9706dc8 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -20,7 +20,7 @@ steps: inputs: command: build publishWebProjects: false - arguments: '-c $(buildConfiguration) -p:Version=$(build.version)' + arguments: '-c $(buildConfiguration) -p:Version=$(build.version) =p:PackageOutputPath=$(Build.ArtifactStagingDirectory)' projects: 'src/Lithnet.CredentialProvider/Lithnet.CredentialProvider.csproj' zipAfterPublish: false From 79dfba52abe81a0bb7cbefc7c79b335fb0b9a078 Mon Sep 17 00:00:00 2001 From: Ryan Newington Date: Wed, 1 Feb 2023 08:26:33 +1100 Subject: [PATCH 06/18] Update azure-pipelines.yml --- azure-pipelines.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 9706dc8..3cb3195 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -7,9 +7,10 @@ variables: buildConfiguration: 'Release' build.version.major: 1 build.version.minor: 0 - build.version.revision: $[counter(format('{0}.{1}', variables['build.version.major'], variables['build.version.minor']), 0)] - build.version: $(build.version.major).$(build.version.minor).$(build.version.revision).0 - build.versionShort: $(build.version.major).$(build.version.minor).$(build.version.revision) + build.version.revision: 0 + build.version.beta: $[counter(format('{0}.{1}.{2}', variables['build.version.major'], variables['build.version.minor'], variables['build.version.revision']), 0)] + build.version.suffix: .beta.1-$(build.version.revision) + build.version: $(build.version.major).$(build.version.minor).$(build.version.revision)$(build.version.suffix) build.date: $[format('{0:yyyy}-{0:MM}-{0:dd}T{0:HH}:{0:mm}:{0:ss}', pipeline.startTime)] steps: @@ -20,7 +21,7 @@ steps: inputs: command: build publishWebProjects: false - arguments: '-c $(buildConfiguration) -p:Version=$(build.version) =p:PackageOutputPath=$(Build.ArtifactStagingDirectory)' + arguments: '-c $(buildConfiguration) -p:Version=$(build.version) -p:PackageOutputPath=$(Build.ArtifactStagingDirectory)' projects: 'src/Lithnet.CredentialProvider/Lithnet.CredentialProvider.csproj' zipAfterPublish: false From d78ac963d4249814a6046a6e1d1d1cf95a3d4afe Mon Sep 17 00:00:00 2001 From: Ryan Newington Date: Wed, 1 Feb 2023 08:31:53 +1100 Subject: [PATCH 07/18] Update azure-pipelines.yml --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 3cb3195..2856e3a 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -9,7 +9,7 @@ variables: build.version.minor: 0 build.version.revision: 0 build.version.beta: $[counter(format('{0}.{1}.{2}', variables['build.version.major'], variables['build.version.minor'], variables['build.version.revision']), 0)] - build.version.suffix: .beta.1-$(build.version.revision) + build.version.suffix: -beta1.$(build.version.revision) build.version: $(build.version.major).$(build.version.minor).$(build.version.revision)$(build.version.suffix) build.date: $[format('{0:yyyy}-{0:MM}-{0:dd}T{0:HH}:{0:mm}:{0:ss}', pipeline.startTime)] From f66eb5b2b0a25c63a2bfe8462a65ae9671f32202 Mon Sep 17 00:00:00 2001 From: Ryan Newington Date: Wed, 1 Feb 2023 08:33:24 +1100 Subject: [PATCH 08/18] Update azure-pipelines.yml --- azure-pipelines.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 2856e3a..f78e67f 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -2,7 +2,6 @@ pool: vmImage: 'windows-latest' variables: - solution: '**/*.sln' buildPlatform: 'Any CPU' buildConfiguration: 'Release' build.version.major: 1 @@ -13,6 +12,8 @@ variables: build.version: $(build.version.major).$(build.version.minor).$(build.version.revision)$(build.version.suffix) build.date: $[format('{0:yyyy}-{0:MM}-{0:dd}T{0:HH}:{0:mm}:{0:ss}', pipeline.startTime)] +name: $(version) + steps: - task: NuGetToolInstaller@1 From 689339429b9c2191b3919299d6d6bd2370fc61a5 Mon Sep 17 00:00:00 2001 From: Ryan Newington Date: Wed, 1 Feb 2023 08:37:22 +1100 Subject: [PATCH 09/18] Update azure-pipelines.yml --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index f78e67f..52d1214 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -8,7 +8,7 @@ variables: build.version.minor: 0 build.version.revision: 0 build.version.beta: $[counter(format('{0}.{1}.{2}', variables['build.version.major'], variables['build.version.minor'], variables['build.version.revision']), 0)] - build.version.suffix: -beta1.$(build.version.revision) + build.version.suffix: -beta1.$(build.version.beta) build.version: $(build.version.major).$(build.version.minor).$(build.version.revision)$(build.version.suffix) build.date: $[format('{0:yyyy}-{0:MM}-{0:dd}T{0:HH}:{0:mm}:{0:ss}', pipeline.startTime)] From 8a350dd262295963ad9fcfbcfe7b1d15bd234c86 Mon Sep 17 00:00:00 2001 From: Ryan Newington Date: Wed, 1 Feb 2023 09:18:16 +1100 Subject: [PATCH 10/18] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 78 +++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 76 insertions(+), 2 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 52d1214..ba114b2 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -26,10 +26,84 @@ steps: projects: 'src/Lithnet.CredentialProvider/Lithnet.CredentialProvider.csproj' zipAfterPublish: false +- task: DotNetCoreCLI@2 + inputs: + command: 'custom' + custom: 'tool' + arguments: 'update --global NuGetKeyVaultSignTool' + displayName: Install NugetKeyVaultSignTool + +- task: DotNetCoreCLI@2 + inputs: + command: 'custom' + custom: 'tool' + arguments: 'update --global azuresigntool' + displayName: Install AzureSignTool + +- task: PowerShell@2 + displayName: 'Sign files with AzureSignTool' + inputs: + targetType: 'inline' + script: | + $files = @() + $files += (Get-ChildItem -Path "$(Build.ArtifactStagingDirectory)\Lithnet*.dll").FullName + + write-host "Signing $($files.Length) files:" + write-output $files + + $cmdargs = @( + "sign", + "-d", "Lithnet Windows Credential Provider", + "-kvu", "$(akv.url)", + "-kvi", "$(akv.applicationID)", + "-kvs", "$(akv.secret)", + "-kvt", "$(akv.tenantId)", + "-kvc", "$(akv.certificateName)", + "-tr", "http://timestamp.digicert.com", + "-td", "sha256" + ) + + $cmdargs += $files + + & AzureSignTool $cmdargs + + failOnStderr: true + showWarnings: true + +- task: PowerShell@2 + displayName: 'Sign Nuget package' + inputs: + targetType: 'inline' + script: | + $files = @() + $files += (Get-ChildItem -Path "$(Build.ArtifactStagingDirectory)\Lithnet*.dll").FullName + + write-host "Signing $($files.Length) files:" + write-output $files + + $cmdargs = @( + "sign", "$(Build.ArtifactStagingDirectory)\*.nupkg)" + "-fd", "sha256", + "-kvu", "$(akv.url)", + "-kvi", "$(akv.applicationID)", + "-kvs", "$(akv.secret)", + "-kvt", "$(akv.tenantId)", + "-kvc", "$(akv.certificateName)", + "-tr", "http://timestamp.digicert.com", + "-td", "sha256" + ) + + $cmdargs += $files + + & NuGetKeyVaultSignTool $cmdargs + + failOnStderr: true + showWarnings: true + - task: DotNetCoreCLI@2 displayName: dotnet push inputs: command: 'push' packagesToPush: '$(Build.ArtifactStagingDirectory)/*.nupkg' - nuGetFeedType: 'internal' - publishVstsFeed: '91a552bc-359d-4f28-bdbd-f36f71cfdf81' + nuGetFeedType: 'external' + publishFeedCredentials: 'WindowsCredentialProviderNuget' From b3abf0468dd39f84263c001781600835b711f09a Mon Sep 17 00:00:00 2001 From: Ryan Newington Date: Wed, 1 Feb 2023 09:22:08 +1100 Subject: [PATCH 11/18] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 30 ++++++++++++++++++++---------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index ba114b2..bf48729 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -2,17 +2,27 @@ pool: vmImage: 'windows-latest' variables: - buildPlatform: 'Any CPU' - buildConfiguration: 'Release' - build.version.major: 1 - build.version.minor: 0 - build.version.revision: 0 - build.version.beta: $[counter(format('{0}.{1}.{2}', variables['build.version.major'], variables['build.version.minor'], variables['build.version.revision']), 0)] - build.version.suffix: -beta1.$(build.version.beta) - build.version: $(build.version.major).$(build.version.minor).$(build.version.revision)$(build.version.suffix) - build.date: $[format('{0:yyyy}-{0:MM}-{0:dd}T{0:HH}:{0:mm}:{0:ss}', pipeline.startTime)] + - name: buildPlatform + value: 'Any CPU' + - name: buildConfiguration + value: 'Release' + - name: build.version.major + value: 1 + - name: build.version.minor + value: 0 + - name: build.version.revision + value: 0 + - name: build.version.beta + value: $[counter(format('{0}.{1}.{2}', variables['build.version.major'], variables['build.version.minor'], variables['build.version.revision']), 0)] + - name: build.version.suffix + value: -beta1.$(build.version.beta) + - name: build.version + value: $(build.version.major).$(build.version.minor).$(build.version.revision)$(build.version.suffix) + - name: build.date + value: $[format('{0:yyyy}-{0:MM}-{0:dd}T{0:HH}:{0:mm}:{0:ss}', pipeline.startTime)] + - group: Azure KeyVault Code Signing -name: $(version) +name: $(build.version) steps: - task: NuGetToolInstaller@1 From abdb4aafb9c5e74a9faa303c9e88405dc3c1a3b0 Mon Sep 17 00:00:00 2001 From: Ryan Newington Date: Wed, 1 Feb 2023 09:30:58 +1100 Subject: [PATCH 12/18] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index bf48729..33580d5 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -22,7 +22,7 @@ variables: value: $[format('{0:yyyy}-{0:MM}-{0:dd}T{0:HH}:{0:mm}:{0:ss}', pipeline.startTime)] - group: Azure KeyVault Code Signing -name: $(build.version) +name: $(build.version.major).$(build.version.minor).$(build.version.revision)$(build.version.suffix) steps: - task: NuGetToolInstaller@1 From 14c782be0450e41c9d0ee487cb302a99a4305f2e Mon Sep 17 00:00:00 2001 From: Ryan Newington Date: Wed, 1 Feb 2023 09:36:54 +1100 Subject: [PATCH 13/18] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 33580d5..8c59091 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -56,7 +56,7 @@ steps: targetType: 'inline' script: | $files = @() - $files += (Get-ChildItem -Path "$(Build.ArtifactStagingDirectory)\Lithnet*.dll").FullName + $files += (Get-ChildItem -Recurse -Path "$(Build.ArtifactStagingDirectory)\Lithnet*.dll").FullName write-host "Signing $($files.Length) files:" write-output $files From 6d6e9eb40915302da7a409b2c63984d0ab6cd930 Mon Sep 17 00:00:00 2001 From: Ryan Newington Date: Wed, 1 Feb 2023 09:48:34 +1100 Subject: [PATCH 14/18] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 8c59091..4a63e84 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -56,7 +56,7 @@ steps: targetType: 'inline' script: | $files = @() - $files += (Get-ChildItem -Recurse -Path "$(Build.ArtifactStagingDirectory)\Lithnet*.dll").FullName + $files += (Get-ChildItem -Recurse -Path "$(Build.SourcesDirectory)\Lithnet*.dll").FullName write-host "Signing $($files.Length) files:" write-output $files @@ -85,12 +85,6 @@ steps: inputs: targetType: 'inline' script: | - $files = @() - $files += (Get-ChildItem -Path "$(Build.ArtifactStagingDirectory)\Lithnet*.dll").FullName - - write-host "Signing $($files.Length) files:" - write-output $files - $cmdargs = @( "sign", "$(Build.ArtifactStagingDirectory)\*.nupkg)" "-fd", "sha256", From 96e20c86e7a3822371e52cb948319769518ab9cf Mon Sep 17 00:00:00 2001 From: Ryan Newington Date: Wed, 1 Feb 2023 09:55:10 +1100 Subject: [PATCH 15/18] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 4a63e84..49846ff 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -104,10 +104,9 @@ steps: failOnStderr: true showWarnings: true -- task: DotNetCoreCLI@2 - displayName: dotnet push +- task: NuGetCommand@2 + displayName: 'NuGet push' inputs: - command: 'push' - packagesToPush: '$(Build.ArtifactStagingDirectory)/*.nupkg' - nuGetFeedType: 'external' - publishFeedCredentials: 'WindowsCredentialProviderNuget' + command: push + nuGetFeedType: external + publishFeedCredentials: 'WindowsCredentialProviderNuget' \ No newline at end of file From 49cc6178fef1ae5c5378a40356a3b357cc21b479 Mon Sep 17 00:00:00 2001 From: Ryan Newington Date: Wed, 1 Feb 2023 10:12:16 +1100 Subject: [PATCH 16/18] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 49846ff..e004d68 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -96,8 +96,6 @@ steps: "-tr", "http://timestamp.digicert.com", "-td", "sha256" ) - - $cmdargs += $files & NuGetKeyVaultSignTool $cmdargs From 1a44905f424178d0af0aab74609f92864324a271 Mon Sep 17 00:00:00 2001 From: Ryan Newington Date: Wed, 1 Feb 2023 10:23:06 +1100 Subject: [PATCH 17/18] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index e004d68..a1f51ba 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -86,7 +86,7 @@ steps: targetType: 'inline' script: | $cmdargs = @( - "sign", "$(Build.ArtifactStagingDirectory)\*.nupkg)" + "sign", "$(Build.ArtifactStagingDirectory)\Lithnet.CredentialProvider.$(build.version).nupkg)" "-fd", "sha256", "-kvu", "$(akv.url)", "-kvi", "$(akv.applicationID)", From 6cc4023ac6a4055286348ed65caebb5c2d5be41b Mon Sep 17 00:00:00 2001 From: Ryan Newington Date: Wed, 1 Feb 2023 10:39:29 +1100 Subject: [PATCH 18/18] Update azure-pipelines.yml for Azure Pipelines --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index a1f51ba..5967947 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -86,7 +86,7 @@ steps: targetType: 'inline' script: | $cmdargs = @( - "sign", "$(Build.ArtifactStagingDirectory)\Lithnet.CredentialProvider.$(build.version).nupkg)" + "sign", "$(Build.ArtifactStagingDirectory)\Lithnet.CredentialProvider.$(build.version).nupkg" "-fd", "sha256", "-kvu", "$(akv.url)", "-kvi", "$(akv.applicationID)",