code: @Override
      public Optional<String> getLogin() {
          return getAuthentication().map(auth -> {
              Object principal = auth.getPrincipal();
              if (principal instanceof UserDetails) {
                  UserDetails springSecurityUser = UserDetails.class.cast(principal);
                  return springSecurityUser.getUsername();
              } else if (principal instanceof String) {
                  return (String) principal;
              }
  
              return null;
          });
      }
docs: {@inheritDoc}