add auth method to ClientSession

This commit is contained in:
Bill Burke 2014-09-23 11:18:39 -04:00
parent 66d58476d0
commit 0bf6c36ca7
7 changed files with 65 additions and 0 deletions

View file

@ -27,6 +27,14 @@ public interface ClientSessionModel {
public Set<String> getRoles(); public Set<String> 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 String getNote(String name);
public void setNote(String name, String value); public void setNote(String name, String value);
public void removeNote(String name); public void removeNote(String name);

View file

@ -84,6 +84,16 @@ public class ClientSessionAdapter implements ClientSessionModel {
return entity.getState(); return entity.getState();
} }
@Override
public String getAuthMethod() {
return entity.getAuthMethod();
}
@Override
public void setAuthMethod(String method) {
entity.setAuthMethod(method);
}
@Override @Override
public UserSessionModel getUserSession() { public UserSessionModel getUserSession() {
return new UserSessionAdapter(session, em, realm, entity.getSession()); return new UserSessionAdapter(session, em, realm, entity.getSession());

View file

@ -47,6 +47,9 @@ public class ClientSessionEntity {
@Column(name="REDIRECT_URI") @Column(name="REDIRECT_URI")
protected String redirectUri; protected String redirectUri;
@Column(name="AUTH_METHOD")
protected String authMethod;
@Column(name="STATE") @Column(name="STATE")
protected String state; protected String state;
@ -130,4 +133,12 @@ public class ClientSessionEntity {
public void setNotes(Collection<ClientSessionNoteEntity> notes) { public void setNotes(Collection<ClientSessionNoteEntity> notes) {
this.notes = notes; this.notes = notes;
} }
public String getAuthMethod() {
return authMethod;
}
public void setAuthMethod(String authMethod) {
this.authMethod = authMethod;
}
} }

View file

@ -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);
}
} }

View file

@ -18,6 +18,7 @@ public class ClientSessionEntity {
private String redirectUri; private String redirectUri;
private String state; private String state;
private String authMethod;
private int timestamp; private int timestamp;
private ClientSessionModel.Action action; private ClientSessionModel.Action action;
@ -91,4 +92,12 @@ public class ClientSessionEntity {
public Map<String, String> getNotes() { public Map<String, String> getNotes() {
return notes; return notes;
} }
public String getAuthMethod() {
return authMethod;
}
public void setAuthMethod(String authMethod) {
this.authMethod = authMethod;
}
} }

View file

@ -101,4 +101,14 @@ public class ClientSessionAdapter implements ClientSessionModel {
entity.getNotes().remove(name); entity.getNotes().remove(name);
} }
@Override
public String getAuthMethod() {
return entity.getAuthMethod();
}
@Override
public void setAuthMethod(String method) {
entity.setAuthMethod(method);
}
} }

View file

@ -16,6 +16,7 @@ public class MongoClientSessionEntity {
private String redirectUri; private String redirectUri;
private String state; private String state;
private String authMethod;
private int timestamp; private int timestamp;
private ClientSessionModel.Action action; private ClientSessionModel.Action action;
@ -54,6 +55,14 @@ public class MongoClientSessionEntity {
this.state = state; this.state = state;
} }
public String getAuthMethod() {
return authMethod;
}
public void setAuthMethod(String authMethod) {
this.authMethod = authMethod;
}
public int getTimestamp() { public int getTimestamp() {
return timestamp; return timestamp;
} }