/
githubmirror
/
aspnetcore
Обзор
Документация
Войти
/
githubmirror
/
aspnetcore
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
src/Security/samples/DynamicSchemes/Pages/Index.cshtml
46 строк
2 KB
Justin Kotalik
Make Auth Samples Project Ref (#6557)
16 янв 2019, 00:12
Не верифицирован
16 янв 2019, 00:12
e751db0
Код
Авторство
О чём код?
@page @using Microsoft.AspNetCore.Authentication @using Microsoft.Extensions.Options @inject IAuthenticationSchemeProvider SchemeProvider @inject IOptionsMonitor<SimpleOptions> Options @model IndexModel @{ ViewData["Title"] = "Home page"; } <div class="row"> <h2>Current Authentication Schemes</h2> <ul> @{ var schemes = await SchemeProvider.GetAllSchemesAsync(); foreach (var scheme in schemes) { <li><b>Scheme:</b> @scheme.Name -- <b>Handler:</b> @scheme.HandlerType.Name <b>DisplayMessage:</b> @Options.Get(scheme.Name).DisplayMessage <a asp-area="" asp-controller="Auth" asp-action="Remove" asp-route-scheme="@scheme.Name">Remove</a></li> } } </ul> </div> <div class="row"> <h2>Add or update a scheme:</h2> <form asp-controller="Auth" asp-action="AddOrUpdate" method="post" class="form-horizontal" role="form"> <div class="form-group"> <label class="col-md-2 control-label">Scheme</label> <div class="col-md-10"> <input type="text" name="scheme" /> </div> </div> <div class="form-group"> <label class="col-md-2 control-label">OptionsMessage</label> <div class="col-md-10"> <input type="text" name="OptionsMessage" /> </div> </div> <div class="form-group"> <div class="col-md-offset-2 col-md-10"> <button type="submit" class="btn btn-default">Add/Update</button> </div> </div> </form> </div>