diff --git a/model/api/src/main/java/org/keycloak/models/ClientSessionModel.java b/model/api/src/main/java/org/keycloak/models/ClientSessionModel.java index 01b12c50fa..7ecd68e21d 100755 --- a/model/api/src/main/java/org/keycloak/models/ClientSessionModel.java +++ b/model/api/src/main/java/org/keycloak/models/ClientSessionModel.java @@ -27,6 +27,14 @@ public interface ClientSessionModel { public Set getRoles(); + /** + * Authentication request type, i.e. OAUTH, SAML 2.0, SAML 1.1, etc. + * + * @return + */ + public String getAuthMethod(); + public void setAuthMethod(String method); + public String getNote(String name); public void setNote(String name, String value); public void removeNote(String name); diff --git a/model/sessions-jpa/src/main/java/org/keycloak/models/sessions/jpa/ClientSessionAdapter.java b/model/sessions-jpa/src/main/java/org/keycloak/models/sessions/jpa/ClientSessionAdapter.java index d397667ef9..f1f5ea49fc 100755 --- a/model/sessions-jpa/src/main/java/org/keycloak/models/sessions/jpa/ClientSessionAdapter.java +++ b/model/sessions-jpa/src/main/java/org/keycloak/models/sessions/jpa/ClientSessionAdapter.java @@ -84,6 +84,16 @@ public class ClientSessionAdapter implements ClientSessionModel { return entity.getState(); } + @Override + public String getAuthMethod() { + return entity.getAuthMethod(); + } + + @Override + public void setAuthMethod(String method) { + entity.setAuthMethod(method); + } + @Override public UserSessionModel getUserSession() { return new UserSessionAdapter(session, em, realm, entity.getSession()); diff --git a/model/sessions-jpa/src/main/java/org/keycloak/models/sessions/jpa/entities/ClientSessionEntity.java b/model/sessions-jpa/src/main/java/org/keycloak/models/sessions/jpa/entities/ClientSessionEntity.java index 0563706fc9..8415499645 100755 --- a/model/sessions-jpa/src/main/java/org/keycloak/models/sessions/jpa/entities/ClientSessionEntity.java +++ b/model/sessions-jpa/src/main/java/org/keycloak/models/sessions/jpa/entities/ClientSessionEntity.java @@ -47,6 +47,9 @@ public class ClientSessionEntity { @Column(name="REDIRECT_URI") protected String redirectUri; + @Column(name="AUTH_METHOD") + protected String authMethod; + @Column(name="STATE") protected String state; @@ -130,4 +133,12 @@ public class ClientSessionEntity { public void setNotes(Collection notes) { this.notes = notes; } + + public String getAuthMethod() { + return authMethod; + } + + public void setAuthMethod(String authMethod) { + this.authMethod = authMethod; + } } diff --git a/model/sessions-mem/src/main/java/org/keycloak/models/sessions/mem/ClientSessionAdapter.java b/model/sessions-mem/src/main/java/org/keycloak/models/sessions/mem/ClientSessionAdapter.java index 649915da4d..8ae392fc42 100755 --- a/model/sessions-mem/src/main/java/org/keycloak/models/sessions/mem/ClientSessionAdapter.java +++ b/model/sessions-mem/src/main/java/org/keycloak/models/sessions/mem/ClientSessionAdapter.java @@ -93,5 +93,13 @@ public class ClientSessionAdapter implements ClientSessionModel { } + @Override + public String getAuthMethod() { + return entity.getAuthMethod(); + } + @Override + public void setAuthMethod(String method) { + entity.setAuthMethod(method); + } } diff --git a/model/sessions-mem/src/main/java/org/keycloak/models/sessions/mem/entities/ClientSessionEntity.java b/model/sessions-mem/src/main/java/org/keycloak/models/sessions/mem/entities/ClientSessionEntity.java index 5094002766..7664a9b20c 100755 --- a/model/sessions-mem/src/main/java/org/keycloak/models/sessions/mem/entities/ClientSessionEntity.java +++ b/model/sessions-mem/src/main/java/org/keycloak/models/sessions/mem/entities/ClientSessionEntity.java @@ -18,6 +18,7 @@ public class ClientSessionEntity { private String redirectUri; private String state; + private String authMethod; private int timestamp; private ClientSessionModel.Action action; @@ -91,4 +92,12 @@ public class ClientSessionEntity { public Map getNotes() { return notes; } + + public String getAuthMethod() { + return authMethod; + } + + public void setAuthMethod(String authMethod) { + this.authMethod = authMethod; + } } diff --git a/model/sessions-mongo/src/main/java/org/keycloak/models/sessions/mongo/ClientSessionAdapter.java b/model/sessions-mongo/src/main/java/org/keycloak/models/sessions/mongo/ClientSessionAdapter.java index 420b7a0095..248823917a 100755 --- a/model/sessions-mongo/src/main/java/org/keycloak/models/sessions/mongo/ClientSessionAdapter.java +++ b/model/sessions-mongo/src/main/java/org/keycloak/models/sessions/mongo/ClientSessionAdapter.java @@ -101,4 +101,14 @@ public class ClientSessionAdapter implements ClientSessionModel { entity.getNotes().remove(name); } + + @Override + public String getAuthMethod() { + return entity.getAuthMethod(); + } + + @Override + public void setAuthMethod(String method) { + entity.setAuthMethod(method); + } } diff --git a/model/sessions-mongo/src/main/java/org/keycloak/models/sessions/mongo/entities/MongoClientSessionEntity.java b/model/sessions-mongo/src/main/java/org/keycloak/models/sessions/mongo/entities/MongoClientSessionEntity.java index 6d16717d4b..60a9a3cea4 100755 --- a/model/sessions-mongo/src/main/java/org/keycloak/models/sessions/mongo/entities/MongoClientSessionEntity.java +++ b/model/sessions-mongo/src/main/java/org/keycloak/models/sessions/mongo/entities/MongoClientSessionEntity.java @@ -16,6 +16,7 @@ public class MongoClientSessionEntity { private String redirectUri; private String state; + private String authMethod; private int timestamp; private ClientSessionModel.Action action; @@ -54,6 +55,14 @@ public class MongoClientSessionEntity { this.state = state; } + public String getAuthMethod() { + return authMethod; + } + + public void setAuthMethod(String authMethod) { + this.authMethod = authMethod; + } + public int getTimestamp() { return timestamp; }