Hello everyone,
I have been using the code from the API documentation to build an automation scanning.
But when I’m running the code, it gives the error :
“gvm.errors.GvmResponseError: Response Error 400. Only command GET_VERSION is allowed before AUTHENTICATE”
Hello lately i was having the same problem and i wasn’t able to find the solution anywhere so i started debugging the api code and i came up with a solution.
this is the code before the problem
with Gmp(connection=connection, transform=transform) as gmp:
gmp.authenticate(username, password)
return gmp
the gmp object in this situation does not keep the authentication and you need to re-authenticate in all the methods that comes after.
with Gmp(connection=connection, transform=transform) as gmp:
return gmp
and after that to create a target for exemple do this