But I do not know where to get the secret. For the token, I found out that running rsconnect::accountInfo(name = 'myname') returns a list that includes my token, but have no clue of where can I find the secret string. Any ideas?
When deploying from RStudio with the Publishing button everything's fine.
For programmatic deployment using rsconnect it is best to use an API-key and connect using rsconnect::connectApiUser(), c.f. From R - RStudio Connect: User Guide.