title: Deserializing azure keyvault secret json to MicrosoftIdentityOptions
body: <p>I load the keyvault secrets when the app starts and the configuration has the vault secrets added
  <a href="https://i.stack.imgur.com/r4rIr.png" rel="nofollow noreferrer">as we can see here</a>.
  I am using the Microsoft.Identity.Web for adding the AD SSO and registers the AddSignin() as mentioned in the samples. But the secret is not getting serialized as expected <a href="https://i.stack.imgur.com/VgrNY.png" rel="nofollow noreferrer">at this point</a>. However if the secrets are kept in appsettings.json it works fine. How can I make this work? An explicit deserialization is required? </p>
  
  <p>Please find below the entire code setup</p>
  
  <p>1.Program.cs has the below code.</p>
  
  <pre><code>ConfigureAppConfiguration((hostingCtx, config) =&gt;
          {
  
              if (hostingCtx.HostingEnvironment.IsProduction())
              {
                  var builtConfig = config.Build();
                  AzureKeyVaultConfigurationExtensions.AddAzureKeyVault(config, builtConfig["AppConfiguration:KeyVaultUrl"]);
              }
          })
  </code></pre>
  
  <ol start="2">
  <li>The secret in the below json format is stored in keyvault</li>
  </ol>
  
  <pre><code>{"CallbackPath":"/home/index","ClientId":"######","ClientSecret":"#######","Domain":"######","Instance":"######","TenantId":"######"}
  </code></pre>
  
  <ol start="3">
  <li><p>Added a reference to Microsoft.Identity.Web </p></li>
  <li><p>Registered the below service in Startup.cs->ConfigureService</p></li>
  </ol>
  
  <pre><code>    services.AddAuthentication(sharedOptions =&gt;
                  {
                      sharedOptions.DefaultScheme = CookieAuthenticationDefaults.AuthenticationScheme;
                      sharedOptions.DefaultChallengeScheme = OpenIdConnectDefaults.AuthenticationScheme;
                  })
                  .AddSignIn("AzureAd1", configuration, options =&gt; configuration.Bind("AzureAd1", options));
  </code></pre>
  
  <ol start="5">
  <li>On application bootstrap the below variable <strong>microsoftIdentityOptions</strong>  is null</li>
  </ol>
  
  <p>File - WebAppServiceCollectionExtensions.cs</p>
  
  <pre><code>public static AuthenticationBuilder AddSignIn(
                  this AuthenticationBuilder builder,
                  string configSectionName,
                  IConfiguration configuration,
                  string openIdConnectScheme,
                  string cookieScheme,
                  Action&lt;OpenIdConnectOptions&gt; configureOptions,
                  bool subscribeToOpenIdConnectMiddlewareDiagnosticsEvents = false)
              {
                  builder.Services.Configure(openIdConnectScheme, configureOptions);
                  builder.Services.Configure&lt;MicrosoftIdentityOptions&gt;(options =&gt; configuration.Bind(configSectionName, options));
  
                  var microsoftIdentityOptions = configuration.GetSection(configSectionName).Get&lt;MicrosoftIdentityOptions&gt;();
       .......
       ......
      }
  </code></pre>
  
  <p>Any help deeply appreciated.</p>
  
  <p>Thank you</p>