标签: basic-authentication

Spring安全性与Tomcat基本授权之间的冲突

在Tomcat下激活基本授权时,是否有人面临Spring安全登录的问题?

注销后加载登录页面时无法登录.如果你刷新页面然后再试一次,一切都很好:)(.

tomcat spring-security basic-authentication

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

如何注销用户以进行基本 HTTP 身份验证

是否有解决方案可以注销用户(让浏览器清除其缓存的凭据并要求用户再次登录凭据)以进行基本的 HTTP 身份验证?

我已经浏览了以下问题:

browser authentication basic-authentication

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

如何使用nginx.conf在基本授权中获取用户名/密码?

在基本授权中是否有任何函数获取用户名/密码nginx.conf?

谢谢.

nginx basic-authentication

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

使用 HttpClient 时出现未经授权的错误

using System;
using System.Collections.Generic;
using System.Net;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Text;

namespace ConsoleProgram
{
    public class Class1
    {
        private const string URL = "https://sun.domain.com/v1/service/token";
        static void Main(string[] args)
        {
            var handler = new HttpClientHandler();
            handler.Credentials = new System.Net.NetworkCredential("admin@client", "admin");
            HttpClient client = new HttpClient(handler);
            //client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Basic", Convert.ToBase64String(Encoding.ASCII.GetBytes(String.Format("{0}:{1}", "admin", "admin"))));
            //  client.BaseAddress = new Uri(URL);
            // Add an Accept header for JSON format.
            client.DefaultRequestHeaders.Accept.Add(
            new MediaTypeWithQualityHeaderValue("application/json"));
            // List data response.
            HttpResponseMessage response = client.GetAsync(URL).Result;  // Blocking call!
            String …
Run Code Online (Sandbox Code Playgroud)

c# httpclient basic-authentication

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

Node和openssl库的Base64编码产生不同的输出

为什么以下产生不同的输出?

  1. OpenSSL命令行
echo Chris | openssl base64
# Q2hyaXMK
Run Code Online (Sandbox Code Playgroud)
  1. Node.js的
new Buffer('Chris').toString('base64')
// Q2hyaXM=
Run Code Online (Sandbox Code Playgroud)

我正在尝试使用该passport-http库进行基本身份验证,它似乎期望编码数据的格式为#1.这对我来说是一个问题,因为我的所有测试都依赖于Node来生成编码数据(mocha,supertest).

base64 openssl echo basic-authentication node.js

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

Apache 2.4 .htaccess 通过 Request_URI 绕过基本身份验证

我有一个使用 Silex 运行的 PHP 应用程序,该应用程序受基本身份验证保护,但我需要该应用程序的一部分来不要求输入密码。我可以在 Apache 2.2 中做到这一点,但它似乎不适用于 2.4。这是我的 .htaccess

SetEnvIf Request_URI ^/register noauth=1
AuthType Basic
AuthName "Auth"
AuthUserFile /path/to/.htpasswd
Order Deny,Allow
Satisfy any
Deny from all
Require valid-user
Allow from env=noauth
Run Code Online (Sandbox Code Playgroud)

我知道 Apache 2.4 有不同的方式来做到这一点,有人知道吗?

php basic-authentication silex apache2.4

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

Edge 浏览器中的“基本身份验证”

Edge 浏览器中的“基本身份验证”没有保存密码的选项。当浏览器关闭并重新打开时,用户必须重新输入密码。

有人对此有任何解决办法吗?

authentication basic-authentication microsoft-edge

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

使用 Laravel Curl 库的 Http 基本身份验证

我正在使用https://github.com/ixudra/curl作为 Laravel 的 Curl 库,有谁知道如何通过 Curl 库运行以下命令;

curl_setopt($process, CURLOPT_USERPWD, $username . ":" . $password);
Run Code Online (Sandbox Code Playgroud)

我需要使用 HTTP 基本身份验证来卷曲一个 url,但似乎无法使用这个库来完成。

php curl basic-authentication laravel

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

是否可以从经过身份验证的站点加载渐进式 Web 应用程序清单文件?

我在 SharePoint 文档库中有渐进式 Web 应用程序 index.html 页面和资产。我需要在访问 index.html 页面时进行身份验证。但是<link rel="manifest" href="manifest.json.txt">当从 index.html 页面请求时,作为链接的 manifest.json 文件没有所需的身份验证 cookie。请注意,SharePoint 不提供 .jon 文件,这就是它以 .txt 结尾的原因。有没有办法从经过身份验证的站点检索清单?

当我将清单放在可匿名访问的位置时,即在 SharePoint 之外(我现在使用我的保管箱),它就可以工作。在这种情况下,我需要为 start_url 指定完整路径。但这不是一个非常好的部署模型,因为我需要将文件部署到两个不同的位置......

basic-authentication progressive-web-apps

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

如何禁用浏览器基本身份验证弹出窗口 - Angular 5 + Spring Security

我对浏览器制作的基本身份验证弹出窗口有问题。尽管有 Angular 中的登录表单,但在输入凭据并单击登录按钮后,浏览器会创建基本身份验证弹出窗口。当我登录浏览器弹出窗口时,一切正常。在每个请求中都有这些标头:

private createLoginHeaders(email: string, password: string): Headers {
    let headers: Headers = new Headers();
    headers.append("Authorization", "Basic " + btoa(email + ":" + password));
    headers.append("Content-Type", "application/x-www-form-urlencoded");
    headers.append("X-Requested-With", "XMLHttpRequest");

    return headers;
 }
Run Code Online (Sandbox Code Playgroud)

并且标头应用于此请求:

login(email: string, password: string): Observable<User> {
    let headers = this.createLoginHeaders(email, password);

    return this.http.post<User>(`api/user/secure/current`, {headers: headers}).do(
      (user: User) => {
        this.saveUserToLocalStorage(user);
      }
    ).catch(err => {
      if (err.status === 401) {
        return Observable.throw('Unauthorized');
      }
    });
 }
Run Code Online (Sandbox Code Playgroud)

Do() 函数可以在我得到响应时做一些事情而不改变可观察对象中的任何内容。下面是上面代码的消费者方法:

 login(email: string, password: string) {
    if(!this.authenticationService.isAuthenticated()) {
      this.authenticationService.login(email, password).subscribe(
        () => …
Run Code Online (Sandbox Code Playgroud)

java spring spring-security basic-authentication angular5

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