Ejemplo n.º 1
0
  protected Account getAccount(ApiRequest request) {
    Account account = null;

    for (AccountLookup lookup : accountLookups) {
      if (lookup.isConfigured()) {
        account = lookup.getAccount(request);
        if (account != null) {
          request.setAttribute(AccountConstants.AUTH_TYPE, lookup.getName());
          break;
        }
      }
    }

    if (account != null) {
      return account;
    }

    if (SecurityConstants.SECURITY.get()) {
      for (AccountLookup lookup : accountLookups) {
        if (lookup.challenge(request)) {
          break;
        }
      }
    }

    return null;
  }
Ejemplo n.º 2
0
 public Account getAccountAccess(String token, ApiRequest request) {
   if (!StringUtils.equals(AbstractTokenUtil.TOKEN, request.getType()) && isConfigured()) {
     request.setAttribute(tokenUtils().tokenType(), token);
     return getAccountAccessInternal();
   }
   return null;
 }