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

Commit

Permalink
Updating the way credentials are stored (#257)
Browse files Browse the repository at this point in the history
  • Loading branch information
Isaiah Williams authored Jan 11, 2020
1 parent f5db2a9 commit 090d93d
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/PowerShell/Commands/NewPartnerAccessToken.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ namespace Microsoft.Store.PartnerCenter.PowerShell.Commands
using System.Text;
using Extensions;
using Identity.Client;
using Microsoft.Azure.Management.Billing;
using Microsoft.Graph;
using Models.Authentication;
using Newtonsoft.Json.Linq;
using Utilities;
Expand Down Expand Up @@ -189,6 +191,19 @@ public override void ExecuteCmdlet()

Scopes = PowerShellModule.KnownModules[Module].Scopes.ToArray();
}
else if (ParameterSetName.Equals(RefreshTokenParameterSet, StringComparison.InvariantCultureIgnoreCase))
{
if (Credential != null)
{
account.ObjectId = Credential.UserName;
account.SetProperty(PartnerAccountPropertyType.ServicePrincipalSecret, Credential.Password.ConvertToString());
applicationId = Credential.UserName;
}
else
{
applicationId = ApplicationId;
}
}
else if (ParameterSetName.Equals(ServicePrincipalCertificateParameterSet, StringComparison.InvariantCultureIgnoreCase))
{
account.SetProperty(PartnerAccountPropertyType.ApplicationId, ApplicationId);
Expand Down

0 comments on commit 090d93d

Please sign in to comment.