-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
Showing
10 changed files
with
56 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,7 +25,7 @@ | |
import java.util.List; | ||
|
||
/** | ||
* Representation of an allowed authenticator instance. | ||
* Representation of a FIDO2 Credential. | ||
* | ||
* @author Jan Pesek, [email protected] | ||
*/ | ||
|
@@ -34,7 +34,7 @@ | |
@ToString | ||
@Builder | ||
@Jacksonized | ||
public class AllowCredentials { | ||
public class Credential { | ||
|
||
private final byte[] credentialId; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,9 +18,12 @@ | |
|
||
package com.wultra.security.powerauth.fido2.model.response; | ||
|
||
import com.wultra.security.powerauth.fido2.model.entity.Credential; | ||
import lombok.Data; | ||
import lombok.ToString; | ||
|
||
import java.util.List; | ||
|
||
/** | ||
* @author Roman Strobl, [email protected] | ||
*/ | ||
|
@@ -32,5 +35,6 @@ public class RegistrationChallengeResponse { | |
@ToString.Exclude | ||
private String challenge; | ||
private String userId; | ||
private List<Credential> excludeCredentials; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,10 +19,15 @@ | |
package com.wultra.powerauth.fido2.rest.model.converter; | ||
|
||
import com.wultra.powerauth.fido2.rest.model.entity.RegistrationChallenge; | ||
import com.wultra.security.powerauth.fido2.model.entity.AuthenticatorDetail; | ||
import com.wultra.security.powerauth.fido2.model.entity.Credential; | ||
import com.wultra.security.powerauth.fido2.model.response.RegistrationChallengeResponse; | ||
import lombok.extern.slf4j.Slf4j; | ||
import org.springframework.stereotype.Component; | ||
|
||
import java.util.Base64; | ||
import java.util.List; | ||
|
||
/** | ||
* @author Petr Dvorak, [email protected] | ||
*/ | ||
|
@@ -45,7 +50,19 @@ public RegistrationChallengeResponse fromChallenge(RegistrationChallenge source) | |
destination.setActivationId(source.getActivationId()); | ||
destination.setApplicationId(source.getApplicationId()); | ||
destination.setChallenge(source.getChallenge()); | ||
destination.setExcludeCredentials(source.getExcludeCredentials()); | ||
return destination; | ||
} | ||
|
||
public static Credential toCredentialDescriptor(final AuthenticatorDetail authenticatorDetail) { | ||
@SuppressWarnings("unchecked") | ||
final List<String> transports = (List<String>) authenticatorDetail.getExtras().get("transports"); | ||
final byte[] credentialId = Base64.getDecoder().decode(authenticatorDetail.getCredentialId()); | ||
|
||
return Credential.builder() | ||
.credentialId(credentialId) | ||
.transports(transports) | ||
.build(); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters