How to use basic authentication with Rest Assured in this situation

I am trying to use authentication with RestAssured. Here is my code that does not work:

public static void authenticate(){

RestAssured.baseURI = "https://randomUrl/login";
RequestSpecification request = RestAssured.given().auth().basic("user@google.com", "password123");
Response response = request.get();
System.out.println(response.asString());}

A big reason for which this does not work is that I am missing certain things because when i look at the actual request in postman, there is more info in the tabs there as follows:

Authorization: Basic Auth: 
Username:"client"
Password:"pass"

Headers: 
Authorization: Basic Y2xpZW50OnBhc3N3b3Jk
Content-Type: application/x-www-form-urlencoded

Body:
username:"user@google.com"
password:"password123"
grant_type:"password"

My question is what are the missing pieces in my code and how do integrate them so that the authorization works?

Thank you

How many English words
do you know?
Test your English vocabulary size, and measure
how many words do you know
Online Test
Powered by Examplum