If I use the REST API to leave a comment, the author will be me.
Is there a way to leave a Jira issue comment on behalf of the other user?
Can cookie-based authentication or OAuth help?
I am not too sure I understand your description, however, I do understand the title.
I do not think it is possible to change the author of a comment or to add a comment on behalf of someone else.
The API does not allow you to add a comment on behalf of someone else.
You can only post the Comment and the visibility (by role)
Also, you can not change the Author of the Comment unless you update the database. THIS IS NOT SUPPORTED by Atlassian.