2

Hi I'm trying to add OpenID connect and this run this code in application

 protected void btnLoginopenID_Click(object sender, EventArgs e)
    {

        try
        {

            if (!Request.IsAuthenticated)
            {
                //Response.Redirect("~/AccessDenied2.aspx", false);
                HttpContext.Current.GetOwinContext().Authentication.Challenge();
            }


        }
        catch (Exception exception)
        {
        }
    }

and I'm getting this error message when trying to run code

CS1061 'HttpContext' does not contain a definition for 'GetOwinContext' and no extension method 'GetOwinContext' accepting a first argument of type 'HttpContext' could be found

enter image description here

i did try

Install-Package Microsoft.Owin.Host.SystemWeb

but didn't work for me any suggestion to fix t his issue or also if you know any way to integrate OpenID Connect to C# .net framework 4.5 for WebForm.aspx please let me know

Nuwan Indika
  • 21
  • 1
  • 4

1 Answers1

0

it's missing package Microsoft.Owin.Host.SystemWeb

  • As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Mar 21 '22 at 01:25