oauth
This commit is contained in:
parent
989df49cf2
commit
19b41ed9f4
19 changed files with 1729 additions and 7620 deletions
32
Yavsc/Views/OAuth/Authorize.cshtml
Normal file
32
Yavsc/Views/OAuth/Authorize.cshtml
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
@using Microsoft.AspNet.Http.Authentication
|
||||
@using Microsoft.AspNet.WebUtilities
|
||||
@using System.Security.Claims
|
||||
@{
|
||||
AuthenticationManager authentication = Context.Authentication;
|
||||
ClaimsPrincipal principal = authentication.AuthenticateAsync(Constants.ApplicationAuthenticationSheme).Result;
|
||||
string[] scopes = QueryHelpers.ParseQuery(Context.Request.QueryString.Value)["scope"];
|
||||
}
|
||||
<!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)
|
||||
{
|
||||
<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>
|
||||
20
Yavsc/Views/OAuth/AuthorizeError.cshtml
Normal file
20
Yavsc/Views/OAuth/AuthorizeError.cshtml
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
@using Microsoft.AspNet.Http
|
||||
@using System
|
||||
@using System.Security.Claims
|
||||
@{
|
||||
var error = Context.Items["oauth.Error"];
|
||||
var errorDescription = Context.Items["oauth.ErrorDescription"];
|
||||
var errorUri = Context.Items["oauth.ErrorUri"];
|
||||
}
|
||||
<!DOCTYPE html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<title>Authorize Error</title>
|
||||
</head>
|
||||
<body>
|
||||
<h1>Katana.Sandbox.WebServer</h1>
|
||||
<h2>OAuth2 Authorize Error</h2>
|
||||
<p>Error: @error</p>
|
||||
<p>@errorDescription</p>
|
||||
</body>
|
||||
</html>
|
||||
Loading…
Add table
Add a link
Reference in a new issue