add a oidc controller

This commit is contained in:
agile.zhou
2023-07-10 02:44:41 +08:00
parent ea3e3a03a5
commit fd54f5c5fe
3 changed files with 21 additions and 8 deletions
@@ -41,12 +41,6 @@ namespace AgileConfig.Server.Apisite.Controllers
return Redirect(Request.PathBase + "/ui");
}
[AllowAnonymous]
public async Task<IActionResult> OIDC(string code)
{
return Redirect("http://localhost:8000/ui/#/oidc/login?code=" + code);
}
public async Task<IActionResult> Current()
{
string userName = this.GetCurrentUserName();
@@ -0,0 +1,19 @@
using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
namespace AgileConfig.Server.Apisite.Controllers
{
public class OIDCController : Controller
{
/// <summary>
/// pass the oidc code to frontend
/// </summary>
/// <param name="code"></param>
/// <returns></returns>
[AllowAnonymous]
public IActionResult Index(string code)
{
return Redirect("http://localhost:8000/ui/#/oidc/login?code=" + code);
}
}
}
@@ -42,8 +42,8 @@
},
"OIDC": {
"clientId": "64a925a9642cc515dceccdfb",
"clientSecret": "e7c908f12ff64ab35de93bbd6973f5ed",
"redirectUri": "http://localhost:5000/home/oidc",
"clientSecret": "",
"redirectUri": "http://localhost:5000/oidc",
"tokenEndpoint": "https://agileconfig.authing.cn/oidc/token",
"authorizationEndpoint": "https://agileconfig.authing.cn"
}