0

We are using API key to call custom API from B2C custom policy as part of seamless migration. We are looking for automated way to rotate policy key.

I have tried following C# code using graph client and its updating new key but wanted to know if there is PS command to perform similar kind of operation?

C# code:

var result = graphClient.TrustFramework.KeySets["B2C_1A_keyset"]
                .UploadSecret(use, k, nbf, exp)
                .Request()
                .PostAsync().Result;

            if (result != null)
                Console.WriteLine("Updated policy key secret");
Vikas
  • 25
  • 4

1 Answers1

0

Follow this guidance on best practices Policy key management with Azure AD B2C.

Use any sample that does REST API calls via C# and follow these two docs to call the correct Microsoft Graph endpoint:

Chad Hasbrook
  • 206
  • 1
  • 6
  • Thanks for links I think we can call these rest endpoints from PS and use it in automated process. – Vikas Nov 19 '20 at 18:17