BearerCredential class
A HTTP Bearer Credential for the Authorization
header.
- Inheritance
-
- Object
- Credential
- BearerCredential
Constructors
- BearerCredential(String token)
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- token → String
-
The token String.
final
- type → String
-
Returns type
Bearer
.no setteroverride - usesAuthorizationHeader → bool
-
Returns
true
.no setteroverride
Methods
-
buildAuthorizationHeaderLine(
) → String -
Builds the
Authorization
header.override -
buildBody(
HttpRequestBody body) → HttpRequestBody? -
Builds the HttpRequest body. Used by credentials that injects tokens/credentials in the body.
inherited
-
buildURL(
String url) → String? -
Builds the HttpRequest URL. Used by credentials that injects tokens/credentials in the URL.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
findToken(
Map json, String tokenKey) → dynamic -
Finds the token inside a
json
map using thetokenKey
.tokenKey
can be a tree path using/
as node delimiter. -
fromJSONToken(
dynamic json, [String mainTokenKey = 'access_token', List< String> extraTokenKeys = _defaultExtraTokenKeys]) → BearerCredential? - Instance from a JSON.
-
isValidTokenValue(
dynamic v) → bool -
Returns
true
if the token is a valid value.