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

After connect COSMOS DB, AuthBot is not working C# #49

@xiaolangxyz

Description

@xiaolangxyz

I'm trying to connect COSMOS DB. It works. But after that, Auth bot is not working. It keeps telling me "Please click to sign in". When I click, I can get the number which is used to paste it back to my chat to complete the authentication.
This is my code.

protected void Application_Start()
{

       GlobalConfiguration.Configure(WebApiConfig.Register);
       
       AuthBot.Models.AuthSettings.Mode = ConfigurationManager.AppSettings["ActiveDirectory.Mode"];
       AuthBot.Models.AuthSettings.EndpointUrl = ConfigurationManager.AppSettings["ActiveDirectory.EndpointUrl"];
       AuthBot.Models.AuthSettings.Tenant = ConfigurationManager.AppSettings["ActiveDirectory.Tenant"];
       AuthBot.Models.AuthSettings.RedirectUrl = ConfigurationManager.AppSettings["ActiveDirectory.RedirectUrl"];
       AuthBot.Models.AuthSettings.ClientId = ConfigurationManager.AppSettings["ActiveDirectory.ClientId"];
       AuthBot.Models.AuthSettings.ClientSecret = ConfigurationManager.AppSettings["ActiveDirectory.ClientSecret"];

        //CosmosDB
       var uri = new Uri(ConfigurationManager.AppSettings["DocumentDbUrl"]);
       var key = ConfigurationManager.AppSettings["DocumentDbKey"];
       var store = new DocumentDbBotDataStore(uri, key);
       
       Conversation.UpdateContainer(
                   builder =>
                   {
                       builder.Register(c => store)
                           .Keyed<IBotDataStore<BotData>>(AzureModule.Key_DataStore)
                           .AsSelf()
                           .SingleInstance();
       
                       builder.Register(c => new CachingBotDataStore(store, CachingBotDataStoreConsistencyPolicy.ETagBasedConsistency))
                           .As<IBotDataStore<BotData>>()
                           .AsSelf()
                           .InstancePerLifetimeScope();
       
                   });

    }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions