southworks / BotBuilder-Samples

Welcome to the BotBuilder samples repository. Here you will find task-focused samples in C# and Node.js to help you get started with the Bot Builder SDK!
https://github.com/Microsoft/BotBuilder
MIT License
6 stars 6 forks source link

[DotNet] Add details to README in certificate samples #421

Closed JhontSouth closed 4 months ago

JhontSouth commented 5 months ago

minor

Description

This PR adds more information to the README certificate samples to have an easier complete guide for SSL/TLS certificate configuration.

Proposed Changes

JhontSouth commented 5 months ago

Include az login step

sw-joelmut commented 5 months ago

I created https://github.com/southworks/BotBuilder-Samples/pull/429 to improve the readme, and merge it to this pr once approved

For SNI it also applies the same principles

JhontSouth commented 4 months ago

We should replace this https://github.com/southworks/BotBuilder-Samples/pull/421/files#diff-7dbeff6709649d9c6e9229f72bcdc4d92ab7e4b89670961266729f98010d7769R55-R58 with the CertificateServiceClientCredentialsFactory like the normal certificate sample, but sendX5c.

I guess that you are referring to this(the link doesn't work): services.AddSingleton( new CertificateServiceClientCredentialsFactory(certificate, _configuration["MicrosoftAppId"], _configuration["MicrosoftAppTenantId"], null, null, true));

Instead of:

        // MSAL certificate auth.
        services.AddSingleton(
            serviceProvider => ConfidentialClientApplicationBuilder.Create(_configuration["MicrosoftAppId"])
                .WithCertificate(certificate, sendX5C)
                .Build());

        // MSAL credential factory: regardless of secret, cert or custom auth, need to add the line below to enable MSAL.
        services.AddSingleton<ServiceClientCredentialsFactory, MsalServiceClientCredentialsFactory>();
sw-joelmut commented 4 months ago

Yes, also the image in the readme should be updated.

JhontSouth commented 4 months ago

services.AddSingleton( new CertificateServiceClientCredentialsFactory(certificate, _configuration["MicrosoftAppId"], _configuration["MicrosoftAppTenantId"], null, null, true));

solved

JhontSouth commented 4 months ago

Promoted /3995