<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 12pt;
font-family:Calibri
}
--></style></head>
<body class='hmmessage'><div dir='ltr'><div><div dir="ltr"><div class="ecxgmail_quote"><div dir="ltr"><div><div class="ecxgmail_quote"><div dir="ltr">Hi guys,<div>I apologize if i am not suppose to set communication to the whole group like this.</div><div>I am not able to start a thread in the key cloak forum so am trying this option.</div><div><br><div>I am new to Keycloak and trying to create a user via REST call and i am getting 401 Unauthorized error.</div><div>So this what i am trying to do</div><div>1. Start the Keycloak server </div><div>2. Create a realm- test-realm and assigned manag-user role to it</div><div>3. Create user "test-realm-user01" and assigned all the roles i could to him.</div><div>4. In my java code, i get a token and then i am trying to create a user using that token and it throws 401</div><div><br></div><div>Attached is the code of what i am doing.</div><div><br></div><div>Please let me know if i am doing anything wrong here.</div><div><br></div><div>(I understand that we should UI from doing all the stuff..but here i am that i want to try this out)</div>
</div></div>
</div><br></div></div>
</div><br></div></div>                                            </div></body>
</html>