예제 #1
0
        public static IAuthenticationProvider GetAuthenticationProvider(IServiceProvider factory)
        {
            var config = (TodoCliConfiguration)factory.GetService(typeof(TodoCliConfiguration));

            IPublicClientApplication app = PublicClientApplicationBuilder
                                           .Create(config.ClientId)
                                           .WithRedirectUri("http://localhost")
                                           .Build();

            TokenCacheHelper.EnableSerialization(app.UserTokenCache);

            return(new InteractiveAuthenticationProvider(app, config.Scopes));
        }
예제 #2
0
        public static IAuthenticationProvider GetAuthenticationProvider(IServiceProvider factory)
        {
            var config = (TodoCliConfiguration)factory.GetService(typeof(TodoCliConfiguration));

            IPublicClientApplication app = PublicClientApplicationBuilder
                                           .Create(config.ClientId)
                                           .WithRedirectUri("http://localhost") // Only loopback redirect uri is supported, see https://aka.ms/msal-net-os-browser for details
                                           .Build();

            TokenCacheHelper.EnableSerialization(app.UserTokenCache);

            return(new InteractiveAuthenticationProvider(app, config.Scopes));
        }