Search code examples
c#asp.net-coreasp.net-core-2.0asp.net-core-mvc-2.0.net-4.6.1

AspNetCore MVC - ControllerBase.Challenge Issue


Trying to use Challenge(AuthenticationProperties, String[]) as below in my mvc project

 [Authorize]
 public IActionResult SignIn()
 {
     return Challenge(new AuthenticationProperties { RedirectUri = "/" }, OpenIdConnectDefaults.AuthenticationScheme);
 }

But getting following error

cannot convert from Microsoft.AspNetCore.Http.Authentication.AuthenticationProperties to string

Am I doing something wrong here?

Updated

enter image description here


Solution

  • Found the issue

    It was the reference to AuthenticationProperties

    This come from both Microsoft.AspNetCore.Authentication and Microsoft.AspNetCore.Http.Authentication

    It was pointing to Microsoft.AspNetCore.Http.Authentication which caused the issue