Minor improvements

This commit is contained in:
mposolda 2015-05-05 17:57:31 +02:00
parent 620e3b67e9
commit 91eb80beb0
4 changed files with 2 additions and 6 deletions

View file

@ -108,7 +108,6 @@ public class SPNEGOAuthenticator {
if (gssContext.isEstablished()) { if (gssContext.isEstablished()) {
authenticatedKerberosPrincipal = gssContext.getSrcName().toString(); authenticatedKerberosPrincipal = gssContext.getSrcName().toString();
// What should be done with delegation credential? Figure out if there are use-cases for storing it as claims in FederatedIdentity
if (gssContext.getCredDelegState()) { if (gssContext.getCredDelegState()) {
delegationCredential = gssContext.getDelegCred(); delegationCredential = gssContext.getDelegCred();
} }

View file

@ -181,7 +181,7 @@ public interface RealmModel extends RoleContainerModel {
public IdentityProviderMapperModel getIdentityProviderMapperById(String id); public IdentityProviderMapperModel getIdentityProviderMapperById(String id);
public IdentityProviderMapperModel getIdentityProviderMapperByName(String brokerAlias, String name); public IdentityProviderMapperModel getIdentityProviderMapperByName(String brokerAlias, String name);
// Should return list sorted by UserFederationProviderModel.priority
List<UserFederationProviderModel> getUserFederationProviders(); List<UserFederationProviderModel> getUserFederationProviders();
UserFederationProviderModel addUserFederationProvider(String providerName, Map<String, String> config, int priority, String displayName, int fullSyncPeriod, int changedSyncPeriod, int lastSync); UserFederationProviderModel addUserFederationProvider(String providerName, Map<String, String> config, int priority, String displayName, int fullSyncPeriod, int changedSyncPeriod, int lastSync);

View file

@ -203,7 +203,7 @@ public class DefaultCacheRealmProvider implements CacheRealmProvider {
// Return cache delegates to ensure cache invalidated during write operations // Return cache delegates to ensure cache invalidated during write operations
List<RealmModel> cachedRealms = new LinkedList<RealmModel>(); List<RealmModel> cachedRealms = new LinkedList<RealmModel>();
for (RealmModel realm : backendRealms) { for (RealmModel realm : backendRealms) {
RealmModel cached = session.realms().getRealm(realm.getId()); RealmModel cached = getRealm(realm.getId());
cachedRealms.add(cached); cachedRealms.add(cached);
} }
return cachedRealms; return cachedRealms;

View file

@ -300,14 +300,11 @@ public class TokenManager {
Set<ProtocolMapperModel> mappings = new ClientSessionCode(realm, clientSession).getRequestedProtocolMappers(); Set<ProtocolMapperModel> mappings = new ClientSessionCode(realm, clientSession).getRequestedProtocolMappers();
KeycloakSessionFactory sessionFactory = session.getKeycloakSessionFactory(); KeycloakSessionFactory sessionFactory = session.getKeycloakSessionFactory();
for (ProtocolMapperModel mapping : mappings) { for (ProtocolMapperModel mapping : mappings) {
if (!mapping.getProtocol().equals(OIDCLoginProtocol.LOGIN_PROTOCOL)) continue;
ProtocolMapper mapper = (ProtocolMapper)sessionFactory.getProviderFactory(ProtocolMapper.class, mapping.getProtocolMapper()); ProtocolMapper mapper = (ProtocolMapper)sessionFactory.getProviderFactory(ProtocolMapper.class, mapping.getProtocolMapper());
if (mapper == null || !(mapper instanceof OIDCIDTokenMapper)) continue; if (mapper == null || !(mapper instanceof OIDCIDTokenMapper)) continue;
token = ((OIDCIDTokenMapper)mapper).transformIDToken(token, mapping, session, userSession, clientSession); token = ((OIDCIDTokenMapper)mapper).transformIDToken(token, mapping, session, userSession, clientSession);
} }
} }