code: @SneakyThrows
      public User getOrCreateUser(final Principal principal) {
          val attributes = principal.getAttributes();
          if (!attributes.containsKey(this.mailAttribute)) {
              throw new IllegalArgumentException("No email address found for " + principal.getId());
          }
          if (!attributes.containsKey(this.phoneAttribute)) {
              throw new IllegalArgumentException("No phone number found for " + principal.getId());
          }
  
          val email = attributes.get(this.mailAttribute).get(0).toString();
          val phone = attributes.get(this.phoneAttribute).get(0).toString();
          return this.authyUsers.createUser(email, phone, this.countryCode);
      }
docs: Gets or create user.
  
  @param principal the principal
  @return the or create user