All Downloads are FREE. Search and download functionalities are using the official Maven repository.

dart2-v3template.auth.oauth.mustache Maven / Gradle / Ivy

Go to download

dart2 generator from openapi 3.x spec files. Changing to openapitools dependencies.

There is a newer version: 4.7
Show newest version
part of {{pubName}}.api;

class OAuth implements Authentication {
  String _accessToken;

  OAuth({String accessToken}) : _accessToken = accessToken;

  @override
  void applyToParams(List queryParams, Map headerParams) {
    if (_accessToken != null) {
      headerParams["Authorization"] = "Bearer $_accessToken";
    }
  }

  set accessToken(String accessToken) => _accessToken = accessToken;
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy