<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <p>You can't impersonate progammatically at the moment.<br>
    </p>
    <br>
    <div class="moz-cite-prefix">On 5/12/16 1:24 AM, Anshul Malpani
      wrote:<br>
    </div>
    <blockquote
cite="mid:CAGFoRUXoNjbqL7K7wU=1AaxaKFMQjWZ+VBW79EiKf3aP3jcfWA@mail.gmail.com"
      type="cite">
      <div dir="ltr"><span style="font-size:12.8px">Hi,</span>
        <div style="font-size:12.8px"><br>
        </div>
        <div style="font-size:12.8px">I am trying to use impersonate
          feature using my java client. When I call impersonate api
          using admin access grant. I get back the cookies. How can I
          get the access token for the impersonate user.</div>
        <div style="font-size:12.8px"><br>
        </div>
        <div style="font-size:12.8px"><br>
        </div>
        <div style="font-size:12.8px"><br>
        </div>
        <div style="font-size:12.8px">
          <div style="margin:0px;font-family:Monaco">HttpPost <span
              style="color:rgb(126,80,79)">post</span> = <span
              style="color:rgb(147,26,104)">new</span> HttpPost(</div>
          <div style="margin:0px"><font face="Monaco">                 
                KeycloakUriBuilder.fromUri(</font><span
              style="font-family:Monaco;color:rgb(126,80,79)">authServerUrl</span><font
              face="Monaco">).path(</font><font face="Monaco"
              color="#0326cc">“</font><span
              style="color:rgb(57,51,255);font-family:Monaco">/admin/realms/{realm}/users/{id}/impersonation</span><font
              face="Monaco" color="#0326cc">"</font><font face="Monaco">).build(</font><span
              style="font-family:Monaco;color:rgb(126,80,79)">realm</span><font
              face="Monaco">, </font><span
              style="font-family:Monaco;color:rgb(126,80,79)">accountKeycloakId</span><font
              face="Monaco">));</font></div>
        </div>
        <div style="font-size:12.8px;margin:0px"><font face="Monaco"><br>
          </font></div>
        <div style="font-size:12.8px;margin:0px"><font face="Monaco">This
            is returning me cookies. In next step I would like to get
            the access token of impersonate user.</font></div>
        <div style="font-size:12.8px;margin:0px"><font face="Monaco"><br>
          </font></div>
        <div style="font-size:12.8px;margin:0px"><font face="Monaco">Thanks</font></div>
      </div>
      <div class="gmail_extra"><br>
        <div class="gmail_quote">On Wed, May 11, 2016 at 3:25 PM, Anshul
          Malpani <span dir="ltr">&lt;<a moz-do-not-send="true"
              href="mailto:anshulm@stytch.com" target="_blank">anshulm@stytch.com</a>&gt;</span>
          wrote:<br>
          <blockquote class="gmail_quote" style="margin:0 0 0
            .8ex;border-left:1px #ccc solid;padding-left:1ex">
            <div style="word-wrap:break-word">Hi,
              <div><br>
              </div>
              <div>I am trying to use impersonate feature using my java
                client. When I call impersonate api using admin access
                grant. I get back the cookies. How can I get the access
                token for the impersonate user.</div>
              <div><br>
              </div>
              <div><br>
              </div>
              <div><br>
              </div>
              <div>
                <div
                  style="margin:0px;line-height:normal;font-family:Monaco">HttpPost
                  <span style="color:#7e504f">post</span> = <span
                    style="color:#931a68">new</span> HttpPost(</div>
                <div style="margin:0px;line-height:normal"><font
                    face="Monaco">                   
                    KeycloakUriBuilder.fromUri(</font><span
                    style="font-family:Monaco;color:rgb(126,80,79)">authServerUrl</span><font
                    face="Monaco">).path(</font><font face="Monaco"
                    color="#0326cc">“</font><span
                    style="color:rgb(57,51,255);font-family:Monaco">/admin/realms/{realm}/users/{id}/impersonation</span><font
                    face="Monaco" color="#0326cc">"</font><font
                    face="Monaco">).build(</font><span
                    style="font-family:Monaco;color:rgb(126,80,79)">realm</span><font
                    face="Monaco">, </font><span
                    style="font-family:Monaco;color:rgb(126,80,79)">accountKeycloakId</span><font
                    face="Monaco">));</font></div>
              </div>
              <div style="margin:0px;line-height:normal"><font
                  face="Monaco"><br>
                </font></div>
              <div style="margin:0px;line-height:normal"><font
                  face="Monaco">This is returning me cookies. In
                  next step I would like to get the access token of
                  impersonate user.</font></div>
              <div style="margin:0px;line-height:normal"><font
                  face="Monaco"><br>
                </font></div>
              <div style="margin:0px;line-height:normal"><font
                  face="Monaco">Thanks</font></div>
              <span class="HOEnZb"><font color="#888888">
                  <div style="margin:0px;line-height:normal"><font
                      face="Monaco">A</font></div>
                  <div style="margin:0px;line-height:normal"><font
                      face="Monaco"><br>
                    </font></div>
                  <div style="margin:0px;line-height:normal"><font
                      face="Monaco"><br>
                    </font></div>
                </font></span></div>
          </blockquote>
        </div>
        <br>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
keycloak-dev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:keycloak-dev@lists.jboss.org">keycloak-dev@lists.jboss.org</a>
<a class="moz-txt-link-freetext" href="https://lists.jboss.org/mailman/listinfo/keycloak-dev">https://lists.jboss.org/mailman/listinfo/keycloak-dev</a></pre>
    </blockquote>
    <br>
  </body>
</html>