AuthorizationInterceptor class

Interceptor that attaches the authorziation header if needed. If the request already contains the header, it is not overwritten. The token is public, so it can be updated in later stages of the application, for example when rolling tokens are used.

Constructors

AuthorizationInterceptor(String token, {String type = 'Bearer'})

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
getter/setter pair

Methods

interceptStreaming<TRequest, TResponse>(ClientMethod<TRequest, TResponse> method, Stream<TRequest> requests, CallOptions options, ClientStreamingInvoker<TRequest, TResponse> invoker) → ResponseStream<TResponse>
interceptUnary<TRequest, TResponse>(ClientMethod<TRequest, TResponse> method, TRequest request, CallOptions options, ClientUnaryInvoker<TRequest, TResponse> invoker) → ResponseFuture<TResponse>
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