It has become increasingly common to use bearer tokens as an authentication mechanism in various protocols.
A bearer token is a security token with the property that any party in possession of the token (a "bearer") can use the token in any way that any other party in possession of it can. Using a bearer token does not require a bearer to prove possession of cryptographic key material (proof-of-possession).
Unfortunately, the number of security incidents involving accidental disclosure of these tokens has also increased. For example, we now regularly hear about a developer committing an access token to a public source code repository, either because they didn't realize it was included in the committed code or because they didn't realize the implications of its disclosure.
This specification registers the "secret-token" URI scheme to aid prevention of such accidental disclosures. When tokens are easier to unambiguously identify, they can trigger warnings in continuous integration systems or be used in source code repositories themselves. They can also be scanned for separately.
For example, if cloud.example.net issues access tokens to its clients for later use, and it does so by formatting them as "secret-token" URIs, tokens that "leak" into places that they don't belong are easier to identify. This could be through a variety of mechanisms; for example, if repo.example.com can be configured to refuse commits containing "secret-token" URIs, it helps its customers avoid accidental disclosures.
"secret-token" URIs are intended to aid in identification of generated secrets, like API keys and similar tokens. They are not intended for use in controlled situations where ephemeral tokens are used, such as things like Cross-Site Request Forgery (CSRF) tokens.
The key words "
MUST", "
MUST NOT", "
REQUIRED", "
SHALL", "
SHALL NOT", "
SHOULD", "
SHOULD NOT", "
RECOMMENDED", "
NOT RECOMMENDED", "
MAY", and "
OPTIONAL" in this document are to be interpreted as described in BCP 14 [
RFC 2119] [
RFC 8174] when, and only when, they appear in all capitals, as shown here.
This document uses ABNF [
RFC 5234]. It also uses the pchar rule from [
RFC 3986].