Skip to content
This repository was archived by the owner on Jul 22, 2024. It is now read-only.

Commit 090d93d

Browse files
author
Isaiah Williams
authored
Updating the way credentials are stored (#257)
1 parent f5db2a9 commit 090d93d

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

src/PowerShell/Commands/NewPartnerAccessToken.cs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ namespace Microsoft.Store.PartnerCenter.PowerShell.Commands
1010
using System.Text;
1111
using Extensions;
1212
using Identity.Client;
13+
using Microsoft.Azure.Management.Billing;
14+
using Microsoft.Graph;
1315
using Models.Authentication;
1416
using Newtonsoft.Json.Linq;
1517
using Utilities;
@@ -189,6 +191,19 @@ public override void ExecuteCmdlet()
189191

190192
Scopes = PowerShellModule.KnownModules[Module].Scopes.ToArray();
191193
}
194+
else if (ParameterSetName.Equals(RefreshTokenParameterSet, StringComparison.InvariantCultureIgnoreCase))
195+
{
196+
if (Credential != null)
197+
{
198+
account.ObjectId = Credential.UserName;
199+
account.SetProperty(PartnerAccountPropertyType.ServicePrincipalSecret, Credential.Password.ConvertToString());
200+
applicationId = Credential.UserName;
201+
}
202+
else
203+
{
204+
applicationId = ApplicationId;
205+
}
206+
}
192207
else if (ParameterSetName.Equals(ServicePrincipalCertificateParameterSet, StringComparison.InvariantCultureIgnoreCase))
193208
{
194209
account.SetProperty(PartnerAccountPropertyType.ApplicationId, ApplicationId);

0 commit comments

Comments
 (0)