title: How to use basic authentication with Rest Assured in this situation
body: <p>I am trying to use authentication with RestAssured.
  Here is my code that does not work:</p>
  <pre><code>public static void authenticate(){
  
  RestAssured.baseURI = &quot;https://randomUrl/login&quot;;
  RequestSpecification request = RestAssured.given().auth().basic(&quot;user@google.com&quot;, &quot;password123&quot;);
  Response response = request.get();
  System.out.println(response.asString());}
  </code></pre>
  <p>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:</p>
  <pre><code>Authorization: Basic Auth: 
  Username:&quot;client&quot;
  Password:&quot;pass&quot;
  
  Headers: 
  Authorization: Basic Y2xpZW50OnBhc3N3b3Jk
  Content-Type: application/x-www-form-urlencoded
  
  Body:
  username:&quot;user@google.com&quot;
  password:&quot;password123&quot;
  grant_type:&quot;password&quot;
  </code></pre>
  <p>My question is what are the missing pieces in my code and how do integrate them so that the authorization works?</p>
  <p>Thank you</p>