diff --git a/biometric-authenticator/src/main/java/io/twentysixty/demos/auth/svc/Service.java b/biometric-authenticator/src/main/java/io/twentysixty/demos/auth/svc/Service.java index 271f4e9..9af06ba 100644 --- a/biometric-authenticator/src/main/java/io/twentysixty/demos/auth/svc/Service.java +++ b/biometric-authenticator/src/main/java/io/twentysixty/demos/auth/svc/Service.java @@ -143,6 +143,11 @@ public class Service { @ConfigProperty(name = "io.twentysixty.demos.auth.messages.root.menu.option1") String ROOT_MENU_OPTION1; + @ConfigProperty(name = "io.twentysixty.demos.auth.messages.root.menu.no_cred") + Optional ROOT_MENU_NO_CRED; + + + @ConfigProperty(name = "io.twentysixty.demos.auth.messages.option1") String OPTION1_MSG; @@ -170,6 +175,7 @@ public void newConnection(UUID connectionId) throws Exception { mtProducer.sendMessage(this.getRootMenu(connectionId, null)); + mtProducer.sendMessage(this.getIdentityCredentialRequest(connectionId, null)); //entryPointCreate(connectionId, null, null); } @@ -507,10 +513,27 @@ public BaseMessage getRootMenu(UUID connectionId, Session session) { if ((session == null) || (session.getAuthTs() == null) ){ menu.setDescription(getMessage("ROOT_MENU_DEFAULT_DESCRIPTION")); options.add(ContextualMenuItem.build(CMD_ROOT_MENU_AUTHENTICATE, getMessage("ROOT_MENU_AUTHENTICATE"), null)); - options.add(ContextualMenuItem.build(CMD_ROOT_MENU_NO_CRED, getMessage("ROOT_MENU_NO_CRED"), null)); + if (ROOT_MENU_NO_CRED.isPresent()) { + options.add(ContextualMenuItem.build(CMD_ROOT_MENU_NO_CRED, ROOT_MENU_NO_CRED.get(), null)); + } else { + options.add(ContextualMenuItem.build(CMD_ROOT_MENU_NO_CRED, getMessage("ROOT_MENU_NO_CRED"), null)); + } + } else { - menu.setDescription(getMessage("ROOT_MENU_AUTHENTICATED_DESCRIPTION").replaceAll("NAME", session.getFirstname() + " " + session.getLastname())); + if ((session.getFirstname() != null) && (session.getLastname() != null)) { + menu.setDescription(getMessage("ROOT_MENU_AUTHENTICATED_DESCRIPTION").replaceAll("NAME", session.getFirstname() + " " + session.getLastname())); + + } else if (session.getAvatarName() != null){ + menu.setDescription(getMessage("ROOT_MENU_AUTHENTICATED_DESCRIPTION").replaceAll("NAME", session.getAvatarName())); + + } else if (session.getCitizenId() != null) { + menu.setDescription(getMessage("ROOT_MENU_AUTHENTICATED_DESCRIPTION").replaceAll("NAME", session.getCitizenId())); + + } else { + menu.setDescription(getMessage("ROOT_MENU_AUTHENTICATED_DESCRIPTION").replaceAll("NAME", "")); + + } options.add(ContextualMenuItem.build(CMD_ROOT_MENU_OPTION1, ROOT_MENU_OPTION1, null)); options.add(ContextualMenuItem.build(CMD_ROOT_MENU_LOGOUT, this.getMessage("ROOT_MENU_LOGOUT"), null)); diff --git a/biometric-authenticator/src/main/resources/META-INF/resources/avatar.old.png b/biometric-authenticator/src/main/resources/META-INF/resources/avatar.old.png deleted file mode 100644 index 2623fa1..0000000 Binary files a/biometric-authenticator/src/main/resources/META-INF/resources/avatar.old.png and /dev/null differ diff --git a/biometric-authenticator/src/main/resources/META-INF/resources/avatar.old2.png b/biometric-authenticator/src/main/resources/META-INF/resources/avatar.old2.png deleted file mode 100644 index 8fef2d9..0000000 Binary files a/biometric-authenticator/src/main/resources/META-INF/resources/avatar.old2.png and /dev/null differ diff --git a/biometric-authenticator/src/main/resources/META-INF/resources/avatar.png b/biometric-authenticator/src/main/resources/META-INF/resources/avatar.png deleted file mode 100644 index 1129a82..0000000 Binary files a/biometric-authenticator/src/main/resources/META-INF/resources/avatar.png and /dev/null differ diff --git a/biometric-authenticator/src/main/resources/META-INF/resources/gaia.png b/biometric-authenticator/src/main/resources/META-INF/resources/gaia.png deleted file mode 100644 index 1129a82..0000000 Binary files a/biometric-authenticator/src/main/resources/META-INF/resources/gaia.png and /dev/null differ diff --git a/biometric-authenticator/src/main/resources/application.properties b/biometric-authenticator/src/main/resources/application.properties index 65c66b5..8dcf24d 100644 --- a/biometric-authenticator/src/main/resources/application.properties +++ b/biometric-authenticator/src/main/resources/application.properties @@ -8,8 +8,11 @@ io.twentysixty.demos.auth.language=en io.twentysixty.demos.auth.messages.welcome=Welcome to the Auth demo service! By using this demo service you'll understand how to authenticate a user by requesting an identity credential, and by demonstrating that the mobile phone user is the same person that the one in the presented credential. io.twentysixty.demos.auth.messages.root.menu.title=Auth demo service io.twentysixty.demos.auth.messages.root.menu.option1=Request Support +io.twentysixty.demos.auth.messages.root.menu.no_cred=Get your Identity Card io.twentysixty.demos.auth.messages.option1=You selected option1 in contextual menu io.twentysixty.demos.auth.messages.nocred=If you do not have a GaiaID Identity Card (required to authenticate yourself), get one by connecting to below service. +io.twentysixty.demos.auth.messages.auth_success=You're Authenticated. + %dev.io.twentysixty.demos.auth.vision.redirdomain=p2604.ovpndev.2060.io %dev.io.twentysixty.demos.auth.vision.redirdomain.q=p2603.ovpndev.2060.io @@ -22,6 +25,7 @@ io.twentysixty.demos.auth.credential_issuer=did:web:registry.demos.dev.2060.io io.twentysixty.demos.auth.credential_issuer.avatar=https://q.registry.demos.dev.2060.io/gaia.png io.twentysixty.demos.auth.id_credential_def=did:web:registry.demos.dev.2060.io?service=anoncreds&relativeRef=/credDef/7QxmjvXdW2Z4tg1cZ5aSwtvBukasoH5MGn5Dx73wpmeh +io.twentysixty.demos.auth.request.citizenId=false io.twentysixty.demos.auth.request.firstname=true io.twentysixty.demos.auth.request.lastname=true io.twentysixty.demos.auth.request.photo=true