<div dir="ltr"><div>The realm you pass into Keycloak.getInstance is the realm you are authenticating the user with. Is your admin user in the master realm? If so use "master" there instead of "forum".<br></div><div><br></div><div>The other issue you are seeing is related to the version of Jackson you are using. In 1.9.0.CR1 we upgraded to Jackson2 (fasterxml), in 1.8.0 we required Jackson1. Take a look at the admin-client example it shows how to exclude Jackson2 and include Jackson1 instead. Or you can upgrade to 1.9.0.CR1.</div><div><br></div><div class="gmail_extra"><br><div class="gmail_quote">On 11 February 2016 at 00:49, Charles Queiroz <span dir="ltr"><<a href="mailto:charles@dazen.com.br" target="_blank">charles@dazen.com.br</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div style="word-wrap:break-word">Hi folks, <div><br></div><div>I’m trying programmatically add user in keycloak server using the admin client (version 1.8.0.RC3) like this post show (link: <a href="http://www.first8.nl/blog/programmatically-adding-users-in-keycloak/" target="_blank">http://www.first8.nl/blog/programmatically-adding-users-in-keycloak/</a> ), but no success yet! ;( </div><div><br></div><div><br></div><div><br></div><div>The Steps: </div><div><br></div><div>1 - Add dependence on pom.xml like:</div><div><br></div><div><pre style="color:rgb(169,183,198);font-family:Menlo;font-size:9pt;background-color:rgb(43,43,43)"><span style="color:rgb(232,191,106)"><dependency><br></span><span style="color:rgb(232,191,106)"> <groupId></span>org.keycloak<span style="color:rgb(232,191,106)"></groupId><br></span><span style="color:rgb(232,191,106)"> <artifactId></span>keycloak-admin-client<span style="color:rgb(232,191,106)"></artifactId><br></span><span style="color:rgb(232,191,106)"> <version></span>1.8.0.CR3<span style="color:rgb(232,191,106)"></version><br></span><span style="color:rgb(232,191,106)"></dependency></span></pre><div><br></div></div><div>2 - Implement the method body like:</div><div><br></div><div><pre style="background-color:rgb(43,43,43)"><font color="#a9b7c6" face="Menlo"><span style="font-size:9pt"><br></span></font><span style="color:rgb(204,120,50);font-family:Menlo;font-size:9pt">public </span><font color="#a9b7c6" face="Menlo"><span style="font-size:9pt">User </span></font><span style="color:rgb(255,198,109);font-family:Menlo;font-size:9pt">save</span><font color="#a9b7c6" face="Menlo"><span style="font-size:9pt">(User user) {<br> Keycloak kc = Keycloak.</span></font><span style="color:rgb(169,183,198);font-family:Menlo;font-size:9pt;font-style:italic">getInstance</span><font color="#a9b7c6" face="Menlo"><span style="font-size:9pt">(</span></font><span style="color:rgb(106,135,89);font-family:Menlo;font-size:9pt">"<a href="http://localhost:8080/auth" target="_blank">http://localhost:8080/auth</a>"</span><span style="color:rgb(204,120,50);font-family:Menlo;font-size:9pt">, </span><span style="color:rgb(106,135,89);font-family:Menlo;font-size:9pt">"forum"</span><span style="color:rgb(204,120,50);font-family:Menlo;font-size:9pt">, </span><font color="#6a8759" face="Menlo"><span style="font-size:12px">“</span></font><span style="color:rgb(106,135,89);font-family:Menlo;font-size:9pt">admin"</span><span style="color:rgb(204,120,50);font-family:Menlo;font-size:9pt">, </span><font color="#6a8759" face="Menlo"><span style="font-size:12px">“</span></font><span style="color:rgb(106,135,89);font-family:Menlo;font-size:9pt">admin"</span><span style="color:rgb(204,120,50);font-family:Menlo;font-size:9pt">, </span><span style="color:rgb(106,135,89);font-family:Menlo;font-size:9pt">"security-admin-console"</span><font color="#a9b7c6" face="Menlo"><span style="font-size:9pt">)</span></font><span style="color:rgb(204,120,50);font-family:Menlo;font-size:9pt">;<br></span><span style="color:rgb(204,120,50);font-family:Menlo;font-size:9pt"><br></span><span style="color:rgb(204,120,50);font-family:Menlo;font-size:9pt"> </span><font color="#a9b7c6" face="Menlo"><span style="font-size:9pt">CredentialRepresentation credential = </span></font><span style="color:rgb(204,120,50);font-family:Menlo;font-size:9pt">new </span><font color="#a9b7c6" face="Menlo"><span style="font-size:9pt">CredentialRepresentation()</span></font><span style="color:rgb(204,120,50);font-family:Menlo;font-size:9pt">;<br></span><span style="color:rgb(204,120,50);font-family:Menlo;font-size:9pt"> </span><font color="#a9b7c6" face="Menlo"><span style="font-size:9pt">credential.setType(CredentialRepresentation.</span></font><span style="color:rgb(152,118,170);font-family:Menlo;font-size:9pt;font-style:italic">PASSWORD</span><font color="#a9b7c6" face="Menlo"><span style="font-size:9pt">)</span></font><span style="color:rgb(204,120,50);font-family:Menlo;font-size:9pt">;<br></span><span style="color:rgb(204,120,50);font-family:Menlo;font-size:9pt"> </span><font color="#a9b7c6" face="Menlo"><span style="font-size:9pt">credential.setValue(user.getPassword())</span></font><span style="color:rgb(204,120,50);font-family:Menlo;font-size:9pt">;<br></span><span style="color:rgb(204,120,50);font-family:Menlo;font-size:9pt"> </span><font color="#a9b7c6" face="Menlo"><span style="font-size:9pt">UserRepresentation newUser = </span></font><span style="color:rgb(204,120,50);font-family:Menlo;font-size:9pt">new </span><font color="#a9b7c6" face="Menlo"><span style="font-size:9pt">UserRepresentation()</span></font><span style="color:rgb(204,120,50);font-family:Menlo;font-size:9pt">;<br></span><span style="color:rgb(204,120,50);font-family:Menlo;font-size:9pt"> </span><font color="#a9b7c6" face="Menlo"><span style="font-size:9pt">newUser.setUsername(user.getLogin())</span></font><span style="color:rgb(204,120,50);font-family:Menlo;font-size:9pt">;<br></span><span style="color:rgb(204,120,50);font-family:Menlo;font-size:9pt"> </span><font color="#a9b7c6" face="Menlo"><span style="font-size:9pt">newUser.setFirstName(user.getName())</span></font><span style="color:rgb(204,120,50);font-family:Menlo;font-size:9pt">;<br></span><span style="color:rgb(204,120,50);font-family:Menlo;font-size:9pt"> </span><font color="#a9b7c6" face="Menlo"><span style="font-size:9pt">newUser.setCredentials(Arrays.</span></font><span style="color:rgb(169,183,198);font-family:Menlo;font-size:9pt;font-style:italic">asList</span><font color="#a9b7c6" face="Menlo"><span style="font-size:9pt">(credential))</span></font><span style="color:rgb(204,120,50);font-family:Menlo;font-size:9pt">;<br></span><span style="color:rgb(204,120,50);font-family:Menlo;font-size:9pt"><br></span><span style="color:rgb(204,120,50);font-family:Menlo;font-size:9pt"> </span><font color="#a9b7c6" face="Menlo"><span style="font-size:9pt">kc.realm(</span></font><span style="color:rgb(106,135,89);font-family:Menlo;font-size:9pt">"forum"</span><font color="#a9b7c6" face="Menlo"><span style="font-size:9pt">).users().create(newUser)</span></font><span style="color:rgb(204,120,50);font-family:Menlo;font-size:9pt">;<br></span><span style="color:rgb(204,120,50);font-family:Menlo;font-size:9pt"><br></span><span style="color:rgb(204,120,50);font-family:Menlo;font-size:9pt"> </span><font color="#a9b7c6" face="Menlo"><span style="font-size:9pt">User saved = </span></font><span style="color:rgb(152,118,170);font-family:Menlo;font-size:9pt">repository</span><font color="#a9b7c6" face="Menlo"><span style="font-size:9pt">.save(user)</span></font><span style="color:rgb(204,120,50);font-family:Menlo;font-size:9pt">;<br></span><span style="color:rgb(204,120,50);font-family:Menlo;font-size:9pt"> </span><span style="color:rgb(152,118,170);font-family:Menlo;font-size:9pt">savedUser</span><font color="#a9b7c6" face="Menlo"><span style="font-size:9pt">.fire(saved)</span></font><span style="color:rgb(204,120,50);font-family:Menlo;font-size:9pt">;<br></span><span style="color:rgb(204,120,50);font-family:Menlo;font-size:9pt"> return </span><font color="#a9b7c6" face="Menlo"><span style="font-size:9pt">saved</span></font><span style="color:rgb(204,120,50);font-family:Menlo;font-size:9pt">;<br></span><font color="#a9b7c6" face="Menlo"><span style="font-size:9pt">}<br><br></span></font></pre><div><br></div></div><div>When I run the app, the exception thrown is: </div><div><br></div><div><div><font face="Consolas" style="font-size:12px">20:46:03,583 DEBUG [org.apache.http.impl.conn.DefaultClientConnection] (default task-14) Sending request: POST /auth/realms/forum/protocol/openid-connect/token HTTP/1.1</font></div><div><font face="Consolas" style="font-size:12px">20:46:03,584 DEBUG [org.apache.http.wire] (default task-14) >> "POST /auth/realms/forum/protocol/openid-connect/token HTTP/1.1[\r][\n]"</font></div><div><font face="Consolas" style="font-size:12px">20:46:03,585 DEBUG [org.apache.http.wire] (default task-14) >> "Accept: application/json[\r][\n]"</font></div><div><font face="Consolas" style="font-size:12px">20:46:03,587 DEBUG [org.apache.http.wire] (default task-14) >> "Accept-Encoding: gzip, deflate[\r][\n]"</font></div><div><font face="Consolas" style="font-size:12px">20:46:03,589 DEBUG [org.apache.http.wire] (default task-14) >> "Content-Type: application/x-www-form-urlencoded[\r][\n]"</font></div><div><font face="Consolas" style="font-size:12px">20:46:03,591 DEBUG [org.apache.http.wire] (default task-14) >> "Content-Length: 82[\r][\n]"</font></div><div><font face="Consolas" style="font-size:12px">20:46:03,592 DEBUG [org.apache.http.wire] (default task-14) >> "Host: localhost:8080[\r][\n]"</font></div><div><font face="Consolas" style="font-size:12px">20:46:03,594 DEBUG [org.apache.http.wire] (default task-14) >> "Connection: Keep-Alive[\r][\n]"</font></div><div><font face="Consolas" style="font-size:12px">20:46:03,596 DEBUG [org.apache.http.wire] (default task-14) >> "[\r][\n]"</font></div><div><font face="Consolas" style="font-size:12px">20:46:03,598 DEBUG [org.apache.http.headers] (default task-14) >> POST /auth/realms/forum/protocol/openid-connect/token HTTP/1.1</font></div><div><font face="Consolas" style="font-size:12px">20:46:03,599 DEBUG [org.apache.http.headers] (default task-14) >> Accept: application/json</font></div><div><font face="Consolas" style="font-size:12px">20:46:03,601 DEBUG [org.apache.http.headers] (default task-14) >> Accept-Encoding: gzip, deflate</font></div><div><font face="Consolas" style="font-size:12px">20:46:03,602 DEBUG [org.apache.http.headers] (default task-14) >> Content-Type: application/x-www-form-urlencoded</font></div><div><font face="Consolas" style="font-size:12px">20:46:03,604 DEBUG [org.apache.http.headers] (default task-14) >> Content-Length: 82</font></div><div><font face="Consolas" style="font-size:12px">20:46:03,605 DEBUG [org.apache.http.headers] (default task-14) >> Host: localhost:8080</font></div><div><font face="Consolas" style="font-size:12px">20:46:03,606 DEBUG [org.apache.http.headers] (default task-14) >> Connection: Keep-Alive</font></div><div><font face="Consolas" style="font-size:12px">20:46:03,610 DEBUG [org.apache.http.wire] (default task-14) >> "grant_type=password&username=admin&password=admin&client_id=security-admin-console"</font></div><div><font face="Consolas" style="font-size:12px">20:46:03,612 DEBUG [org.jboss.resteasy.resteasy_jaxrs.i18n] (default task-15) RESTEASY002315: PathInfo: /realms/forum/protocol/openid-connect/token</font></div><div><font face="Consolas" style="font-size:12px">20:46:03,614 DEBUG [org.keycloak.authentication.AuthenticationProcessor] (default task-15) AUTHENTICATE CLIENT</font></div><div><font face="Consolas" style="font-size:12px">20:46:03,614 DEBUG [org.keycloak.authentication.AuthenticationProcessor] (default task-15) client authenticator: client-secret</font></div><div><font face="Consolas" style="font-size:12px">20:46:03,614 DEBUG [org.keycloak.authentication.AuthenticationProcessor] (default task-15) client authenticator SUCCESS: client-secret</font></div><div><font face="Consolas" style="font-size:12px">20:46:03,614 DEBUG [org.keycloak.authentication.AuthenticationProcessor] (default task-15) Client security-admin-console authenticated by client-secret</font></div><div><font face="Consolas" style="font-size:12px">20:46:03,615 DEBUG [org.keycloak.authentication.AuthenticationProcessor] (default task-15) AUTHENTICATE ONLY</font></div><div><font face="Consolas" style="font-size:12px">20:46:03,615 DEBUG [org.keycloak.authentication.DefaultAuthenticationFlow] (default task-15) processFlow</font></div><div><font face="Consolas" style="font-size:12px">20:46:03,615 DEBUG [org.keycloak.authentication.DefaultAuthenticationFlow] (default task-15) check execution: direct-grant-validate-username requirement: REQUIRED</font></div><div><font face="Consolas" style="font-size:12px">20:46:03,616 DEBUG [org.keycloak.authentication.DefaultAuthenticationFlow] (default task-15) authenticator: direct-grant-validate-username</font></div><div><font face="Consolas" style="font-size:12px">20:46:03,616 DEBUG [org.keycloak.authentication.DefaultAuthenticationFlow] (default task-15) invoke authenticator.authenticate</font></div><div><font face="Consolas" style="font-size:12px">20:46:03,617 FINE [org.mongodb.driver.protocol.query] (default task-15) Sending query of namespace forum.users on connection [connectionId{localValue:2, serverValue:184}] to server <a href="http://127.0.0.1:27017" target="_blank">127.0.0.1:27017</a></font></div><div><font face="Consolas" style="font-size:12px">20:46:03,617 FINE [org.mongodb.driver.protocol.query] (default task-15) Query completed</font></div><div><font face="Consolas" style="font-size:12px">20:46:03,618 WARN [org.keycloak.events] (default task-15) type=LOGIN_ERROR, realmId=forum, clientId=security-admin-console, userId=null, ipAddress=127.0.0.1, error=invalid_user_credentials, auth_method=openid-connect, grant_type=password, client_auth_method=client-secret, username=admin</font></div><div><font face="Consolas" style="font-size:12px">20:46:03,619 DEBUG [org.keycloak.authentication.DefaultAuthenticationFlow] (default task-15) authenticator FAILED: direct-grant-validate-username</font></div><div><font face="Consolas" style="font-size:12px">20:46:03,624 DEBUG [org.apache.http.wire] (default task-14) << "HTTP/1.1 401 Unauthorized[\r][\n]"</font></div><div><font face="Consolas" style="font-size:12px">20:46:03,627 DEBUG [org.apache.http.wire] (default task-14) << "Connection: keep-alive[\r][\n]"</font></div><div><font face="Consolas" style="font-size:12px">20:46:03,629 DEBUG [org.apache.http.wire] (default task-14) << "X-Powered-By: Undertow/1[\r][\n]"</font></div><div><font face="Consolas" style="font-size:12px">20:46:03,631 DEBUG [org.apache.http.wire] (default task-14) << "Server: WildFly/10[\r][\n]"</font></div><div><font face="Consolas" style="font-size:12px">20:46:03,632 DEBUG [org.apache.http.wire] (default task-14) << "Transfer-Encoding: chunked[\r][\n]"</font></div><div><font face="Consolas" style="font-size:12px">20:46:03,634 DEBUG [org.apache.http.wire] (default task-14) << "Content-Type: application/json[\r][\n]"</font></div><div><font face="Consolas" style="font-size:12px">20:46:03,636 DEBUG [org.apache.http.wire] (default task-14) << "Date: Wed, 10 Feb 2016 23:46:03 GMT[\r][\n]"</font></div><div><font face="Consolas" style="font-size:12px">20:46:03,637 DEBUG [org.apache.http.wire] (default task-14) << "[\r][\n]"</font></div><div><font face="Consolas" style="font-size:12px">20:46:03,639 DEBUG [org.apache.http.impl.conn.DefaultClientConnection] (default task-14) Receiving response: HTTP/1.1 401 Unauthorized</font></div><div><font face="Consolas" style="font-size:12px">20:46:03,640 DEBUG [org.apache.http.headers] (default task-14) << HTTP/1.1 401 Unauthorized</font></div><div><font face="Consolas" style="font-size:12px">20:46:03,642 DEBUG [org.apache.http.headers] (default task-14) << Connection: keep-alive</font></div><div><font face="Consolas" style="font-size:12px">20:46:03,643 DEBUG [org.apache.http.headers] (default task-14) << X-Powered-By: Undertow/1</font></div><div><font face="Consolas" style="font-size:12px">20:46:03,645 DEBUG [org.apache.http.headers] (default task-14) << Server: WildFly/10</font></div><div><font face="Consolas" style="font-size:12px">20:46:03,646 DEBUG [org.apache.http.headers] (default task-14) << Transfer-Encoding: chunked</font></div><div><font face="Consolas" style="font-size:12px">20:46:03,647 DEBUG [org.apache.http.headers] (default task-14) << Content-Type: application/json</font></div><div><font face="Consolas" style="font-size:12px">20:46:03,649 DEBUG [org.apache.http.headers] (default task-14) << Date: Wed, 10 Feb 2016 23:46:03 GMT</font></div><div><font face="Consolas" style="font-size:12px">20:46:03,651 DEBUG [org.apache.http.impl.client.DefaultHttpClient] (default task-14) Connection can be kept alive indefinitely</font></div><div><font face="Consolas" style="font-size:12px">20:46:03,653 DEBUG [org.apache.http.impl.client.DefaultHttpClient] (default task-14) Authentication required</font></div><div><font face="Consolas" style="font-size:12px">20:46:03,654 DEBUG [org.apache.http.impl.client.DefaultHttpClient] (default task-14) localhost:8080 requested authentication</font></div><div><font face="Consolas" style="font-size:12px">20:46:03,656 DEBUG [org.apache.http.impl.client.DefaultHttpClient] (default task-14) Response contains no authentication challenges</font></div><div><font face="Consolas" style="font-size:12px">20:46:03,665 DEBUG [org.apache.http.wire] (default task-14) << "48[\r][\n]"</font></div><div><font face="Consolas" style="font-size:12px">20:46:03,667 DEBUG [org.apache.http.wire] (default task-14) << "{"error_description":"Invalid user credentials","error":"invalid_grant"}"</font></div><div><font face="Consolas" style="font-size:12px">20:46:03,668 DEBUG [org.apache.http.wire] (default task-14) << "[\r][\n]"</font></div><div><font face="Consolas" style="font-size:12px">20:46:03,670 DEBUG [org.apache.http.wire] (default task-14) << "0[\r][\n]"</font></div><div><font face="Consolas" style="font-size:12px">20:46:03,671 DEBUG [org.apache.http.wire] (default task-14) << "[\r][\n]"</font></div><div><font face="Consolas" style="font-size:12px">20:46:03,673 DEBUG [org.apache.http.impl.conn.BasicClientConnectionManager] (default task-14) Releasing connection org.apache.http.impl.conn.ManagedClientConnectionImpl@1d6c4f71</font></div><div><font face="Consolas" style="font-size:12px">20:46:03,675 DEBUG [org.apache.http.impl.conn.BasicClientConnectionManager] (default task-14) Connection can be kept alive indefinitely</font></div><div><font face="Consolas" style="font-size:12px">20:46:11,315 DEBUG [org.jboss.as.jpa] (default task-14) default task-14:transaction scoped EntityManager [forum.war#ForumPU]: closing entity managersession</font></div><div><font face="Consolas" style="font-size:12px">20:46:11,315 DEBUG [org.hibernate.resource.jdbc.internal.LogicalConnectionManagedImpl] (default task-14) Initiating JDBC connection release from afterTransaction</font></div><div><font face="Consolas" style="font-size:12px">20:46:11,316 ERROR [org.jboss.as.ejb3.invocation] (default task-14) WFLYEJB0034: EJB Invocation failed on component UserRestEndpoint for method public javax.ws.rs.core.Response br.com.projetolead.forum.integration.rest.UserRestEndpoint.save(br.com.projetolead.forum.model.User,javax.servlet.http.HttpServletRequest) throws java.io.IOException: javax.ejb.EJBException: javax.ws.rs.NotAuthorizedException: HTTP 401 Unauthorized</font></div><div><font face="Consolas" style="font-size:12px"><span style="white-space:pre-wrap">        </span>at org.jboss.as.ejb3.tx.CMTTxInterceptor.handleExceptionInOurTx(CMTTxInterceptor.java:187)</font></div></div><div><br></div><div><br></div><div>------</div><div><br></div><div>but, when I change the user to charles (no admin user. login: charles, password: java) the error is: </div><div><br></div><div>------</div><div><br></div><div><div><font face="Consolas" style="font-size:12px">20:41:18,314 DEBUG [org.apache.http.impl.conn.DefaultClientConnection] (default task-14) Sending request: POST /auth/realms/forum/protocol/openid-connect/token HTTP/1.1</font></div><div><font face="Consolas" style="font-size:12px">20:41:18,315 DEBUG [org.apache.http.wire] (default task-14) >> "POST /auth/realms/forum/protocol/openid-connect/token HTTP/1.1[\r][\n]"</font></div><div><font face="Consolas" style="font-size:12px">20:41:18,316 DEBUG [org.apache.http.wire] (default task-14) >> "Accept: application/json[\r][\n]"</font></div><div><font face="Consolas" style="font-size:12px">20:41:18,316 DEBUG [org.apache.http.wire] (default task-14) >> "Accept-Encoding: gzip, deflate[\r][\n]"</font></div><div><font face="Consolas" style="font-size:12px">20:41:18,316 DEBUG [org.apache.http.wire] (default task-14) >> "Content-Type: application/x-www-form-urlencoded[\r][\n]"</font></div><div><font face="Consolas" style="font-size:12px">20:41:18,316 DEBUG [org.apache.http.wire] (default task-14) >> "Content-Length: 83[\r][\n]"</font></div><div><font face="Consolas" style="font-size:12px">20:41:18,316 DEBUG [org.apache.http.wire] (default task-14) >> "Host: localhost:8080[\r][\n]"</font></div><div><font face="Consolas" style="font-size:12px">20:41:18,316 DEBUG [org.apache.http.wire] (default task-14) >> "Connection: Keep-Alive[\r][\n]"</font></div><div><font face="Consolas" style="font-size:12px">20:41:18,316 DEBUG [org.apache.http.wire] (default task-14) >> "[\r][\n]"</font></div><div><font face="Consolas" style="font-size:12px">20:41:18,316 DEBUG [org.apache.http.headers] (default task-14) >> POST /auth/realms/forum/protocol/openid-connect/token HTTP/1.1</font></div><div><font face="Consolas" style="font-size:12px">20:41:18,316 DEBUG [org.apache.http.headers] (default task-14) >> Accept: application/json</font></div><div><font face="Consolas" style="font-size:12px">20:41:18,316 DEBUG [org.apache.http.headers] (default task-14) >> Accept-Encoding: gzip, deflate</font></div><div><font face="Consolas" style="font-size:12px">20:41:18,316 DEBUG [org.apache.http.headers] (default task-14) >> Content-Type: application/x-www-form-urlencoded</font></div><div><font face="Consolas" style="font-size:12px">20:41:18,316 DEBUG [org.apache.http.headers] (default task-14) >> Content-Length: 83</font></div><div><font face="Consolas" style="font-size:12px">20:41:18,316 DEBUG [org.apache.http.headers] (default task-14) >> Host: localhost:8080</font></div><div><font face="Consolas" style="font-size:12px">20:41:18,316 DEBUG [org.apache.http.headers] (default task-14) >> Connection: Keep-Alive</font></div><div><font face="Consolas" style="font-size:12px">20:41:18,316 DEBUG [org.apache.http.wire] (default task-14) >> "grant_type=password&username=charles&password=java&client_id=security-admin-console"</font></div><div><font face="Consolas" style="font-size:12px">20:41:18,318 DEBUG [org.jboss.resteasy.resteasy_jaxrs.i18n] (default task-15) RESTEASY002315: PathInfo: /realms/forum/protocol/openid-connect/token</font></div><div><font face="Consolas" style="font-size:12px">20:41:18,320 DEBUG [org.keycloak.authentication.AuthenticationProcessor] (default task-15) AUTHENTICATE CLIENT</font></div><div><font face="Consolas" style="font-size:12px">20:41:18,320 DEBUG [org.keycloak.authentication.AuthenticationProcessor] (default task-15) client authenticator: client-secret</font></div><div><font face="Consolas" style="font-size:12px">20:41:18,320 DEBUG [org.keycloak.authentication.AuthenticationProcessor] (default task-15) client authenticator SUCCESS: client-secret</font></div><div><font face="Consolas" style="font-size:12px">20:41:18,320 DEBUG [org.keycloak.authentication.AuthenticationProcessor] (default task-15) Client security-admin-console authenticated by client-secret</font></div><div><font face="Consolas" style="font-size:12px">20:41:18,321 DEBUG [org.keycloak.authentication.AuthenticationProcessor] (default task-15) AUTHENTICATE ONLY</font></div><div><font face="Consolas" style="font-size:12px">20:41:18,321 DEBUG [org.keycloak.authentication.DefaultAuthenticationFlow] (default task-15) processFlow</font></div><div><font face="Consolas" style="font-size:12px">20:41:18,321 DEBUG [org.keycloak.authentication.DefaultAuthenticationFlow] (default task-15) check execution: direct-grant-validate-username requirement: REQUIRED</font></div><div><font face="Consolas" style="font-size:12px">20:41:18,322 DEBUG [org.keycloak.authentication.DefaultAuthenticationFlow] (default task-15) authenticator: direct-grant-validate-username</font></div><div><font face="Consolas" style="font-size:12px">20:41:18,322 DEBUG [org.keycloak.authentication.DefaultAuthenticationFlow] (default task-15) invoke authenticator.authenticate</font></div><div><font face="Consolas" style="font-size:12px">20:41:18,322 DEBUG [org.keycloak.authentication.DefaultAuthenticationFlow] (default task-15) authenticator SUCCESS: direct-grant-validate-username</font></div><div><font face="Consolas" style="font-size:12px">20:41:18,322 DEBUG [org.keycloak.authentication.DefaultAuthenticationFlow] (default task-15) check execution: direct-grant-validate-password requirement: REQUIRED</font></div><div><font face="Consolas" style="font-size:12px">20:41:18,322 DEBUG [org.keycloak.authentication.DefaultAuthenticationFlow] (default task-15) authenticator: direct-grant-validate-password</font></div><div><font face="Consolas" style="font-size:12px">20:41:18,322 DEBUG [org.keycloak.authentication.DefaultAuthenticationFlow] (default task-15) invoke authenticator.authenticate</font></div><div><font face="Consolas" style="font-size:12px">20:41:18,323 DEBUG [org.keycloak.authentication.DefaultAuthenticationFlow] (default task-15) authenticator SUCCESS: direct-grant-validate-password</font></div><div><font face="Consolas" style="font-size:12px">20:41:18,323 DEBUG [org.keycloak.authentication.DefaultAuthenticationFlow] (default task-15) check execution: direct-grant-validate-otp requirement: OPTIONAL</font></div><div><font face="Consolas" style="font-size:12px">20:41:18,323 DEBUG [org.keycloak.authentication.DefaultAuthenticationFlow] (default task-15) authenticator: direct-grant-validate-otp</font></div><div><font face="Consolas" style="font-size:12px">20:41:18,323 DEBUG [org.keycloak.authentication.DefaultAuthenticationFlow] (default task-15) invoke authenticator.authenticate</font></div><div><font face="Consolas" style="font-size:12px">20:41:18,323 DEBUG [org.keycloak.authentication.DefaultAuthenticationFlow] (default task-15) authenticator ATTEMPTED: direct-grant-validate-otp</font></div><div><font face="Consolas" style="font-size:12px">20:41:18,360 DEBUG [org.keycloak.events] (default task-15) type=LOGIN, realmId=forum, clientId=security-admin-console, userId=f785e600-124c-4e26-914e-2c4f6ec9c95b, ipAddress=127.0.0.1, auth_method=openid-connect, token_id=4dd8bbcb-e771-4652-8711-b2c0937bb8fe, grant_type=password, refresh_token_type=Refresh, refresh_token_id=c0e58e55-9edc-4940-9ff4-52a5a5a9f577, client_auth_method=client-secret, username=charles</font></div><div><font face="Consolas" style="font-size:12px">20:41:18,363 DEBUG [org.apache.http.wire] (default task-14) << "HTTP/1.1 200 OK[\r][\n]"</font></div><div><font face="Consolas" style="font-size:12px">20:41:18,363 DEBUG [org.apache.http.wire] (default task-14) << "Connection: keep-alive[\r][\n]"</font></div><div><font face="Consolas" style="font-size:12px">20:41:18,364 DEBUG [org.apache.http.wire] (default task-14) << "X-Powered-By: Undertow/1[\r][\n]"</font></div><div><font face="Consolas" style="font-size:12px">20:41:18,364 DEBUG [org.apache.http.wire] (default task-14) << "Server: WildFly/10[\r][\n]"</font></div><div><font face="Consolas" style="font-size:12px">20:41:18,364 DEBUG [org.apache.http.wire] (default task-14) << "Transfer-Encoding: chunked[\r][\n]"</font></div><div><font face="Consolas" style="font-size:12px">20:41:18,364 DEBUG [org.apache.http.wire] (default task-14) << "Content-Type: application/json[\r][\n]"</font></div><div><font face="Consolas" style="font-size:12px">20:41:18,364 DEBUG [org.apache.http.wire] (default task-14) << "Date: Wed, 10 Feb 2016 23:41:18 GMT[\r][\n]"</font></div><div><font face="Consolas" style="font-size:12px">20:41:18,364 DEBUG [org.apache.http.wire] (default task-14) << "[\r][\n]"</font></div><div><font face="Consolas" style="font-size:12px">20:41:18,364 DEBUG [org.apache.http.impl.conn.DefaultClientConnection] (default task-14) Receiving response: HTTP/1.1 200 OK</font></div><div><font face="Consolas" style="font-size:12px">20:41:18,364 DEBUG [org.apache.http.headers] (default task-14) << HTTP/1.1 200 OK</font></div><div><font face="Consolas" style="font-size:12px">20:41:18,364 DEBUG [org.apache.http.headers] (default task-14) << Connection: keep-alive</font></div><div><font face="Consolas" style="font-size:12px">20:41:18,364 DEBUG [org.apache.http.headers] (default task-14) << X-Powered-By: Undertow/1</font></div><div><font face="Consolas" style="font-size:12px">20:41:18,364 DEBUG [org.apache.http.headers] (default task-14) << Server: WildFly/10</font></div><div><font face="Consolas" style="font-size:12px">20:41:18,364 DEBUG [org.apache.http.headers] (default task-14) << Transfer-Encoding: chunked</font></div><div><font face="Consolas" style="font-size:12px">20:41:18,364 DEBUG [org.apache.http.headers] (default task-14) << Content-Type: application/json</font></div><div><font face="Consolas" style="font-size:12px">20:41:18,364 DEBUG [org.apache.http.headers] (default task-14) << Date: Wed, 10 Feb 2016 23:41:18 GMT</font></div><div><font face="Consolas" style="font-size:12px">20:41:18,364 DEBUG [org.apache.http.impl.client.DefaultHttpClient] (default task-14) Connection can be kept alive indefinitely</font></div><div><font face="Consolas" style="font-size:12px">20:41:18,386 DEBUG [org.apache.http.wire] (default task-14) << "0ed6[\r][\n]"</font></div><div><font face="Consolas" style="font-size:12px">20:41:18,386 DEBUG [org.apache.http.wire] (default task-14) << "{"access_token":"eyJhbGciOiJSUzI1NiJ9.eyJqdGkiOiI0ZGQ4YmJjYi1lNzcxLTQ2NTItODcxMS1iMmMwOTM3YmI4ZmUiLCJleHAiOjE0NTUxNDc5NzgsIm5iZiI6MCwiaWF0IjoxNDU1MTQ3Njc4LCJpc3MiOiJodHRwOi8vbG9jYWxob3N0OjgwODAvYXV0aC9yZWFsbXMvZm9ydW0iLCJhdWQiOiJzZWN1cml0eS1hZG1pbi1jb25zb2xlIiwic3ViIjoiZjc4NWU2MDAtMTI0Yy00ZTI2LTkxNGUtMmM0ZjZlYzljOTViIiwidHlwIjoiQmVhcmVyIiwiYXpwIjoic2VjdXJpdHktYWRtaW4tY29uc29sZSIsInNlc3Npb25fc3RhdGUiOiIyYzkwMDMzOS1mNjNhLTQ4MGItYjJiZS0wZjZmNDlkNDc3MmYiLCJjbGllbnRfc2Vzc2lvbiI6IjE4YTlhNDQ1LTVkMWMtNGYyZi1iNmYxLTI0NDdkZGQzYzAxNSIsImFsbG93ZWQtb3JpZ2lucyI6W10sInJlc291cmNlX2FjY2VzcyI6eyJyZWFsbS1tYW5hZ2VtZW50Ijp7InJvbGVzIjpbInZpZXctaWRlbnRpdHktcHJvdmlkZXJzIiwidmlldy1yZWFsbSIsIm1hbmFnZS1pZGVudGl0eS1wcm92aWRlcnMiLCJpbXBlcnNvbmF0aW9uIiwicmVhbG0tYWRtaW4iLCJjcmVhdGUtY2xpZW50IiwibWFuYWdlLXVzZXJzIiwibWFuYWdlLWV2ZW50cyIsIm1hbmFnZS1yZWFsbSIsInZpZXctZXZlbnRzIiwidmlldy11c2VycyIsInZpZXctY2xpZW50cyIsIm1hbmFn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ZG1pbi1jb25zb2xlIiwic2Vzc2lvbl9zdGF0ZSI6IjJjOTAwMzM5LWY2M2EtNDgwYi1iMmJlLTBmNmY0OWQ0NzcyZiIsIm5hbWUiOiJDaGFybGVzIFF1ZWlyb3oiLCJwcmVmZXJyZWRfdXNlcm5hbWUiOiJjaGFybGVzIiwiZ2l2ZW5fbmFtZSI6IkNoYXJsZXMiLCJsb2NhbGUiOiJwdC1CUiIsImZhbWlseV9uYW1lIjoiUXVlaXJveiIsImVtYWlsIjoiY2hhcmxlc0BkYXplbi5jb20ifQ.YxeYJ9cKFyDRQ1YyJbwflQSr-n8l9nW1ORsvQbWo1XYfd6UqiUJlSsygIg4JqFIJGfCU_X8DJcV5HmdOtt90IHqW0_Oc6P8ZvVA1UdGEcoWlVBi88Hd_dIGC3WgyaE4WdOW1KC6nh3Eba2KmdUPQQ3xRKYXd9-pxmE2DwDrHZtONd8EaqTeK4J8vE34Jr_BQyNdv9yGztUh73AGVXAeVk4MqKBRAVmcod_eYOpaaf2OfQwaHQZpskwVqrEIIffyXmIMwD1MbmIP4tMPdMnNBK7bzNO-Qx7VTgWOuTu-VRQQoH0-fXetJdxKb5O1_2G7qCi_CYLeolh2DbIWswM6bag","not-before-policy":0,"session-state":"2c900339-f63a-480b-b2be-0f6f49d4772f"}"</font></div><div><font face="Consolas" style="font-size:12px">20:41:18,409 DEBUG [org.apache.http.wire] (default task-14) << "[\r][\n]"</font></div><div><font face="Consolas" style="font-size:12px">20:41:18,409 DEBUG [org.apache.http.wire] (default task-14) << "0[\r][\n]"</font></div><div><font face="Consolas" style="font-size:12px">20:41:18,409 DEBUG [org.apache.http.wire] (default task-14) << "[\r][\n]"</font></div><div><font face="Consolas" style="font-size:12px">20:41:18,409 DEBUG [org.apache.http.impl.conn.BasicClientConnectionManager] (default task-14) Releasing connection org.apache.http.impl.conn.ManagedClientConnectionImpl@24993c5f</font></div><div><font face="Consolas" style="font-size:12px">20:41:18,409 DEBUG [org.apache.http.impl.conn.BasicClientConnectionManager] (default task-14) Connection can be kept alive indefinitely</font></div><div><font face="Consolas" style="font-size:12px">20:41:18,413 DEBUG [org.jboss.as.jpa] (default task-14) default task-14:transaction scoped EntityManager [forum.war#ForumPU]: closing entity managersession</font></div><div><font face="Consolas" style="font-size:12px">20:41:18,414 DEBUG [org.hibernate.resource.jdbc.internal.LogicalConnectionManagedImpl] (default task-14) Initiating JDBC connection release from afterTransaction</font></div><div><font face="Consolas" style="font-size:12px">20:41:18,414 ERROR [org.jboss.as.ejb3.invocation] (default task-14) WFLYEJB0034: EJB Invocation failed on component UserRestEndpoint for method public javax.ws.rs.core.Response br.com.projetolead.forum.integration.rest.UserRestEndpoint.save(br.com.projetolead.forum.model.User,javax.servlet.http.HttpServletRequest) throws java.io.IOException: javax.ejb.EJBException: javax.ws.rs.client.ResponseProcessingException: javax.ws.rs.ProcessingException: com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException: Unrecognized field "access_token" (class org.keycloak.representations.AccessTokenResponse), not marked as ignorable (9 known properties: "notBeforePolicy", "otherClaims", "tokenType", "token", "expiresIn", "sessionState", "refreshExpiresIn", "idToken", "refreshToken"])</font></div><div><font face="Consolas" style="font-size:12px"> at [Source: org.apache.http.conn.EofSensorInputStream@5af6ffba; line: 1, column: 18] (through reference chain: org.keycloak.representations.AccessTokenResponse["access_token”])</font></div></div><div><br></div><div>------</div><div><br></div><div><br></div><div>Where is the problem? <br><div>
<div style="color:rgb(0,0,0);letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;word-wrap:break-word"><div style="color:rgb(0,0,0);letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;word-wrap:break-word"><div style="color:rgb(0,0,0);letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;word-wrap:break-word"><div style="color:rgb(0,0,0);letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;word-wrap:break-word"><div style="color:rgb(0,0,0);letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;word-wrap:break-word"><div style="color:rgb(0,0,0);letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;word-wrap:break-word"><div style="color:rgb(0,0,0);letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;word-wrap:break-word"><div style="color:rgb(0,0,0);letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;word-wrap:break-word"><div style="color:rgb(0,0,0);letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;word-wrap:break-word"><p class="MsoNormal">Atenciosamente,</p><p class="MsoNormal"><b><span lang="EN-US" style="font-size:9pt;font-family:Arial,sans-serif;color:rgb(23,54,93)">Charles Queiroz </span></b></p><div class="MsoNormal" align="center" style="text-align:center"><span lang="EN-US" style="font-size:12pt;font-family:'Times New Roman',serif;color:rgb(31,73,125)"><hr align="center" noshade size="1" width="100%" style="color:rgb(102,102,102)"></span></div><p class="MsoNormal"><b><span lang="EN-US" style="font-size:8pt;font-family:Arial,sans-serif;color:rgb(109,110,113)">Dazen™</span></b><b><span lang="EN-US" style="color:rgb(23,54,93)"><span> </span></span></b><b><span lang="EN-US" style="font-size:8pt;font-family:Arial,sans-serif;color:rgb(109,110,113)">IT Services</span></b><b><span lang="EN-US" style="font-size:8pt;font-family:Arial,sans-serif;color:rgb(109,110,113)"><br>Technology - Software Development<span> </span><u></u><u></u></span></b><span style="font-size:8pt;font-family:Arial,sans-serif;color:rgb(109,110,113)"><br><a href="mailto:charles@dazen.com.br" target="_blank"><span lang="EN-US" style="color:rgb(109,110,113);text-decoration:none">charles@dazen.com.br</span></a></span><span lang="EN-US" style="font-size:8pt;font-family:Arial,sans-serif;color:rgb(109,110,113)"><u></u><u></u><br>Fortaleza - CE</span><span lang="EN-US" style="color:rgb(23,54,93)"><u></u><u></u></span><span lang="EN-US" style="font-size:8pt;font-family:Arial,sans-serif;color:rgb(109,110,113)"><br>Phone: <a href="tel:%2B55%2085%209933%201585" value="+558599331585" target="_blank">+55 85 9933 1585</a> </span></p><p class="MsoNormal"><span lang="EN-US" style="font-size:8pt;font-family:Arial,sans-serif;color:rgb(109,110,113)">Twitter: @CharlesQueiiroz</span></p></div></div></div></div></div></div></div></div></div>
</div>
<br></div></div><br>_______________________________________________<br>
keycloak-user mailing list<br>
<a href="mailto:keycloak-user@lists.jboss.org">keycloak-user@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/keycloak-user" rel="noreferrer" target="_blank">https://lists.jboss.org/mailman/listinfo/keycloak-user</a><br></blockquote></div><br></div></div>