相关疑难解决方法(0)

HTTP基本身份验证凭据在URL和加密中传递

我有一个关于HTTPS和HTTP身份验证凭据的问题.

假设我使用HTTP身份验证保护URL:

<Directory /var/www/webcallback>
AuthType Basic
AuthName "Restricted Area"
AuthUserFile /var/www/passwd/passwords
Require user gooduser
</Directory>
Run Code Online (Sandbox Code Playgroud)

然后,我通过HTTPS从远程系统访问该URL,并在URL中传递凭据:

https://gooduser:secretpassword@www.example.com/webcallback?foo=bar
Run Code Online (Sandbox Code Playgroud)

用户名和密码是否会自动进行SSL加密?GET和POST也是如此吗?我很难找到这个信息的可靠来源.

https basic-authentication

242
推荐指数
2
解决办法
43万
查看次数

Postman的ASP.NET Web API授权

我创建了一个ASP.NET Web API并将Authorize属性应用于API控制器.现在,我想使用Postman测试它,但我收到了授权错误.

控制器代码是:

  [Authorize]
        [HttpPost]
        public IHttpActionResult Attend([FromBody] int gigId)
        {

            var attendance = new Attdendance
            {
                GigId =  gigId,
                AttendeeId = User.Identity.GetUserId()
            };

            _context.Attdendances.Add(attendance);
            _context.SaveChanges();
            return Ok();
        }
Run Code Online (Sandbox Code Playgroud)

我的请求看起来像http://prntscr.com/c8wz0b

我正在使用这个先进的Postman休息客户端http://prntscr.com/c8xafd

我如何通过Postman授权?

c# asp.net-web-api postman

6
推荐指数
1
解决办法
2万
查看次数