This repository was archived by the owner on Jun 30, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed
lib/csharp/microsoft.bot.builder.skills/Microsoft.Bot.Builder.Skills/Auth Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change 1+ using System . Collections . Generic ;
2+ using Microsoft . Extensions . Configuration ;
3+
4+ namespace Microsoft . Bot . Builder . Skills . Auth
5+ {
6+ /// <summary>
7+ /// Loads the apps whitelist from settings.
8+ /// </summary>
9+ public class WhitelistAuthenticationProvider : IWhitelistAuthenticationProvider
10+ {
11+ public WhitelistAuthenticationProvider ( IConfiguration configuration , string whitelistProperty = "skillAuthenticationWhitelist" )
12+ {
13+ // skillAuthenticationWhitelist is the setting in appsettings.json file
14+ // that conists of the list of parent bot ids that are allowed to access the skill
15+ // to add a new parent bot simply go to the skillAuthenticationWhitelist and add
16+ // the parent bot's microsoft app id to the list
17+ var section = configuration . GetSection ( whitelistProperty ) ;
18+ var appsList = section . Get < string [ ] > ( ) ;
19+ AppsWhitelist = appsList != null ? new HashSet < string > ( appsList ) : null ;
20+ }
21+
22+ public HashSet < string > AppsWhitelist { get ; }
23+ }
24+ }
You can’t perform that action at this time.
0 commit comments