Single sign on 身份验证。质询不使用ApicController

Single sign on 身份验证。质询不使用ApicController,single-sign-on,.net-framework-version,asp.net-apicontroller,owin-middleware,owin-security,Single Sign On,.net Framework Version,Asp.net Apicontroller,Owin Middleware,Owin Security,使用ApicController,验证。质询不会提示Microsoft登录SSO。它执行SignIn操作方法,没有任何错误。如果我从ApiController更改为控制器,则会提示。有人知道如何使用ApiController提示Microsoft登录吗 公共类值控制器:ApiController { 公共类值控制器:控制器 { 这对我的工作很有帮助。 [System.Web.Http.Route("api/values/signin")] [System

使用ApicController,验证。质询不会提示Microsoft登录SSO。它执行SignIn操作方法,没有任何错误。如果我从ApiController更改为控制器,则会提示。有人知道如何使用ApiController提示Microsoft登录吗

公共类值控制器:ApiController {

公共类值控制器:控制器 {


这对我的工作很有帮助。
       [System.Web.Http.Route("api/values/signin")]
    [System.Web.Http.HttpGet]
    public void SignIn()
    
    {
        if (!System.Web.HttpContext.Current.Request.IsAuthenticated)
        {
            HttpContext.Current.GetOwinContext().Authentication.Challenge(
                new AuthenticationProperties { RedirectUri = "/" },
                OpenIdConnectAuthenticationDefaults.AuthenticationType);
        }
    }
}  
    public void SignIn()
    
    {
        if (!System.Web.HttpContext.Current.Request.IsAuthenticated)
        {
            HttpContext.Current.GetOwinContext().Authentication.Challenge(
                new AuthenticationProperties { RedirectUri = "/" },
                OpenIdConnectAuthenticationDefaults.AuthenticationType);
        }
    }
}