File tree Expand file tree Collapse file tree
samples/IdentityServer.ServerSample Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22using Duende . IdentityServer . Services ;
33using Microsoft . AspNetCore . Authentication ;
44using Microsoft . AspNetCore . Mvc ;
5-
5+ using System . Net ;
66namespace IdentityServer . ServerSample . Controllers ;
77
88public class AccountController : Controller
@@ -23,7 +23,8 @@ public async Task<IActionResult> Login(string returnUrl)
2323 var providers = schemes
2424 . Where ( x => x . DisplayName != null )
2525 . Select ( x => new ExternalProvider ( x . DisplayName ?? x . Name , x . Name ) ) ;
26- var viewModel = new AccountLoginViewModel ( providers , returnUrl ) ;
26+ var sanitizedReturnUrl = System . Net . WebUtility . HtmlEncode ( returnUrl ) ;
27+ var viewModel = new AccountLoginViewModel ( providers , sanitizedReturnUrl ) ;
2728
2829 return View ( viewModel ) ;
2930 }
Original file line number Diff line number Diff line change 1717 <a class =" btn btn-primary btn-lg"
1818 asp-action =" ExternalLogin"
1919 asp-route-provider =" @provider.AuthenticationScheme"
20- asp-route-returnUrl =" @Model.ReturnUrl" >
20+ asp-route-returnUrl =" @Html.Raw( Model.ReturnUrl) " >
2121 @provider.DisplayName
2222 </a >
2323 }
You can’t perform that action at this time.
0 commit comments