<html>
<head>
<meta content="text/html; charset=windows-1252"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">On 04/05/16 18:00, Aikeaguinea wrote:<br>
</div>
<blockquote
cite="mid:1462377616.1947384.598056425.5C00B82A@webmail.messagingengine.com"
type="cite">
<pre wrap="">I have a client with a service account and credentials using Signed Jwt.
Authentication works fine. The service uses
org.keycloak.adapters.authentication.ClientCredentialsProviderUtils#setClientCredentials
to create the JWT token and set the headers, and I get back a JWT
containing an access token from Keycloak.
However, when I use jwt.io to look at the access token, I can't validate
the signature. This is true whether I use the client Certificate (from
the client's Credentials tab), the Realm public key, or the Realm
Certificate. In addition, I have generated the client's public key from
the certificate using
keytool -exportcert -alias x -keypass y -storepass z -rfc -keystore
client-keystore.jks | openssl x509 -inform pem -pubkey
on the jks file supplied when I generated the client credentials, and
that doesn't work either.
We've also been having trouble validating the signature programmatically
using Java.</pre>
</blockquote>
Signature can be verified in Java if you have realm public key. You
can use "<span style="background-color:#e4e4ff;">RSATokenVerifier</span>.<span
style="font-style:italic;">verifyToken" . We have a serviceAccount
example, which is part of demo and </span>where this is also used
:
<a class="moz-txt-link-freetext" href="https://github.com/keycloak/keycloak/blob/master/examples/demo-template/service-account/src/main/java/org/keycloak/example/ProductServiceAccountServlet.java#L166">https://github.com/keycloak/keycloak/blob/master/examples/demo-template/service-account/src/main/java/org/keycloak/example/ProductServiceAccountServlet.java#L166</a><br>
<br>
Marek<br>
<meta http-equiv="content-type" content="text/html;
charset=windows-1252">
<blockquote
cite="mid:1462377616.1947384.598056425.5C00B82A@webmail.messagingengine.com"
type="cite">
<pre wrap="">
Any idea why I might be seeing this?
</pre>
</blockquote>
<br>
</body>
</html>