Authorizer constructor
Authorizer(
- AuthValidator? validator, {
- AuthorizationParser parser = const AuthorizationBearerParser(),
- List<
String> ? scopes,
Creates an instance of Authorizer.
Use this constructor to provide custom AuthorizationParsers.
By default, this instance will parse bearer tokens from the authorization header, e.g.:
Authorization: Bearer ap9ijlarlkz8jIOa9laweo
If scopes
is provided, the authorization granted must have access to all scopes according to validator
.
Implementation
Authorizer(
this.validator, {
this.parser = const AuthorizationBearerParser(),
List<String>? scopes,
}) : scopes = scopes?.map((s) => AuthScope(s)).toList();