Returns a simple username without any domain prefixes.

@param username
@return a simple username
331693
private String getSimpleUsername(String username) {
        int lastSlash = username.lastIndexOf('\\');
        if (lastSlash > -1) {
            username = username.substring(lastSlash + 1);
        }

        return username;
    }
614638
public Response deleteUser(String username) {
		return restClient.delete("users/" + username, new HashMap<String, String>());
	}
1353665
public String getName(String oldName) {
        if (oldName != null && this.existing.containsKey(oldName)) {
            return this.existing.get(oldName);
        }

        final String name = this.prefix + this.counter;
        this.counter++;

        if (oldName != null) {
            this.existing.put(oldName, name);
        }

        return name;
    }
276137
@ReadOperation
    public YubiKeyAccount get(@Selector final String username) {
        val result = registry.getAccount(username);
        return result.orElse(null);
    }
1054910
private String getUsernameForUserId(int id) {
        if (id > 0) {
            String username = userIdentityStore.getPortalUserName(id);
            if (username != null) {
                return username;
            }
            logger.warn(
                    "Invalid userID {} found when exporting a portlet; return system username instead",
                    id);
        }
        return systemUsername;
    }
811293
@GET
    @Produces(MediaType.APPLICATION_JSON)
    @Path("/username/{username}")
    @Description("Returns the user having the given username.")
    public PrincipalUserDto getUserByUsername(@Context HttpServletRequest req,
        @PathParam("username") final String userName) {

        Enumeration<String> headerNames = req.getHeaderNames();
        while(headerNames.hasMoreElements()) {
            String headerName = headerNames.nextElement();
            String headerValue = req.getHeader(headerName);
            System.out.println(headerName + ": " + headerValue);
        }

        if (userName == null || userName.isEmpty()) {
            throw new WebApplicationException("Username cannot be null or empty.", Status.BAD_REQUEST);
        }

        PrincipalUser remoteUser = validateAndGetOwner(req, null);
        PrincipalUser user = _uService.findUserByUsername(userName);

        if (user != null) {
            super.validateResourceAuthorization(req, user, remoteUser);
            return PrincipalUserDto.transformToDto(user);
        } else if (!remoteUser.isPrivileged()) {
            throw new WebApplicationException(Response.Status.FORBIDDEN.getReasonPhrase(), Response.Status.FORBIDDEN);
        } else {
            throw new WebApplicationException(Response.Status.NOT_FOUND.getReasonPhrase(), Response.Status.NOT_FOUND);
        }
    }
60353
public java.lang.String getAuthDomain() {
    java.lang.Object ref = authDomain_;
    if (ref instanceof java.lang.String) {
      return (java.lang.String) ref;
    } else {
      com.google.protobuf.ByteString bs = 
          (com.google.protobuf.ByteString) ref;
      java.lang.String s = bs.toStringUtf8();
      authDomain_ = s;
      return s;
    }
  }
40125
String getName() {
        int idx = mName.lastIndexOf('/');
        return (idx > 0) ? mName.substring(idx) : mName;
    }
589422
@Produces
    @LoggedIn
    public String extractUsername() {

        final KeycloakPrincipal principal = (KeycloakPrincipal) httpServletRequest.getUserPrincipal();
        if (principal != null) {
            logger.debug("Running with Keycloak context");
            KeycloakSecurityContext kcSecurityContext = principal.getKeycloakSecurityContext();
            return kcSecurityContext.getToken().getPreferredUsername();
        }

        logger.debug("Running outside of Keycloak context");
        final String basicUsername = HttpBasicHelper.extractUsernameAndPasswordFromBasicHeader(httpServletRequest)[0];
        if (! basicUsername.isEmpty()) {
            logger.debug("running HttpBasic auth");
            return basicUsername;
        }

        logger.debug("Running without any Auth context");
        return "admin"; // by default, we are admin!
    }
541495
private static String nameOnly(final String filename) {
        final int p = filename.lastIndexOf('.');
        if (p == -1) {
            return filename;
        }
        return filename.substring(0, p);
    }
316570
public static int indexOfDomainMatch(String userName) {
    if (userName == null) {
      return -1;
    }

    int idx = userName.indexOf('/');
    int idx2 = userName.indexOf('@');
    int endIdx = Math.min(idx, idx2); // Use the earlier match.
    // Unless at least one of '/' or '@' was not found, in
    // which case, user the latter match.
    if (endIdx == -1) {
      endIdx = Math.max(idx, idx2);
    }
    return endIdx;
  }
333984
public void setUsername(String username) {
        for (Authentication auth : authentications.values()) {
            if (auth instanceof HttpBasicAuth) {
                ((HttpBasicAuth) auth).setUsername(username);
                return;
            }
        }
        throw new RuntimeException("No HTTP basic authentication configured!");
    }
1063189
@Override
    public String getUserName() {
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.entry(this, tc, "getUserName");
        String userName = jcaConnectionFactory.getUserName();
        if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
            SibTr.exit(this, tc, "getUserName", userName);
        return userName;
    }
300638
public function getUserToken(string $userName) : string {
        if (isset($this->userToken[$userName])) {
            return $this->userToken[$userName];
        }
    }
190384
public QName get(String localName) {
        if (uri != null && uri.length() > 0) {
            if (prefix != null) {
                return new QName(uri, localName, prefix);
            }
            else {
                return new QName(uri, localName);
            }
        }
        else {
            return new QName(localName);
        }
    }
901632
public String getName() {
        if (name == null && securityIdentity != null) {
            name = securityIdentity.getPrincipal().getName();
        }

        return name;
    }
3747
@Override
    public String getUserName(HttpServletRequest req) {
        Principal princ = null;
        if (req != null && (princ = req.getUserPrincipal()) != null) {
            String userName = princ.getName();
            if (userName != null && !userName.isEmpty()) {
                LOG.debug("HTTP request had user (" + userName + ")");
                return userName;
            }
        }
        return null;
    }