title: How to automatically get Bearer Token using REST Assured
body: <p>I am using Postman currently to generate Bearer Token, which I am using in my automated tests. Now I would like to automate also the Bearer Token generation process too using REST Assured in Java. Please help me. Thanks.</p>
  
  <p><a href="https://i.stack.imgur.com/hDS2y.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/hDS2y.jpg" alt="enter image description here"></a></p>
  
  <pre><code>Response response =
        given()
            .auth()
            .oauth(
                "n0pCrq5SPgraZ3CyY0Nd",
                "xvvx-LVd5dszLi9OO_1qjbU4eUQ4dXwLrDZN7oioSITr_EXrgsyyOvPvZmv85Ew2",
                "",
                "",
                    "HMAC-SHA256")
            .when()
            .get(url)
            .then()
            .contentType(ContentType.JSON)
            .extract()
            .response();
  </code></pre>