Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(jans-casa): enrollment of a passkey implies the enrollment… #10473

Merged
merged 2 commits into from
Dec 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -101,13 +101,16 @@ public <T> List<T> find(Class<T> clazz, String baseDn, Filter filter, int start,
}

public <T> List<T> find(Class<T> clazz, String baseDn, Filter filter) {

logger.debug(baseDn);
logger.debug(clazz.toString());
logger.debug(filter.toString());
try {
return entryManager.findEntries(baseDn, clazz, filter);
} catch (Exception e) {
//logger.error(e.getMessage(), e);
//TODO: uncomment the above once https://github.com/GluuFederation/oxCore/issues/160 is solved
logger.error(e.getMessage());
e.printStackTrace();
return Collections.emptyList();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,28 +4,39 @@
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;

@JsonIgnoreProperties(ignoreUnknown = true)

public class Fido2RegistrationData {

private static final long serialVersionUID = 4599467930864459334L;

private String username;
private String domain;
private String origin;
private String userId;
private String challenge;

private String attenstationRequest;
private String attenstationResponse;

private String attestationRequest;
private String attestationResponse;
private String uncompressedECPoint;
private String publicKeyId;

private String type;

private String status;
private int counter;

private String attestationType;

private int signatureAlgorithm;

private String applicationId;
private String rpId;
// Credential backup eligibility and current backup state is conveyed by the
// backupStateFlag and backupEligibilityFlag flags in the authenticator data.
// See https://w3c.github.io/webauthn/#sctn-authenticator-data
private boolean backupStateFlag;
private boolean backupEligibilityFlag;
private boolean attestedCredentialDataFlag;
private boolean extensionDataFlag;
private boolean userVerifiedFlag;
private boolean userPresentFlag;

private String authentictatorAttachment;

private String credId;
private String transports[];

public String getUsername() {
return username;
Expand All @@ -35,14 +46,6 @@ public void setUsername(String username) {
this.username = username;
}

public String getDomain() {
return domain;
}

public void setDomain(String domain) {
this.domain = domain;
}

public String getUserId() {
return userId;
}
Expand All @@ -59,20 +62,20 @@ public void setChallenge(String challenge) {
this.challenge = challenge;
}

public String getAttenstationRequest() {
return attenstationRequest;
public String getAttestationRequest() {
return attestationRequest;
}

public void setAttenstationRequest(String attenstationRequest) {
this.attenstationRequest = attenstationRequest;
public void setAttestationRequest(String attestationRequest) {
this.attestationRequest = attestationRequest;
}

public String getAttenstationResponse() {
return attenstationResponse;
public String getAttestationResponse() {
return attestationResponse;
}

public void setAttenstationResponse(String attenstationResponse) {
this.attenstationResponse = attenstationResponse;
public void setAttestationResponse(String attestationResponse) {
this.attestationResponse = attestationResponse;
}

public String getUncompressedECPoint() {
Expand All @@ -99,6 +102,14 @@ public void setType(String type) {
this.type = type;
}

public String getStatus() {
return status;
}

public void setStatus(String status) {
this.status = status;
}

public int getCounter() {
return counter;
}
Expand All @@ -123,21 +134,92 @@ public void setSignatureAlgorithm(int signatureAlgorithm) {
this.signatureAlgorithm = signatureAlgorithm;
}

public String getApplicationId() {
return applicationId;
public boolean getBackupStateFlag() {
return this.backupStateFlag;
}

public void setBackupStateFlag(boolean backupStateFlag) {
this.backupStateFlag = backupStateFlag;
}

public boolean getBackupEligibilityFlag() {
return this.backupEligibilityFlag;
}

public void setBackupEligibilityFlag(boolean backupEligibilityFlag) {
this.backupEligibilityFlag = backupEligibilityFlag;
}

public String getOrigin() {
return origin;
}

public void setOrigin(String origin) {
this.origin = origin;
}

public String getRpId() {
return rpId;
}

public void setRpId(String rpId) {
this.rpId = rpId;
}

public boolean isAttestedCredentialDataFlag() {
return attestedCredentialDataFlag;
}

public void setAttestedCredentialDataFlag(boolean attestedCredentialDataFlag) {
this.attestedCredentialDataFlag = attestedCredentialDataFlag;
}

public boolean isExtensionDataFlag() {
return extensionDataFlag;
}

public void setExtensionDataFlag(boolean extensionDataFlag) {
this.extensionDataFlag = extensionDataFlag;
}

public boolean isUserVerifiedFlag() {
return userVerifiedFlag;
}

public void setUserVerifiedFlag(boolean userVerifiedFlag) {
this.userVerifiedFlag = userVerifiedFlag;
}

public boolean isUserPresentFlag() {
return userPresentFlag;
}

public void setUserPresentFlag(boolean userPresentFlag) {
this.userPresentFlag = userPresentFlag;
}

public String getAuthentictatorAttachment() {
return authentictatorAttachment;
}

public void setApplicationId(String applicationId) {
this.applicationId = applicationId;
public void setAuthentictatorAttachment(String authentictatorAttachment) {
this.authentictatorAttachment = authentictatorAttachment;
}

@Override
public String toString() {
return "Fido2RegistrationData [username=" + username + ", domain=" + domain + ", userId=" + userId
+ ", challenge=" + challenge + ", attenstationRequest=" + attenstationRequest
+ ", attenstationResponse=" + attenstationResponse + ", uncompressedECPoint=" + uncompressedECPoint
+ ", publicKeyId=" + publicKeyId + ", type=" + type + ", counter=" + counter
+ ", attestationType=" + attestationType + ", signatureAlgorithm=" + signatureAlgorithm
+ ", applicationId=" + applicationId + "]";
public String getCredId() {
return credId;
}

public void setCredId(String credId) {
this.credId = credId;
}

public String[] getTransports() {
return transports;
}

public void setTransports(String[] transports) {
this.transports = transports;
}

}
Original file line number Diff line number Diff line change
@@ -1,79 +1,77 @@
package io.jans.casa.core.model;

import java.util.Date;

import io.jans.as.model.fido.u2f.protocol.DeviceData;
import io.jans.orm.annotation.AttributeName;
import io.jans.orm.annotation.DataEntry;
import io.jans.orm.annotation.ObjectClass;
import io.jans.orm.annotation.JsonObject;
import io.jans.orm.annotation.ObjectClass;
import io.jans.orm.model.base.Entry;

import java.util.Date;

//Using Fido2RegistrationEntry directly from fido2-model artifact does not work well!
@DataEntry
@ObjectClass(value = "jansFido2RegistrationEntry")
public class Fido2RegistrationEntry extends Entry {

@AttributeName
private String displayName;
@AttributeName
private String displayName;

@AttributeName
private Date creationDate;
@AttributeName
private Date creationDate;

@AttributeName(name = "jansId")
private String id;

@AttributeName(name = "jansApp")
private String application;
@AttributeName(name = "jansId")
private String id;

@JsonObject
@AttributeName(name = "jansRegistrationData" , ignoreDuringUpdate = true)
private Fido2RegistrationData registrationData;

@AttributeName(name = "jansCounter", ignoreDuringUpdate = true)
@AttributeName(name = "jansApp")
private String application;

@JsonObject
@AttributeName(name = "jansRegistrationData", ignoreDuringUpdate = true)
private Fido2RegistrationData registrationData;

@AttributeName(name = "jansCounter", ignoreDuringUpdate = true)
private int counter;

@JsonObject
@AttributeName(name = "jansDeviceData", ignoreDuringUpdate = true)
private DeviceData deviceData;


@JsonObject
@AttributeName(name = "jansStatus" , ignoreDuringUpdate = true)
private String registrationStatus;



public String getDisplayName() {
return displayName;
}

public void setDisplayName(String displayName) {
this.displayName = displayName;
}

public Date getCreationDate() {
return creationDate;
}

public void setCreationDate(Date creationDate) {
this.creationDate = creationDate;
}

public String getId() {
return id;
}

public void setId(String id) {
this.id = id;
}

public Fido2RegistrationData getRegistrationData() {
return registrationData;
}

public void setRegistrationData(Fido2RegistrationData registrationData) {
this.registrationData = registrationData;
}
@JsonObject
@AttributeName(name = "jansDeviceData", ignoreDuringUpdate = true)
private DeviceData deviceData;

@JsonObject
@AttributeName(name = "jansStatus", ignoreDuringUpdate = true)
private String registrationStatus;

public String getDisplayName() {
return displayName;
}

public void setDisplayName(String displayName) {
this.displayName = displayName;
}

public Date getCreationDate() {
return creationDate;
}

public void setCreationDate(Date creationDate) {
this.creationDate = creationDate;
}

public String getId() {
return id;
}

public void setId(String id) {
this.id = id;
}

public Fido2RegistrationData getRegistrationData() {
return registrationData;
}

public void setRegistrationData(Fido2RegistrationData registrationData) {
this.registrationData = registrationData;
}

public int getCounter() {
return counter;
Expand Down Expand Up @@ -107,6 +105,4 @@ public void setApplication(String application) {
this.application = application;
}



}
Loading
Loading