You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
Next: Root
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
Hello everybody i wrote a simple jersey rest client to set data to the audit log
but i get a 401 Unauthorized someone have a idea what the problem is?
public ClientResponse addToAudit() {
String test = "{" +
" \"id\": 1," +
" \"timestamp\": \"2020-02-10T13:00:00.000+0000\"," +
" \"author\": {" +
" \"id\": 1," +
" \"name\": \"admin\"," +
" \"type\": \"USER\"" +
" }," +
" \"eventType\": \"APPLICATION_CREATED\"," +
" \"entities\": [" +
" {" +
" \"id\": 12," +
" \"name\": \"Jira 7.4\"," +
" \"type\": \"APPLICATION\"," +
" \"subtype\": \"JIRA\"," +
" \"primary\": true" +
" }" +
" ]," +
" \"ipAddress\": \"127.0.0.1\"," +
" \"eventMessage\": \"Application modified\"," +
" \"entries\": [" +
" {" +
" \"propertyName\": \"name\"," +
" \"oldValue\": \"JIRA 7.2\"," +
" \"newValue\": \"Jira 7.4\"" +
" }" +
" ]" +
"}";
try {
webResource = client.resource("http://10.14.1.178:8095/crowd/rest/admin/1.0/auditlog");System.out.println(encodeToBase64());
clientResponse = webResource.header("Authorization","Basic " + encodeToBase64()).type("application/json").accept("application/json").post(ClientResponse.class,test);
return clientResponse;
} catch (Exception e) {
e.printStackTrace();
return null;
}
Ok the problem was that for the usermanagement path u need the application as user and for the admin path u need a user as user
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.