HTTP Basic Authentication - what's the expected web browser experience?

后端 未结 6 2018
孤城傲影
孤城傲影 2020-12-12 11:34

When a server allows access via Basic HTTP Authentication, what is the experience expected to be in a web browser?

Ignoring the web browser for a mo

6条回答
  •  庸人自扰
    2020-12-12 11:58

    If there are no credentials provided in the request headers, the following is the minimum response required for IE to prompt the user for credentials and resubmit the request.

    Response.Clear();
    Response.StatusCode = (Int32)HttpStatusCode.Unauthorized;
    Response.AddHeader("WWW-Authenticate", "Basic");
    

提交回复
热议问题