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-fido2): #2971 #2972

Merged
merged 1 commit into from
Nov 14, 2022
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 @@ -29,7 +29,25 @@

/**
* Logger service
* At startup of any server (FIDO2, jans-auth, casa etc)
* LoggerService is initialized inside the Application Initializer
* (AppInitializer) class for the respective server.
*
* In the server configuration for each application fido2, jans-auth,casa etc,
* you can change the log level and the same is reflected in the corresponding
* log level database entry
*
* And this service/timer will update log level in all created loggers
*
* There are 2 limitations of this Timer
*
* 1. It updates log level only after server startup. First time it does this
* after 15 seconds delay. 2. It can update logging level only after
* instantiating loggers. This means that if no one call specific service with
* own logger this logger will be not created But after first call logger timer
* will update it level as well
*
*
* @author Yuriy Movchan Date: 08/19/2018
*/
public abstract class LoggerService {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,16 +84,19 @@ public void init(@Observes @ApplicationInitialized(ApplicationScoped.class) Obje
public List<X509Certificate> getAttestationRootCertificates(JsonNode metadataNode,
List<X509Certificate> attestationCertificates) {
JsonNode metaDataStatement = null;
try {
metaDataStatement = dataMapperService.readTree(metadataNode.get("metadataStatement").toPrettyString());
} catch (IOException e) {
log.error("Error parsing the metadata statement", e);
// incase of u2f-fido2 attestation
if (metadataNode != null) {
try {
metaDataStatement = dataMapperService.readTree(metadataNode.get("metadataStatement").toPrettyString());
} catch (IOException e) {
log.error("Error parsing the metadata statement", e);
}
}

if (metaDataStatement == null || !metaDataStatement.has("attestationRootCertificates")) {
if (metadataNode == null || metaDataStatement == null
|| !metaDataStatement.has("attestationRootCertificates")) {
List<X509Certificate> selectedRootCertificate = certificateService
.selectRootCertificates(rootCertificatesMap, attestationCertificates);

return selectedRootCertificate;
}

Expand Down
6 changes: 1 addition & 5 deletions jans-fido2/server/src/main/resources/log4j2.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,7 @@
<!-- ############### Gluu ################# -->
<Logger name="org.gluu" level="${log4j.default.log.level}" />

<Logger name="io.jans.fido2" level="INFO">
<AppenderRef ref="FILE" />
</Logger>

<Logger name="org.gluu.site.ldap" level="${log4j.default.log.level}" additivity="false">
<Logger name="org.gluu.site.ldap" level="${log4j.default.log.level}" additivity="false">
<AppenderRef ref="PERSISTENCE_FILE" />
</Logger>

Expand Down