Authenticating User from Cloud Function

Hello,
I am trying to authenticate my unity client from cloud, but I am getting error message

Response {ā€œcodeā€:141,ā€œerrorā€:ā€œMoralis.authenticate is not a functionā€}

My cloud function is below

Moralis.Cloud.define(ā€œLoginUserā€, async(request)=>{
Moralis.authenticate().then(function (user) {
return (user.get(ā€˜ethAddress’))
})
})

try login instead of authenticate, authenticate works in front end

not sure what you want to do there

I want to auth with metamask and then update my client UI on its success.

You want to authenticate with MetaMask in cloud code?

yes! exactly this is what I want… Also I need to make one more function for transferring binance to buy in game currency.

How does that authentication with MetaMask work in cloud code? How do you sign a message?

To make transfers you will need a RPC url and a hardcoded private key, I’m case that you want to do it in cloud code and not in front end.