KEYCLOAK-2270 Use sub instead of iss for clientId in JWTClientAuthenticator

This commit is contained in:
mposolda 2016-01-13 10:12:11 +01:00
parent 75d715d8a7
commit 4642876323
2 changed files with 2 additions and 1 deletions

View file

@ -107,6 +107,7 @@ public class JWTClientCredentialsProvider implements ClientCredentialsProvider {
JsonWebToken reqToken = new JsonWebToken(); JsonWebToken reqToken = new JsonWebToken();
reqToken.id(AdapterUtils.generateId()); reqToken.id(AdapterUtils.generateId());
reqToken.issuer(clientId); reqToken.issuer(clientId);
reqToken.subject(clientId);
reqToken.audience(realmInfoUrl); reqToken.audience(realmInfoUrl);
int now = Time.currentTime(); int now = Time.currentTime();

View file

@ -77,7 +77,7 @@ public class JWTClientAuthenticator extends AbstractClientAuthenticator {
JsonWebToken token = jws.readJsonContent(JsonWebToken.class); JsonWebToken token = jws.readJsonContent(JsonWebToken.class);
RealmModel realm = context.getRealm(); RealmModel realm = context.getRealm();
String clientId = token.getIssuer(); String clientId = token.getSubject();
if (clientId == null) { if (clientId == null) {
throw new RuntimeException("Can't identify client. Issuer missing on JWT token"); throw new RuntimeException("Can't identify client. Issuer missing on JWT token");
} }