惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

B
Blog RSS Feed
有赞技术团队
有赞技术团队
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
阮一峰的网络日志
阮一峰的网络日志
V
V2EX
Y
Y Combinator Blog
Jina AI
Jina AI
G
Google Developers Blog
Last Week in AI
Last Week in AI
博客园 - 叶小钗
H
Hackread – Cybersecurity News, Data Breaches, AI and More
L
LangChain Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
V
Visual Studio Blog
aimingoo的专栏
aimingoo的专栏
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
J
Java Code Geeks
Stack Overflow Blog
Stack Overflow Blog
IT之家
IT之家
The GitHub Blog
The GitHub Blog
D
Docker
量子位
罗磊的独立博客
腾讯CDC

博客园 - xgqfrms

xgqfrms, cnblogs, blogs xgqfrms, cnblogs, blogs xgqfrms, cnblogs, blogs xgqfrms, cnblogs, blogs xgqfrms, cnblogs, blogs xgqfrms, cnblogs, blogs xgqfrms, cnblogs, blogs xgqfrms, cnblogs, blogs xgqfrms, cnblogs, blogs xgqfrms, cnblogs, blogs xgqfrms, cnblogs, blogs xgqfrms, cnblogs, blogs xgqfrms, cnblogs, blogs xgqfrms, cnblogs, blogs xgqfrms, cnblogs, blogs xgqfrms, cnblogs, blogs xgqfrms, cnblogs, blogs xgqfrms, cnblogs, blogs xgqfrms, cnblogs, blogs xgqfrms, cnblogs, blogs xgqfrms, cnblogs, blogs xgqfrms, cnblogs, blogs xgqfrms, cnblogs, blogs Remotion Video Maker All In One git worktree All In One Tesla 的车机使用什么技术来渲染汽车模型的? 宜家 VEVELSTAD 维维斯托床架 All In One macOS sysmond bug All In One Three.js All In One The COF of LCD Monitor All In One
xgqfrms, cnblogs, blogs
xgqfrms · 2026-09-20 · via 博客园 - xgqfrms

HTTP authentication All In One

Authorization: <type> <credentials>
Proxy-Authorization: <type> <credentials>

Authentication schemes

HTTP authentication schemes

Basic
See RFC 7617, base64-encoded credentials. More information below.

Bearer
See RFC 6750, bearer tokens to access OAuth 2.0-protected resources

Digest
See RFC 7616. Firefox 93 and later support the SHA-256 algorithm. Previous versions only support MD5 hashing (not recommended).

HOBA
See RFC 7486, Section 3, HTTP Origin-Bound Authentication, digital-signature-based

Mutual
See RFC 8120

Negotiate / NTLM
See RFC4599

VAPID
See RFC 8292

SCRAM
See RFC 7804

AWS4-HMAC-SHA256
See AWS docs. This scheme is used for AWS3 server authentication.

Schemes can differ in security strength and in their availability in client or server software.

The "Basic" authentication scheme offers very poor security, but is widely supported and easy to set up.

https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/Authentication#authentication_schemes

IANA

image

https://www.iana.org/assignments/http-authschemes

demos

Nest.js Guard

import { CanActivate, ExecutionContext, Injectable } from '@nestjs/common';
import type { Request } from 'express';
import { Observable } from 'rxjs';

@Injectable()
export class ProfilesGuard implements CanActivate {
  canActivate(
    context: ExecutionContext,
  ): boolean | Promise<boolean> | Observable<boolean> {
    // const request = context.switchToHttp().getRequest();
    const request = context.switchToHttp().getRequest<Request>();
    console.log(`ProfilesGuard request: ${request?.toString()}`);
    // console.log(`ProfilesGuard request.method: ${request?.method}`);
    // console.log(`ProfilesGuard request.url: ${request?.url}`);
    // console.log(`ProfilesGuard request.body: ${JSON.stringify(request?.body)}`);
    // console.log(`ProfilesGuard request.params: ${JSON.stringify(request?.params)}`);
    // console.log(`ProfilesGuard request.query: ${JSON.stringify(request?.query)}`);
    // HTTP/1.1 403 Forbidden ✅
    // https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/403
    // return false;
    // HTTP/1.1 201 Created ✅
    // https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/201
    return true;
    // authorization 授权 微服务,用于注册授权
    // https://developer.mozilla.org/en-US/search?q=authorization
    // https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Authorization
    // https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/Proxy-Authorization
    // authentication 身份验证 微服务,用于登录识别
    // https://developer.mozilla.org/en-US/docs/Web/HTTP/Guides/Authentication
    // https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/WWW-Authenticate
    // return authenticate(request);
  }
}

OAuth 2.0 ✅

image

https://oauth.net/2/

https://datatracker.ietf.org/wg/oauth/about/

OAuth 2.0 Playground

https://www.oauth.com/playground/

OAuth 2.1 ❓

https://datatracker.ietf.org/doc/html/draft-ietf-oauth-v2-1

refs

https://www.cnblogs.com/xgqfrms/p/11393381.html

https://www.cnblogs.com/xgqfrms/p/13652398.html



©xgqfrms 2012-2021

www.cnblogs.com/xgqfrms 发布文章使用:只允许注册用户才可以访问!

原创文章,版权所有©️xgqfrms, 禁止转载 🈲️,侵权必究⚠️!