<div dir="ltr">Well.. This is OpenID Connect and the response should be in JSON. You should tell your user to parse the JSON and not expect XML.<div><br></div><div>If he really wants XML then maybe he&#39;d be happy with using SAML instead.</div><div><br></div><div>I&#39;d recommend against doing something custom, but you can in theory do that with either the protocol SPI or the rest resource spi.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On 4 July 2016 at 19:32, Aswini Sarathi <span dir="ltr">&lt;<a href="mailto:asarathi@vizuri.com" target="_blank">asarathi@vizuri.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 dir="ltr"> I tried getting a token using the token endpoint with grant type as &quot;password&quot; and this is what I got in the response and the content-type was set to application/json in the header. My question  is what would I need to do if I want the below response in xml. I have a user who wants to parse a XML response instead and get the access token. Please let me know if I am not doing anything correctly. <div><br></div><div><div>{</div><div>  &quot;access_token&quot;: &quot;eyJhbGciOiJSUzI1NiJ9.eyJqdGkiOiJjZWVjZmNiZS1lODJmLTQ2MWQtODljMi05MGY0NGZiNTcwNTIiLCJleHAiOjE0Njc2NTM1MDgsIm5iZiI6MCwiaWF0IjoxNDY3NjUzMjA4LCJpc3MiOiJodHRwOi8vdml6MDIubmV0MzIubmV0OjgwODAvYXV0aC9yZWFsbXMvTmV0MzIiLCJhdWQiOiJWZW5kb3JBUEkiLCJzdWIiOiIxYjhhZWJkNC1iNDU0LTQzYTYtODRlOS05MmQxMjc1NGFmNDUiLCJ0eXAiOiJCZWFyZXIiLCJhenAiOiJWZW5kb3JBUEkiLCJzZXNzaW9uX3N0YXRlIjoiOWNhOTYxYzktMWI4OC00NzhlLWI0OTEtNTE1YWZiMDYwZTY1IiwiY2xpZW50X3Nlc3Npb24iOiI1MDgxNGZjMi02NWIwLTQ4YmYtYWY3OS04ZDZmODlhMWFkODciLCJhbGxvd2VkLW9yaWdpbnMiOltdLCJyZWFsbV9hY2Nlc3MiOnsicm9sZXMiOlsidmVuZG9yIl19LCJyZXNvdXJjZV9h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rYoP3YP_wYqwXG7oq6DIHFup6JRPG2YckZ0ups46tYRwXG-6DPrRRfCdD36YiGA3sggJZllMlBL-SI4XZ5amayi4J_Ktz_1IleOsQRG49DFflIyk9W4ZWMDSqut2ZYTE0Bfm_yc5XZUNKEY7quPQLGg2JdF2kT7Ka80aHQOIQPvC-Q0IkL7-uyT2Swq2sU8RO4OGMJziKY71UWPpn-ht1p5dOL1lKlZoULS-VCPeCupGoOuR9Y9t88N7vbjFDv3dw3zw67BCA9BwwtsGKCJkhopvaJWS4tiRqFsoSF-_O2IzkuoEjAW3LalMe3vusQjzuFOSdOMQ&quot;,</div><div>  &quot;not-before-policy&quot;: 0,</div><div>  &quot;session_state&quot;: &quot;9ca961c9-1b88-478e-b491-515afb060e65&quot;</div><div>}</div></div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Jul 4, 2016 at 1:11 PM, Stian Thorgersen <span dir="ltr">&lt;<a href="mailto:sthorger@redhat.com" target="_blank">sthorger@redhat.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 dir="ltr">Adding list back - please use reply all<div><br></div><div>I&#39;m not following. The response payload is the token, so not sure what it is that you want in XML.</div></div><div><div><div class="gmail_extra"><br><div class="gmail_quote">On 4 July 2016 at 15:41,  <span dir="ltr">&lt;<a href="mailto:asarathi@vizuri.com" target="_blank">asarathi@vizuri.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 dir="auto"><div></div><div>Sorry if I wasn&#39;t clear earlier. I don&#39;t want the token itself to be in xml. I just want the response payload from the token endpoint to be xml or Json based on the accept header. </div><div><div><div><br></div><div><br>On Jul 4, 2016, at 3:04 AM, Stian Thorgersen &lt;<a href="mailto:sthorger@redhat.com" target="_blank">sthorger@redhat.com</a>&gt; wrote:<br><br></div><blockquote type="cite"><div><div dir="ltr">We only support JWT with OpenID Connect. Can you elaborate on why you want an XML token?<div><br></div><div>You could add a custom REST endpoint or a custom protocol to do this, but not sure I&#39;d recommend doing it as there&#39;s a fair bit of logic that goes into the token endpoint.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On 1 July 2016 at 18:39, Aswini Sarathi <span dir="ltr">&lt;<a href="mailto:asarathi@vizuri.com" target="_blank">asarathi@vizuri.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> <font face="Times" style="font-size:14px">   I am trying to find out if there is a way to get response from token endpoint  <span style="color:rgb(51,51,51);letter-spacing:0.2px;line-height:27.2px;white-space:pre-wrap;background-color:rgb(247,247,247)">/realms/{realm-name}/protocol/openid-connect/token </span></font><font face="Times" style="font-size:14px">in xml or json format based on the Accept header. If its not supported out of the box, what other options are available to do this? Should I look at creating a custom endpoint by implementing the SPI to do the mapping?</font></div><div><font face="Times" style="font-size:14px"><br></font></div><div><font face="Times" style="font-size:14px">Thanks!!</font></div><div><br></div></div><br>_______________________________________________<br>
keycloak-user mailing list<br>
<a href="mailto:keycloak-user@lists.jboss.org" target="_blank">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></blockquote></div></div></div></blockquote></div><br></div>
</div></div></blockquote></div><br></div>
</div></div></blockquote></div><br></div>