Example #1
0
 // This method gets called by the runtime. Use this method to add services to the container.
 public void ConfigureServices(IServiceCollection services)
 {
     services.AddAuthentication(AzureADB2CDefaults.AuthenticationScheme)
     .AddAzureADB2C(options => Configuration.Bind("AzureAdB2C", options));
     services.AddRazorPages();
     AzureADB2COptions options = new AzureADB2COptions();
 }
Example #2
0
        // This method gets called by the runtime. Use this method to add services to the container.
        public void ConfigureServices(IServiceCollection services)
        {
            AzureADB2COptions options = new AzureADB2COptions();

            Configuration.Bind("AzureAdB2C", options);

            JwtSecurityTokenHandler.DefaultInboundClaimTypeMap.Clear();

            services.AddAuthentication(Constants.SignInSignUpPolicy)
            .AddJwtBearer(Constants.SignInSignUpPolicy, GetJwtBearerOptions(options, Constants.SignInSignUpPolicy))
            .AddJwtBearer(Constants.EditProfilePolicy, GetJwtBearerOptions(options, Constants.EditProfilePolicy));
            services.AddAuthorization(options =>
            {
                options.AddPolicy(Constants.UserReadScope, o =>
                {
                    o.Requirements.Add(new ReadAccessRequirement());
                });
                options.AddPolicy(Constants.UserWriteScope, o =>
                {
                    o.Requirements.Add(new WriteAccessRequirement());
                });
            });
            services.AddTransient <IAuthorizationHandler, ReadAccessScopeHandler>();
            services.AddTransient <IAuthorizationHandler, WriteAccessScopeHandler>();
            services.AddControllers();
        }
Example #3
0
    internal static string BuildAuthority(AzureADB2COptions AzureADB2COptions)
    {
        var baseUri  = new Uri(AzureADB2COptions.Instance);
        var pathBase = baseUri.PathAndQuery.TrimEnd('/');
        var domain   = AzureADB2COptions.Domain;
        var policy   = AzureADB2COptions.DefaultPolicy;

        return(new Uri(baseUri, new PathString($"{pathBase}/{domain}/{policy}/v2.0")).ToString());
    }
Example #4
0
 public Action <JwtBearerOptions> GetJwtBearerOptions(AzureADB2COptions options, string policy)
 {
     return((o) =>
     {
         o.Authority = string.Format(options.Authority, policy);
         o.Audience = options.ClientId;
         o.SaveToken = true;
     });
 }
Example #5
0
    public GraphAPIService(IOptions <AzureADB2COptions> options)
    {
        ClientSecretCredential clientSecretCredential = new ClientSecretCredential(
            options.Value.TenantId, options.Value.ClientId, options.Value.ClientSecret);


        _graphServiceClient = new GraphServiceClient(clientSecretCredential);

        _options = options.Value;
    }
    public async Task SignOutNoScheme_SignsOutDefaultCookiesAndDefaultOpenIDConnectAADAzureADB2CSchemesAsync()
    {
        // Arrange
        var options = new AzureADB2COptions()
        {
            CookieSchemeName        = AzureADB2CDefaults.CookieScheme,
            OpenIdConnectSchemeName = AzureADB2CDefaults.OpenIdScheme
        };

        var controllerContext = CreateControllerContext(
            CreateAuthenticatedPrincipal(AzureADB2CDefaults.AuthenticationScheme));

        var descriptor = new PageActionDescriptor()
        {
            AttributeRouteInfo = new AttributeRouteInfo()
            {
                Template = "/Account/SignedOut"
            }
        };
        var controller = new AccountController(new OptionsMonitor(AzureADB2CDefaults.AuthenticationScheme, options))
        {
            Url = new TestUrlHelper(
                controllerContext.HttpContext,
                new RouteData(),
                descriptor,
                "/Account/SignedOut",
                "https://localhost/Account/SignedOut"),
            ControllerContext = new ControllerContext()
            {
                HttpContext = controllerContext.HttpContext
            }
        };

        controller.Request.Scheme = "https";

        // Act
        var result = await controller.SignOut(null);

        // Assert
        var signOut = Assert.IsAssignableFrom <SignOutResult>(result);

        Assert.Equal(new[] { AzureADB2CDefaults.CookieScheme, AzureADB2CDefaults.OpenIdScheme }, signOut.AuthenticationSchemes);
        Assert.NotNull(signOut.Properties.RedirectUri);
        Assert.Equal("https://localhost/Account/SignedOut", signOut.Properties.RedirectUri);
    }
Example #7
0
        public async Task <ActionResult> Logout()
        {
            string scheme = AzureADB2CDefaults.AuthenticationScheme;

            var authenticated = await HttpContext.AuthenticateAsync(scheme);

            if (authenticated.Succeeded)
            {
                // return Challenge(scheme);
                var options = new AzureADB2COptions();
                //http://localhost:24354
                var callbackUrl = "http://localhost:24354/Index";
                // var callbackUrl = Url.Page("/", pageHandler: null, values: null, protocol: Request.Scheme);
                return(SignOut(new AuthenticationProperties {
                    RedirectUri = callbackUrl
                }, scheme));
            }
            return(RedirectToPage("/Index"));
        }
        public async Task <ActionResult> OnGet()
        {
            string scheme        = AzureADB2CDefaults.AuthenticationScheme;
            var    authenticated = await HttpContext.AuthenticateAsync(scheme);

            if (!authenticated.Succeeded)
            {
                return(Challenge(scheme));
            }

            var options = new AzureADB2COptions();

            var callbackUrl = Url.Page("/Index", pageHandler: null, values: null, protocol: Request.Scheme);
            var result      = SignOut(new AuthenticationProperties {
                RedirectUri = callbackUrl
            }, scheme);

            return(RedirectToPage("Index"));
        }
Example #9
0
        private void AddRole_B2c(IServiceCollection services, AzureADB2COptions azureADB2COptions)
        {
            services.Configure <OpenIdConnectOptions>(AzureADB2CDefaults.OpenIdScheme, (OpenIdConnectOptions options) =>
            {
                options.Events.OnTokenValidated = async context =>
                {
                    var userId         = context.Principal.FindFirst(ClaimTypes.NameIdentifier).Value;
                    var claimsIdentity = (ClaimsIdentity)context.Principal.Identity;

                    string requestUrl = $"https://graph.microsoft.com/v1.0/users/{userId}/memberOf?$select=displayName";
                    var resObject     = await ApiHelper.getApiASync(requestUrl);
                    var jo_groups     = resObject["value"] as JArray;

                    foreach (var item in jo_groups)
                    {
                        var groupName = (string)item["displayName"];
                        claimsIdentity.AddClaim(new Claim(type: ClaimTypes.Role, value: groupName));
                    }
                };
            });
        }
        // This method gets called by the runtime. Use this method to add services to the container.
        public void ConfigureServices(IServiceCollection services)
        {
            // Setting this to true will show more detailed error information in certain situations. Leave this as false in production environments.
            IdentityModelEventSource.ShowPII = true;

            services.AddAuthentication(AzureADB2CDefaults.AuthenticationScheme)
            .AddAzureADB2C(options => {
                this.Configuration.Bind("AzureAdB2C", options);
            })
            .AddOpenIdConnect("o365", options =>
            {
                AzureADB2COptions b2cOptions = new AzureADB2COptions();
                this.Configuration.Bind("AzureAdB2C", b2cOptions);

                var tenantName       = b2cOptions.Domain.Substring(0, b2cOptions.Domain.IndexOf('.'));
                options.Authority    = $"https://{tenantName}.b2clogin.com/tfp/{b2cOptions.Domain}/{b2cOptions.SignUpSignInPolicyId}-o365/v2.0";
                options.ClientId     = b2cOptions.ClientId;
                options.CallbackPath = b2cOptions.CallbackPath + "-o365";
                options.TokenValidationParameters.NameClaimType = "name";
            })
            ;
            services.AddRazorPages();
        }
Example #11
0
 public AzureADB2COpenIDConnectEventHandlers(string schemeName, AzureADB2COptions options)
 {
     SchemeName = schemeName;
     Options    = options;
 }
Example #12
0
        #pragma warning disable 1998
        public async override global::System.Threading.Tasks.Task ExecuteAsync()
        {
            BeginContext(191, 2, true);
            WriteLiteral("\r\n");
            EndContext();
#line 6 "C:\Users\GermanB\source\repos\SapiaHome\SapiaHome\Views\Shared\_LoginPartial.cshtml"

            var options = AzureADB2COptions.Get(AzureADB2CDefaults.AuthenticationScheme);

#line default
#line hidden
            BeginContext(283, 4, true);
            WriteLiteral("\r\n\r\n");
            EndContext();
#line 11 "C:\Users\GermanB\source\repos\SapiaHome\SapiaHome\Views\Shared\_LoginPartial.cshtml"
            if (User.Identity.IsAuthenticated)
            {
#line default
#line hidden
                BeginContext(327, 46, true);
                WriteLiteral("    <ul class=\"nav navbar-nav navbar-right\">\r\n");
                EndContext();
#line 14 "C:\Users\GermanB\source\repos\SapiaHome\SapiaHome\Views\Shared\_LoginPartial.cshtml"
                if (!string.IsNullOrEmpty(options.EditProfilePolicyId))
                {
#line default
#line hidden
                    BeginContext(450, 16, true);
                    WriteLiteral("            <li>");
                    EndContext();
                    BeginContext(466, 105, false);
                    __tagHelperExecutionContext = __tagHelperScopeManager.Begin("a", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "829879f5ddfe41128bbfe295ad72e0ce", async() => {
                        BeginContext(541, 6, true);
                        WriteLiteral("Hello ");
                        EndContext();
                        BeginContext(548, 18, false);
#line 16 "C:\Users\GermanB\source\repos\SapiaHome\SapiaHome\Views\Shared\_LoginPartial.cshtml"
                        Write(User.Identity.Name);

#line default
#line hidden
                        EndContext();
                        BeginContext(566, 1, true);
                        WriteLiteral("!");
                        EndContext();
                    }
                                                                                );
                    __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper = CreateTagHelper <global::Microsoft.AspNetCore.Mvc.TagHelpers.AnchorTagHelper>();
                    __tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper);
                    __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper.Area = (string)__tagHelperAttribute_0.Value;
                    __tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_0);
                    __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper.Controller = (string)__tagHelperAttribute_1.Value;
                    __tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_1);
                    __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper.Action = (string)__tagHelperAttribute_2.Value;
                    __tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_2);
                    await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);

                    if (!__tagHelperExecutionContext.Output.IsContentModified)
                    {
                        await __tagHelperExecutionContext.SetOutputContentAsync();
                    }
                    Write(__tagHelperExecutionContext.Output);
                    __tagHelperExecutionContext = __tagHelperScopeManager.End();
                    EndContext();
                    BeginContext(571, 7, true);
                    WriteLiteral("</li>\r\n");
                    EndContext();
#line 17 "C:\Users\GermanB\source\repos\SapiaHome\SapiaHome\Views\Shared\_LoginPartial.cshtml"
                }
                else
                {
#line default
#line hidden
                    BeginContext(614, 42, true);
                    WriteLiteral("            <li class=\"navbar-text\">Hello ");
                    EndContext();
                    BeginContext(657, 18, false);
#line 20 "C:\Users\GermanB\source\repos\SapiaHome\SapiaHome\Views\Shared\_LoginPartial.cshtml"
                    Write(User.Identity.Name);

#line default
#line hidden
                    EndContext();
                    BeginContext(675, 8, true);
                    WriteLiteral("!</li>\r\n");
                    EndContext();
#line 21 "C:\Users\GermanB\source\repos\SapiaHome\SapiaHome\Views\Shared\_LoginPartial.cshtml"
                }

#line default
#line hidden
                BeginContext(694, 12, true);
                WriteLiteral("        <li>");
                EndContext();
                BeginContext(706, 83, false);
                __tagHelperExecutionContext = __tagHelperScopeManager.Begin("a", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "1785670c55704307b51c0622c1b621bb", async() => {
                    BeginContext(777, 8, true);
                    WriteLiteral("Sign out");
                    EndContext();
                }
                                                                            );
                __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper = CreateTagHelper <global::Microsoft.AspNetCore.Mvc.TagHelpers.AnchorTagHelper>();
                __tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper);
                __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper.Area = (string)__tagHelperAttribute_0.Value;
                __tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_0);
                __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper.Controller = (string)__tagHelperAttribute_1.Value;
                __tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_1);
                __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper.Action = (string)__tagHelperAttribute_3.Value;
                __tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_3);
                await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);

                if (!__tagHelperExecutionContext.Output.IsContentModified)
                {
                    await __tagHelperExecutionContext.SetOutputContentAsync();
                }
                Write(__tagHelperExecutionContext.Output);
                __tagHelperExecutionContext = __tagHelperScopeManager.End();
                EndContext();
                BeginContext(789, 18, true);
                WriteLiteral("</li>\r\n    </ul>\r\n");
                EndContext();
#line 24 "C:\Users\GermanB\source\repos\SapiaHome\SapiaHome\Views\Shared\_LoginPartial.cshtml"
            }
            else
            {
#line default
#line hidden
                BeginContext(819, 58, true);
                WriteLiteral("    <ul class=\"nav navbar-nav navbar-right\">\r\n        <li>");
                EndContext();
                BeginContext(877, 81, false);
                __tagHelperExecutionContext = __tagHelperScopeManager.Begin("a", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "24dff39893f94b06b47cb51590b04302", async() => {
                    BeginContext(947, 7, true);
                    WriteLiteral("Sign in");
                    EndContext();
                }
                                                                            );
                __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper = CreateTagHelper <global::Microsoft.AspNetCore.Mvc.TagHelpers.AnchorTagHelper>();
                __tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper);
                __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper.Area = (string)__tagHelperAttribute_0.Value;
                __tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_0);
                __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper.Controller = (string)__tagHelperAttribute_1.Value;
                __tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_1);
                __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper.Action = (string)__tagHelperAttribute_4.Value;
                __tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_4);
                await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);

                if (!__tagHelperExecutionContext.Output.IsContentModified)
                {
                    await __tagHelperExecutionContext.SetOutputContentAsync();
                }
                Write(__tagHelperExecutionContext.Output);
                __tagHelperExecutionContext = __tagHelperScopeManager.End();
                EndContext();
                BeginContext(958, 18, true);
                WriteLiteral("</li>\r\n    </ul>\r\n");
                EndContext();
#line 30 "C:\Users\GermanB\source\repos\SapiaHome\SapiaHome\Views\Shared\_LoginPartial.cshtml"
            }

#line default
#line hidden
        }
Example #13
0
 public AuthController(IOptions <AzureADB2COptions> b2cOptions, IOptions <AzureAdB2cAuth> auth)
 {
     azureAdB2COptions = b2cOptions.Value;
     azureAdB2cAuth    = auth.Value;
 }
        #pragma warning disable 1998
        public async override global::System.Threading.Tasks.Task ExecuteAsync()
        {
            BeginContext(157, 2, true);
            WriteLiteral("\r\n");
            EndContext();
#line 5 "C:\Projects\AspCoreTestProjects\ExerciseTrainingApp\TrainingAppAspCore\Pages\Shared\_LoginPartial.cshtml"

            var options = AzureADB2COptions.Get(AzureADB2CDefaults.AuthenticationScheme);

#line default
#line hidden
            BeginContext(249, 4, true);
            WriteLiteral("\r\n\r\n");
            EndContext();
#line 10 "C:\Projects\AspCoreTestProjects\ExerciseTrainingApp\TrainingAppAspCore\Pages\Shared\_LoginPartial.cshtml"
            if (User.Identity.IsAuthenticated)
            {
#line default
#line hidden
                BeginContext(293, 42, true);
                WriteLiteral("<ul class=\"nav navbar-nav navbar-right\">\r\n");
                EndContext();
#line 13 "C:\Projects\AspCoreTestProjects\ExerciseTrainingApp\TrainingAppAspCore\Pages\Shared\_LoginPartial.cshtml"
                if (!string.IsNullOrEmpty(options.EditProfilePolicyId))
                {
#line default
#line hidden
                    BeginContext(404, 12, true);
                    WriteLiteral("        <li>");
                    EndContext();
                    BeginContext(416, 105, false);
                    __tagHelperExecutionContext = __tagHelperScopeManager.Begin("a", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "ebb94b845a064d9daaac1e7568c28d06", async() => {
                        BeginContext(491, 6, true);
                        WriteLiteral("Hello ");
                        EndContext();
                        BeginContext(498, 18, false);
#line 15 "C:\Projects\AspCoreTestProjects\ExerciseTrainingApp\TrainingAppAspCore\Pages\Shared\_LoginPartial.cshtml"
                        Write(User.Identity.Name);

#line default
#line hidden
                        EndContext();
                        BeginContext(516, 1, true);
                        WriteLiteral("!");
                        EndContext();
                    }
                                                                                );
                    __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper = CreateTagHelper <global::Microsoft.AspNetCore.Mvc.TagHelpers.AnchorTagHelper>();
                    __tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper);
                    __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper.Area = (string)__tagHelperAttribute_0.Value;
                    __tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_0);
                    __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper.Controller = (string)__tagHelperAttribute_1.Value;
                    __tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_1);
                    __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper.Action = (string)__tagHelperAttribute_2.Value;
                    __tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_2);
                    await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);

                    if (!__tagHelperExecutionContext.Output.IsContentModified)
                    {
                        await __tagHelperExecutionContext.SetOutputContentAsync();
                    }
                    Write(__tagHelperExecutionContext.Output);
                    __tagHelperExecutionContext = __tagHelperScopeManager.End();
                    EndContext();
                    BeginContext(521, 7, true);
                    WriteLiteral("</li>\r\n");
                    EndContext();
#line 16 "C:\Projects\AspCoreTestProjects\ExerciseTrainingApp\TrainingAppAspCore\Pages\Shared\_LoginPartial.cshtml"
                }
                else
                {
#line default
#line hidden
                    BeginContext(552, 38, true);
                    WriteLiteral("        <li class=\"navbar-text\">Hello ");
                    EndContext();
                    BeginContext(591, 18, false);
#line 19 "C:\Projects\AspCoreTestProjects\ExerciseTrainingApp\TrainingAppAspCore\Pages\Shared\_LoginPartial.cshtml"
                    Write(User.Identity.Name);

#line default
#line hidden
                    EndContext();
                    BeginContext(609, 8, true);
                    WriteLiteral("!</li>\r\n");
                    EndContext();
#line 20 "C:\Projects\AspCoreTestProjects\ExerciseTrainingApp\TrainingAppAspCore\Pages\Shared\_LoginPartial.cshtml"
                }

#line default
#line hidden
                BeginContext(624, 8, true);
                WriteLiteral("    <li>");
                EndContext();
                BeginContext(632, 83, false);
                __tagHelperExecutionContext = __tagHelperScopeManager.Begin("a", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "3d0d800da640427688db2a9da334495e", async() => {
                    BeginContext(703, 8, true);
                    WriteLiteral("Sign out");
                    EndContext();
                }
                                                                            );
                __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper = CreateTagHelper <global::Microsoft.AspNetCore.Mvc.TagHelpers.AnchorTagHelper>();
                __tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper);
                __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper.Area = (string)__tagHelperAttribute_0.Value;
                __tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_0);
                __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper.Controller = (string)__tagHelperAttribute_1.Value;
                __tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_1);
                __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper.Action = (string)__tagHelperAttribute_3.Value;
                __tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_3);
                await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);

                if (!__tagHelperExecutionContext.Output.IsContentModified)
                {
                    await __tagHelperExecutionContext.SetOutputContentAsync();
                }
                Write(__tagHelperExecutionContext.Output);
                __tagHelperExecutionContext = __tagHelperScopeManager.End();
                EndContext();
                BeginContext(715, 7, true);
                WriteLiteral("</li>\r\n");
                EndContext();
                BeginContext(798, 7, true);
                WriteLiteral("</ul>\r\n");
                EndContext();
#line 24 "C:\Projects\AspCoreTestProjects\ExerciseTrainingApp\TrainingAppAspCore\Pages\Shared\_LoginPartial.cshtml"
            }
            else
            {
#line default
#line hidden
                BeginContext(817, 58, true);
                WriteLiteral("    <ul class=\"nav navbar-nav navbar-right\">\r\n        <li>");
                EndContext();
                BeginContext(875, 81, false);
                __tagHelperExecutionContext = __tagHelperScopeManager.Begin("a", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "c725635e4596408a8441597d52049527", async() => {
                    BeginContext(945, 7, true);
                    WriteLiteral("Sign in");
                    EndContext();
                }
                                                                            );
                __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper = CreateTagHelper <global::Microsoft.AspNetCore.Mvc.TagHelpers.AnchorTagHelper>();
                __tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper);
                __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper.Area = (string)__tagHelperAttribute_0.Value;
                __tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_0);
                __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper.Controller = (string)__tagHelperAttribute_1.Value;
                __tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_1);
                __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper.Action = (string)__tagHelperAttribute_4.Value;
                __tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_4);
                await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);

                if (!__tagHelperExecutionContext.Output.IsContentModified)
                {
                    await __tagHelperExecutionContext.SetOutputContentAsync();
                }
                Write(__tagHelperExecutionContext.Output);
                __tagHelperExecutionContext = __tagHelperScopeManager.End();
                EndContext();
                BeginContext(956, 18, true);
                WriteLiteral("</li>\r\n    </ul>\r\n");
                EndContext();
#line 30 "C:\Projects\AspCoreTestProjects\ExerciseTrainingApp\TrainingAppAspCore\Pages\Shared\_LoginPartial.cshtml"
            }

#line default
#line hidden
        }
        #pragma warning disable 1998
        public async override global::System.Threading.Tasks.Task ExecuteAsync()
        {
#line 4 "C:\Data\Source\Workspaces\Sample Code\AzureADB2CSamples-MSAL\AADB2C.Web\Views\Shared\_LoginPartial.cshtml"

            var options = AzureADB2COptions.Get(AzureADB2CDefaults.AuthenticationScheme);

#line default
#line hidden
#line 7 "C:\Data\Source\Workspaces\Sample Code\AzureADB2CSamples-MSAL\AADB2C.Web\Views\Shared\_LoginPartial.cshtml"
            if (User.Identity.IsAuthenticated)
            {
#line default
#line hidden
                BeginContext(287, 37, true);
                WriteLiteral("    <ul class=\"navbar-nav ml-auto\">\r\n");
                EndContext();
#line 10 "C:\Data\Source\Workspaces\Sample Code\AzureADB2CSamples-MSAL\AADB2C.Web\Views\Shared\_LoginPartial.cshtml"
                if (!string.IsNullOrEmpty(options.EditProfilePolicyId))
                {
#line default
#line hidden
                    BeginContext(401, 33, true);
                    WriteLiteral("            <li class=\"nav-item\">");
                    EndContext();
                    BeginContext(434, 105, false);
                    __tagHelperExecutionContext = __tagHelperScopeManager.Begin("a", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "835f6ed34f686b1effbe5a2fbb74ba32810d2fae6024", async() => {
                        BeginContext(509, 6, true);
                        WriteLiteral("Hello ");
                        EndContext();
                        BeginContext(516, 18, false);
#line 12 "C:\Data\Source\Workspaces\Sample Code\AzureADB2CSamples-MSAL\AADB2C.Web\Views\Shared\_LoginPartial.cshtml"
                        Write(User.Identity.Name);

#line default
#line hidden
                        EndContext();
                        BeginContext(534, 1, true);
                        WriteLiteral("!");
                        EndContext();
                    }
                                                                                );
                    __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper = CreateTagHelper <global::Microsoft.AspNetCore.Mvc.TagHelpers.AnchorTagHelper>();
                    __tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper);
                    __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper.Area = (string)__tagHelperAttribute_0.Value;
                    __tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_0);
                    __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper.Controller = (string)__tagHelperAttribute_1.Value;
                    __tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_1);
                    __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper.Action = (string)__tagHelperAttribute_2.Value;
                    __tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_2);
                    await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);

                    if (!__tagHelperExecutionContext.Output.IsContentModified)
                    {
                        await __tagHelperExecutionContext.SetOutputContentAsync();
                    }
                    Write(__tagHelperExecutionContext.Output);
                    __tagHelperExecutionContext = __tagHelperScopeManager.End();
                    EndContext();
                    BeginContext(539, 7, true);
                    WriteLiteral("</li>\r\n");
                    EndContext();
#line 13 "C:\Data\Source\Workspaces\Sample Code\AzureADB2CSamples-MSAL\AADB2C.Web\Views\Shared\_LoginPartial.cshtml"
                }
                else
                {
#line default
#line hidden
                    BeginContext(582, 42, true);
                    WriteLiteral("            <li class=\"navbar-text\">Hello ");
                    EndContext();
                    BeginContext(625, 18, false);
#line 16 "C:\Data\Source\Workspaces\Sample Code\AzureADB2CSamples-MSAL\AADB2C.Web\Views\Shared\_LoginPartial.cshtml"
                    Write(User.Identity.Name);

#line default
#line hidden
                    EndContext();
                    BeginContext(643, 8, true);
                    WriteLiteral("!</li>\r\n");
                    EndContext();
#line 17 "C:\Data\Source\Workspaces\Sample Code\AzureADB2CSamples-MSAL\AADB2C.Web\Views\Shared\_LoginPartial.cshtml"
                }

#line default
#line hidden
                BeginContext(662, 29, true);
                WriteLiteral("        <li class=\"nav-item\">");
                EndContext();
                BeginContext(691, 83, false);
                __tagHelperExecutionContext = __tagHelperScopeManager.Begin("a", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "835f6ed34f686b1effbe5a2fbb74ba32810d2fae9293", async() => {
                    BeginContext(762, 8, true);
                    WriteLiteral("Sign out");
                    EndContext();
                }
                                                                            );
                __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper = CreateTagHelper <global::Microsoft.AspNetCore.Mvc.TagHelpers.AnchorTagHelper>();
                __tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper);
                __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper.Area = (string)__tagHelperAttribute_0.Value;
                __tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_0);
                __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper.Controller = (string)__tagHelperAttribute_1.Value;
                __tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_1);
                __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper.Action = (string)__tagHelperAttribute_3.Value;
                __tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_3);
                await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);

                if (!__tagHelperExecutionContext.Output.IsContentModified)
                {
                    await __tagHelperExecutionContext.SetOutputContentAsync();
                }
                Write(__tagHelperExecutionContext.Output);
                __tagHelperExecutionContext = __tagHelperScopeManager.End();
                EndContext();
                BeginContext(774, 18, true);
                WriteLiteral("</li>\r\n    </ul>\r\n");
                EndContext();
#line 20 "C:\Data\Source\Workspaces\Sample Code\AzureADB2CSamples-MSAL\AADB2C.Web\Views\Shared\_LoginPartial.cshtml"
            }
            else
            {
#line default
#line hidden
                BeginContext(804, 66, true);
                WriteLiteral("    <ul class=\"navbar-nav ml-auto\">\r\n        <li class=\"nav-item\">");
                EndContext();
                BeginContext(870, 81, false);
                __tagHelperExecutionContext = __tagHelperScopeManager.Begin("a", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "835f6ed34f686b1effbe5a2fbb74ba32810d2fae11422", async() => {
                    BeginContext(940, 7, true);
                    WriteLiteral("Sign in");
                    EndContext();
                }
                                                                            );
                __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper = CreateTagHelper <global::Microsoft.AspNetCore.Mvc.TagHelpers.AnchorTagHelper>();
                __tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper);
                __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper.Area = (string)__tagHelperAttribute_0.Value;
                __tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_0);
                __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper.Controller = (string)__tagHelperAttribute_1.Value;
                __tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_1);
                __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper.Action = (string)__tagHelperAttribute_4.Value;
                __tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_4);
                await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);

                if (!__tagHelperExecutionContext.Output.IsContentModified)
                {
                    await __tagHelperExecutionContext.SetOutputContentAsync();
                }
                Write(__tagHelperExecutionContext.Output);
                __tagHelperExecutionContext = __tagHelperScopeManager.End();
                EndContext();
                BeginContext(951, 18, true);
                WriteLiteral("</li>\r\n    </ul>\r\n");
                EndContext();
#line 26 "C:\Data\Source\Workspaces\Sample Code\AzureADB2CSamples-MSAL\AADB2C.Web\Views\Shared\_LoginPartial.cshtml"
            }

#line default
#line hidden
        }
        #pragma warning disable 1998
        public async override global::System.Threading.Tasks.Task ExecuteAsync()
        {
            BeginContext(191, 2, true);
            WriteLiteral("\r\n");
            EndContext();
#line 6 "C:\Users\brhacke\source\repos\College Board PoC Model\College Board PoC Model\Views\Shared\_LoginPartial.cshtml"

            var options = AzureADB2COptions.Get(AzureADB2CDefaults.AuthenticationScheme);

#line default
#line hidden
            BeginContext(283, 33, true);
            WriteLiteral("\r\n\r\n    <ul class=\"navbar-nav\">\r\n");
            EndContext();
#line 12 "C:\Users\brhacke\source\repos\College Board PoC Model\College Board PoC Model\Views\Shared\_LoginPartial.cshtml"
            if (User.Identity.IsAuthenticated)
            {
#line default
#line hidden
#line 14 "C:\Users\brhacke\source\repos\College Board PoC Model\College Board PoC Model\Views\Shared\_LoginPartial.cshtml"
                if (!string.IsNullOrEmpty(options.EditProfilePolicyId))
                {
#line default
#line hidden
                    BeginContext(441, 43, true);
                    WriteLiteral("        <li class=\"nav-item\">\r\n            ");
                    EndContext();
                    BeginContext(484, 186, false);
                    __tagHelperExecutionContext = __tagHelperScopeManager.Begin("a", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "352de67a28269176cbfa694ca5e78135f1ca7af77372", async() => {
                        BeginContext(568, 57, true);
                        WriteLiteral("\r\n                <span class=\"nav-text text-dark\">Hello ");
                        EndContext();
                        BeginContext(626, 18, false);
#line 18 "C:\Users\brhacke\source\repos\College Board PoC Model\College Board PoC Model\Views\Shared\_LoginPartial.cshtml"
                        Write(User.Identity.Name);

#line default
#line hidden
                        EndContext();
                        BeginContext(644, 22, true);
                        WriteLiteral("!</span>\r\n            ");
                        EndContext();
                    }
                                                                                );
                    __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper = CreateTagHelper <global::Microsoft.AspNetCore.Mvc.TagHelpers.AnchorTagHelper>();
                    __tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper);
                    __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_0);
                    __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper.Area = (string)__tagHelperAttribute_1.Value;
                    __tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_1);
                    __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper.Controller = (string)__tagHelperAttribute_2.Value;
                    __tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_2);
                    __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper.Action = (string)__tagHelperAttribute_3.Value;
                    __tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_3);
                    await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);

                    if (!__tagHelperExecutionContext.Output.IsContentModified)
                    {
                        await __tagHelperExecutionContext.SetOutputContentAsync();
                    }
                    Write(__tagHelperExecutionContext.Output);
                    __tagHelperExecutionContext = __tagHelperScopeManager.End();
                    EndContext();
                    BeginContext(670, 29, true);
                    WriteLiteral("\r\n        </li>\r\n        <li>");
                    EndContext();
                    BeginContext(699, 81, false);
                    __tagHelperExecutionContext = __tagHelperScopeManager.Begin("a", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "352de67a28269176cbfa694ca5e78135f1ca7af79763", async() => {
                        BeginContext(764, 12, true);
                        WriteLiteral("Edit Profile");
                        EndContext();
                    }
                                                                                );
                    __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper = CreateTagHelper <global::Microsoft.AspNetCore.Mvc.TagHelpers.AnchorTagHelper>();
                    __tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper);
                    __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper.Area = (string)__tagHelperAttribute_1.Value;
                    __tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_1);
                    __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper.Controller = (string)__tagHelperAttribute_4.Value;
                    __tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_4);
                    __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper.Action = (string)__tagHelperAttribute_5.Value;
                    __tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_5);
                    await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);

                    if (!__tagHelperExecutionContext.Output.IsContentModified)
                    {
                        await __tagHelperExecutionContext.SetOutputContentAsync();
                    }
                    Write(__tagHelperExecutionContext.Output);
                    __tagHelperExecutionContext = __tagHelperScopeManager.End();
                    EndContext();
                    BeginContext(780, 7, true);
                    WriteLiteral("</li>\r\n");
                    EndContext();
#line 22 "C:\Users\brhacke\source\repos\College Board PoC Model\College Board PoC Model\Views\Shared\_LoginPartial.cshtml"
                }
                else
                {
#line default
#line hidden
                    BeginContext(823, 82, true);
                    WriteLiteral("        <li class=\"nav-item\">\r\n            <span class=\"nav-text text-dark\">Hello ");
                    EndContext();
                    BeginContext(906, 18, false);
#line 26 "C:\Users\brhacke\source\repos\College Board PoC Model\College Board PoC Model\Views\Shared\_LoginPartial.cshtml"
                    Write(User.Identity.Name);

#line default
#line hidden
                    EndContext();
                    BeginContext(924, 25, true);
                    WriteLiteral("!</span>\r\n        </li>\r\n");
                    EndContext();
#line 28 "C:\Users\brhacke\source\repos\College Board PoC Model\College Board PoC Model\Views\Shared\_LoginPartial.cshtml"
                }

#line default
#line hidden
                BeginContext(960, 43, true);
                WriteLiteral("        <li class=\"nav-item\">\r\n            ");
                EndContext();
                BeginContext(1003, 100, false);
                __tagHelperExecutionContext = __tagHelperScopeManager.Begin("a", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "352de67a28269176cbfa694ca5e78135f1ca7af712672", async() => {
                    BeginContext(1091, 8, true);
                    WriteLiteral("Sign out");
                    EndContext();
                }
                                                                            );
                __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper = CreateTagHelper <global::Microsoft.AspNetCore.Mvc.TagHelpers.AnchorTagHelper>();
                __tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper);
                __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_0);
                __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper.Area = (string)__tagHelperAttribute_1.Value;
                __tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_1);
                __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper.Controller = (string)__tagHelperAttribute_4.Value;
                __tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_4);
                __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper.Action = (string)__tagHelperAttribute_6.Value;
                __tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_6);
                await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);

                if (!__tagHelperExecutionContext.Output.IsContentModified)
                {
                    await __tagHelperExecutionContext.SetOutputContentAsync();
                }
                Write(__tagHelperExecutionContext.Output);
                __tagHelperExecutionContext = __tagHelperScopeManager.End();
                EndContext();
                BeginContext(1103, 17, true);
                WriteLiteral("\r\n        </li>\r\n");
                EndContext();
#line 32 "C:\Users\brhacke\source\repos\College Board PoC Model\College Board PoC Model\Views\Shared\_LoginPartial.cshtml"
            }
            else
            {
#line default
#line hidden
                BeginContext(1132, 43, true);
                WriteLiteral("        <li class=\"nav-item\">\r\n            ");
                EndContext();
                BeginContext(1175, 98, false);
                __tagHelperExecutionContext = __tagHelperScopeManager.Begin("a", global::Microsoft.AspNetCore.Razor.TagHelpers.TagMode.StartTagAndEndTag, "352de67a28269176cbfa694ca5e78135f1ca7af714869", async() => {
                    BeginContext(1262, 7, true);
                    WriteLiteral("Sign in");
                    EndContext();
                }
                                                                            );
                __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper = CreateTagHelper <global::Microsoft.AspNetCore.Mvc.TagHelpers.AnchorTagHelper>();
                __tagHelperExecutionContext.Add(__Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper);
                __tagHelperExecutionContext.AddHtmlAttribute(__tagHelperAttribute_0);
                __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper.Area = (string)__tagHelperAttribute_1.Value;
                __tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_1);
                __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper.Controller = (string)__tagHelperAttribute_4.Value;
                __tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_4);
                __Microsoft_AspNetCore_Mvc_TagHelpers_AnchorTagHelper.Action = (string)__tagHelperAttribute_7.Value;
                __tagHelperExecutionContext.AddTagHelperAttribute(__tagHelperAttribute_7);
                await __tagHelperRunner.RunAsync(__tagHelperExecutionContext);

                if (!__tagHelperExecutionContext.Output.IsContentModified)
                {
                    await __tagHelperExecutionContext.SetOutputContentAsync();
                }
                Write(__tagHelperExecutionContext.Output);
                __tagHelperExecutionContext = __tagHelperScopeManager.End();
                EndContext();
                BeginContext(1273, 17, true);
                WriteLiteral("\r\n        </li>\r\n");
                EndContext();
#line 38 "C:\Users\brhacke\source\repos\College Board PoC Model\College Board PoC Model\Views\Shared\_LoginPartial.cshtml"
            }

#line default
#line hidden
            BeginContext(1293, 9, true);
            WriteLiteral("    </ul>");
            EndContext();
        }