oidc
This commit is contained in:
parent
9342d48c9d
commit
e85b41313f
41 changed files with 740 additions and 57 deletions
19
testOauthClient/Controllers/AuthenticationController.cs
Normal file
19
testOauthClient/Controllers/AuthenticationController.cs
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
|
||||
using Microsoft.AspNet.Authentication.OpenIdConnect;
|
||||
using Microsoft.AspNet.Http.Authentication;
|
||||
using Microsoft.AspNet.Mvc;
|
||||
|
||||
namespace Mvc.Client.Controllers {
|
||||
|
||||
public class AuthenticationController : Controller {
|
||||
|
||||
[HttpGet("~/signin")]
|
||||
public ActionResult SignIn(string returnUrl) {
|
||||
// Instruct the OIDC client middleware to redirect the user agent to the identity provider.
|
||||
// Note: the authenticationType parameter must match the value configured in Startup.cs
|
||||
var properties = new AuthenticationProperties { RedirectUri = "http://localhost:5002/" };
|
||||
return new ChallengeResult(OpenIdConnectDefaults.AuthenticationScheme, properties);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
35
testOauthClient/Controllers/HomeController.cs
Executable file
35
testOauthClient/Controllers/HomeController.cs
Executable file
|
|
@ -0,0 +1,35 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.AspNet.Mvc;
|
||||
|
||||
namespace testOauthClient.Controllers
|
||||
{
|
||||
public class HomeController : Controller
|
||||
{
|
||||
public IActionResult Index()
|
||||
{
|
||||
return View();
|
||||
}
|
||||
|
||||
public IActionResult About()
|
||||
{
|
||||
ViewData["Message"] = "Your application description page.";
|
||||
|
||||
return View();
|
||||
}
|
||||
|
||||
public IActionResult Contact()
|
||||
{
|
||||
ViewData["Message"] = "Your contact page.";
|
||||
|
||||
return View();
|
||||
}
|
||||
|
||||
public IActionResult Error()
|
||||
{
|
||||
return View();
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue