代码之家  ›  专栏  ›  技术社区  ›  Stéphane GRILLON

身份验证标头与授权标头?

  •  0
  • Stéphane GRILLON  · 技术社区  · 7 年前

    我在Web项目中找到以下代码:

    const customHeaders = new HttpHeaders({
          'clientId': env.apiKey,
          'Authorization': `Bearer ${authorization}`,
          'Authentication': `Bearer ${authentication}`
    });
    return this.http.get<UserInfo>(`${env.baseApi}/login`, { headers: customHeaders });
    

    我知道标题' Authorization '在Spring Security中,但标题有什么区别' Authentication '? 为了获得最佳实践,我们是否应该将两者都放在一起?

    1 回复  |  直到 7 年前
        1
  •  0
  •   Stéphane GRILLON    6 年前

    Authentication 是自定义标题。这不是官方标题吗。