diff options
Diffstat (limited to 'samples/DotNetOpenAuth.Samples.OpenIDConnectRP/Views')
8 files changed, 143 insertions, 0 deletions
diff --git a/samples/DotNetOpenAuth.Samples.OpenIDConnectRP/Views/Home/Claims.cshtml b/samples/DotNetOpenAuth.Samples.OpenIDConnectRP/Views/Home/Claims.cshtml new file mode 100644 index 0000000..d7960c4 --- /dev/null +++ b/samples/DotNetOpenAuth.Samples.OpenIDConnectRP/Views/Home/Claims.cshtml @@ -0,0 +1,13 @@ +<h3>@ViewBag.Message</h3> + +<dl> + @foreach (var claim in System.Security.Claims.ClaimsPrincipal.Current.Claims) + { + <dt> + @claim.Type + </dt> + <dd> + @claim.Value + </dd> + } +</dl>
\ No newline at end of file diff --git a/samples/DotNetOpenAuth.Samples.OpenIDConnectRP/Views/Home/Index.cshtml b/samples/DotNetOpenAuth.Samples.OpenIDConnectRP/Views/Home/Index.cshtml new file mode 100644 index 0000000..a06e669 --- /dev/null +++ b/samples/DotNetOpenAuth.Samples.OpenIDConnectRP/Views/Home/Index.cshtml @@ -0,0 +1,8 @@ +@{ + ViewBag.Title = "Home Page"; +} + +<div class="jumbotron"> + <h1>Claims</h1> + <p><a href="@Url.Action("Claims")" class="btn btn-default">View</a> claims obtained using OpenID Connect</p> +</div> diff --git a/samples/DotNetOpenAuth.Samples.OpenIDConnectRP/Views/Shared/Error.cshtml b/samples/DotNetOpenAuth.Samples.OpenIDConnectRP/Views/Shared/Error.cshtml new file mode 100644 index 0000000..be55b17 --- /dev/null +++ b/samples/DotNetOpenAuth.Samples.OpenIDConnectRP/Views/Shared/Error.cshtml @@ -0,0 +1,9 @@ +@model System.Web.Mvc.HandleErrorInfo + +@{ + ViewBag.Title = "Error"; +} + +<h1 class="text-danger">Error.</h1> +<h2 class="text-danger">An error occurred while processing your request.</h2> + diff --git a/samples/DotNetOpenAuth.Samples.OpenIDConnectRP/Views/Shared/Lockout.cshtml b/samples/DotNetOpenAuth.Samples.OpenIDConnectRP/Views/Shared/Lockout.cshtml new file mode 100644 index 0000000..8658ff2 --- /dev/null +++ b/samples/DotNetOpenAuth.Samples.OpenIDConnectRP/Views/Shared/Lockout.cshtml @@ -0,0 +1,10 @@ +@model System.Web.Mvc.HandleErrorInfo + +@{ + ViewBag.Title = "Locked Out"; +} + +<hgroup> + <h1 class="text-danger">Locked out.</h1> + <h2 class="text-danger">This account has been locked out, please try again later.</h2> +</hgroup> diff --git a/samples/DotNetOpenAuth.Samples.OpenIDConnectRP/Views/Shared/_Layout.cshtml b/samples/DotNetOpenAuth.Samples.OpenIDConnectRP/Views/Shared/_Layout.cshtml new file mode 100644 index 0000000..20b7dde --- /dev/null +++ b/samples/DotNetOpenAuth.Samples.OpenIDConnectRP/Views/Shared/_Layout.cshtml @@ -0,0 +1,43 @@ +@using Microsoft.AspNet.Identity +<!DOCTYPE html> +<html> +<head> + <meta charset="utf-8" /> + <meta name="viewport" content="width=device-width, initial-scale=1.0"> + <title>@ViewBag.Title - My ASP.NET Application</title> + @Styles.Render("~/Content/css") + @Scripts.Render("~/bundles/modernizr") + +</head> +<body> + <div class="navbar navbar-inverse navbar-fixed-top"> + <div class="container"> + <div class="navbar-header"> + <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse"> + <span class="icon-bar"></span> + <span class="icon-bar"></span> + <span class="icon-bar"></span> + </button> + @Html.ActionLink("Application name", "Index", "Home", new { area = "" }, new { @class = "navbar-brand" }) + </div> + <div class="navbar-collapse collapse"> + <ul class="nav navbar-nav"> + <li>@Html.ActionLink("Home", "Index", "Home")</li> + <li>@Html.ActionLink("Claims", "Claims", "Home")</li> + </ul> + </div> + </div> + </div> + <div class="container body-content"> + @RenderBody() + <hr /> + <footer> + <p>© @DateTime.Now.Year - My ASP.NET Application</p> + </footer> + </div> + + @Scripts.Render("~/bundles/jquery") + @Scripts.Render("~/bundles/bootstrap") + @RenderSection("scripts", required: false) +</body> +</html> diff --git a/samples/DotNetOpenAuth.Samples.OpenIDConnectRP/Views/Shared/_LoginPartial.cshtml b/samples/DotNetOpenAuth.Samples.OpenIDConnectRP/Views/Shared/_LoginPartial.cshtml new file mode 100644 index 0000000..f996508 --- /dev/null +++ b/samples/DotNetOpenAuth.Samples.OpenIDConnectRP/Views/Shared/_LoginPartial.cshtml @@ -0,0 +1,22 @@ +@using Microsoft.AspNet.Identity +@if (Request.IsAuthenticated) +{ + using (Html.BeginForm("LogOff", "Account", FormMethod.Post, new { id = "logoutForm", @class = "navbar-right" })) + { + @Html.AntiForgeryToken() + + <ul class="nav navbar-nav navbar-right"> + <li> + @Html.ActionLink("Hello " + User.Identity.GetUserName() + "!", "Index", "Manage", routeValues: null, htmlAttributes: new { title = "Manage" }) + </li> + <li><a href="javascript:document.getElementById('logoutForm').submit()">Log off</a></li> + </ul> + } +} +else +{ + <ul class="nav navbar-nav navbar-right"> + <li>@Html.ActionLink("Register", "Register", "Account", routeValues: null, htmlAttributes: new { id = "registerLink" })</li> + <li>@Html.ActionLink("Log in", "Login", "Account", routeValues: null, htmlAttributes: new { id = "loginLink" })</li> + </ul> +} diff --git a/samples/DotNetOpenAuth.Samples.OpenIDConnectRP/Views/Web.config b/samples/DotNetOpenAuth.Samples.OpenIDConnectRP/Views/Web.config new file mode 100644 index 0000000..5aed23b --- /dev/null +++ b/samples/DotNetOpenAuth.Samples.OpenIDConnectRP/Views/Web.config @@ -0,0 +1,35 @@ +<?xml version="1.0"?> + +<configuration> + <configSections> + <sectionGroup name="system.web.webPages.razor" type="System.Web.WebPages.Razor.Configuration.RazorWebSectionGroup, System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"> + <section name="host" type="System.Web.WebPages.Razor.Configuration.HostSection, System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" /> + <section name="pages" type="System.Web.WebPages.Razor.Configuration.RazorPagesSection, System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" /> + </sectionGroup> + </configSections> + + <system.web.webPages.razor> + <host factoryType="System.Web.Mvc.MvcWebRazorHostFactory, System.Web.Mvc, Version=5.2.2.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" /> + <pages pageBaseType="System.Web.Mvc.WebViewPage"> + <namespaces> + <add namespace="System.Web.Mvc" /> + <add namespace="System.Web.Mvc.Ajax" /> + <add namespace="System.Web.Mvc.Html" /> + <add namespace="System.Web.Optimization"/> + <add namespace="System.Web.Routing" /> + <add namespace="DotNetOpenAuth.Samples.OpenIDConnectRP" /> + </namespaces> + </pages> + </system.web.webPages.razor> + + <appSettings> + <add key="webpages:Enabled" value="false" /> + </appSettings> + + <system.webServer> + <handlers> + <remove name="BlockViewHandler"/> + <add name="BlockViewHandler" path="*" verb="*" preCondition="integratedMode" type="System.Web.HttpNotFoundHandler" /> + </handlers> + </system.webServer> +</configuration> diff --git a/samples/DotNetOpenAuth.Samples.OpenIDConnectRP/Views/_ViewStart.cshtml b/samples/DotNetOpenAuth.Samples.OpenIDConnectRP/Views/_ViewStart.cshtml new file mode 100644 index 0000000..2de6241 --- /dev/null +++ b/samples/DotNetOpenAuth.Samples.OpenIDConnectRP/Views/_ViewStart.cshtml @@ -0,0 +1,3 @@ +@{ + Layout = "~/Views/Shared/_Layout.cshtml"; +} |