OAuth OK!
This commit is contained in:
parent
494a840f70
commit
567e4a6635
382 changed files with 52478 additions and 7572 deletions
|
|
@ -1,32 +1,34 @@
|
|||
@using Microsoft.AspNet.Http.Authentication
|
||||
@using Microsoft.AspNet.Http.Authentication
|
||||
@using Microsoft.AspNet.WebUtilities
|
||||
@using System.Security.Claims
|
||||
@using System.Security.Claims
|
||||
@model Yavsc.Models.Auth.AuthorisationView
|
||||
@{
|
||||
AuthenticationManager authentication = Context.Authentication;
|
||||
ClaimsPrincipal principal = authentication.AuthenticateAsync(Constants.ApplicationAuthenticationSheme).Result;
|
||||
string[] scopes = QueryHelpers.ParseQuery(Context.Request.QueryString.Value)["scope"];
|
||||
ViewBag.Title = @SR["Authorize"];
|
||||
}
|
||||
<!DOCTYPE html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<title>Authorize</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Authorization Server</h1>
|
||||
<h2>OAuth2 Authorize</h2>
|
||||
<form method="POST">
|
||||
<p>Hello, @principal.Identity.Name</p>
|
||||
<p>A third party application want to do the following on your behalf:</p>
|
||||
<ul>
|
||||
@foreach (var scope in scopes)
|
||||
<h1>Authorization Server</h1>
|
||||
<h2>OAuth2 Authorize</h2>
|
||||
|
||||
<form method="POST" asp-action="Authorize" asp-controller="OAuth"
|
||||
asp-route-client_id="@Model.ClientId"
|
||||
asp-route-redirect_url="@Model.RedirectUrl"
|
||||
asp-route-state="@Model.State"
|
||||
asp-route-response_type="@Model.ResponseType"
|
||||
>
|
||||
<p>Hello, @User.Identity.Name</p>
|
||||
<p>@Model.Message</p>
|
||||
<p>A third party application want to do the following on your behalf:</p>
|
||||
<ul>
|
||||
@if (Model.Scopes!=null) {
|
||||
@foreach (var scope in Model.Scopes)
|
||||
{
|
||||
<li>@scope</li>
|
||||
}
|
||||
</ul>
|
||||
<p>
|
||||
<input type="submit" name="submit.Grant" value="Grant" />
|
||||
<input type="submit" name="submit.Login" value="Sign in as different user" />
|
||||
</p>
|
||||
</form>
|
||||
</body>
|
||||
</html>
|
||||
<li><em>@scope.Id</em>: @scope.Description</li>
|
||||
}
|
||||
}
|
||||
</ul>
|
||||
<p>
|
||||
<input type="submit" class="btn btn-lg btn-success" name="submit.Grant" value="Grant" />
|
||||
<input type="submit" class="btn btn-lg btn-danger" name="submit.Deny" value="Deny" />
|
||||
<input type="submit" class="btn btn-lg btn-success" name="submit.Login" value="Sign in as different user" />
|
||||
</p>
|
||||
|
||||
</form>
|
||||
Loading…
Add table
Add a link
Reference in a new issue