Open 0xNF opened 2 years ago
Facing the same issue.
This method used to exist, but since we've updated to the newer version with dart null-safety its not there anymore. We are not able to update the auth token anymore. Any one got a workaround for this?
@0xNF In my case, HttpBearerAuth is working fine with this code: (openapi-generator-cli 6.0.1)
var authentication = HttpBearerAuth();
authentication.accessToken = initialToken;
var client = ApiClient(
basePath: 'https://.../api/v2',
authentication: authentication,
);
final api = SystemApi(client);
ApiKeyAuth seems supporting cookie. The code will be like this:
var authentication = ApiKeyAuth('cookie', 'paramName');
authentication.apiKey = 'YOUR_API_KEY';
// authentication.apiKeyPrefix = 'Bearer';
var client = ApiClient(
authentication: authentication,
);
final api = UserApi(client);
Description
See: https://github.com/OpenAPITools/openapi-generator/blob/df05e6f4bc6265ba4de801ba306f75dd7278e119/samples/openapi3/client/petstore/dart2/petstore_client_lib/doc/UserApi.md
But the
ApiClient
class has no such method. Here are the available methods on the object:There's a
.authentication
object but the interface only has a singlevoid applyToParams(List<QueryParam> queryParams, Map<String, String> headerParams);
function.Consequently, I don't know what the canonical way to do auth, and specifically Cookie Auth is.
openapi-generator version
commit 559a2618dfe62dc8b86d0eb169bb4d998774a21f, Sunday May 15 2022