isValidBearerToken static method

bool isValidBearerToken(
  1. String candidate
)

Whether candidate can be used as a bearer token.

We limit tokens to be valid bearer tokens according to https://www.rfc-editor.org/rfc/rfc6750#section-2.1

Implementation

static bool isValidBearerToken(String candidate) =>
    RegExp(r'^[a-zA-Z0-9._~+/=-]+$').hasMatch(candidate);