Hello
I am able to authenticate using Unirest library using email address and token.
Is it possible to just use bearer token and not have email address as part of authentication.
Postman authentication just uses bearer token to authenticate how can I do it using java program.
Please let me know.
The following program works using email and token.
package main;
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.JsonNode;
import com.mashape.unirest.http.Unirest;
public class UniRestTest {
public static void main(String[] args) {
try {
HttpResponse<JsonNode> response = Unirest.get("https://xxx.atlassian.net/rest/api/3/issue/KAN-1")
.basicAuth("xxx@gmail.com", "ATATT3xFfGF00B16Long")
.header("Accept", "application/json")
.asJson();
System.out.println(response.getBody());
}catch(Exception e) {
System.out.println(e.getMessage());
}
}
}