Is it possible to extend the CAS Credential class to accept three
authentication parameters for authentication? I'm interested in something
analogous to windows domain support because I will have the same
credentials in multiple user stores (domains) however, there will be
attribute differences between the identities.
If anyone has done something similar, I'm interesting in hearing about it.
I started with the following and it's modeled after the RememberMe
implementation but I'm unable to use it to replace the default
UsernamePasswordCredential class.
//DatabaseUsernamePasswordCredential.java:
package org.apereo.cas.authentication;
import org.apache.commons.lang3.builder.HashCodeBuilder;
public class DatabaseUsernamePasswordCredential extends
UsernamePasswordCredential implements DatabaseCredential {
private static final long serialVersionUID = -6799997659431302397L;
private String database;
@Override
public String getDatabase() {
return this.database;
}
public void setDatabase(final String database) {
this.database = database;
}
@Override
public boolean equals(final Object o) {
if (this == o) {
return true;
}
if (!super.equals(o)) {
return false;
}
if (getClass() != o.getClass()) {
return false;
}
final DatabaseUsernamePasswordCredential that =
(DatabaseUsernamePasswordCredential) o;
return this.database != null ? this.database.equals(that.database)
: that.database == null;
}
@Override
public int hashCode() {
return new HashCodeBuilder()
.appendSuper(super.hashCode())
.append(this.database)
.toHashCode();
}
}
//DatabaseCredential.java:
package org.apereo.cas.authentication;
public interface DatabaseCredential extends Credential {
public static final String AUTHENTICATION_ATTRIBUTE_DATABASE =
"database";
public String getDatabase();
}
Thanks,
-Jeff
--
- Website: https://apereo.github.io/cas
- Gitter Chatroom: https://gitter.im/apereo/cas
- List Guidelines: https://goo.gl/1VRrw7
- Contributions: https://goo.gl/mh7qDG
---
You received this message because you are subscribed to the Google Groups "CAS
Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/a/apereo.org/d/msgid/cas-user/CA%2BTBYOSdWsoma2_vPEdG9Pz0jmxFmxg302q8u6ZhS7F9xJH6Dw%40mail.gmail.com.