public Map<String, Object> process(Map<String, Object> claims) { ServletDebugUtil.dbg(this, "starting processing"); if(config == null || config.isEmpty()){ ServletDebugUtil.dbg(this, "NO configuration, returning."); return claims; } logicBlocks = createLogicBlocks(config, claims); ServletDebugUtil.dbg(this, "created " + logicBlocks.size() + " logic blocks."); logicBlocks.execute(); executed = true; ServletDebugUtil.dbg(this, "Finished processing, returned claims are"); ServletDebugUtil.dbg(this, claims.toString()); return claims; }
/** * This will print all parameters to standard err. It is a low-level debugging tool * and should never be used in production. It gives in effect a report on what is * actually being passed in. * * @param request */ protected void printAllParameters(HttpServletRequest request) { ServletDebugUtil.printAllParameters(this.getClass(), request); } }
public static void printAllParameters(Class klasse, HttpServletRequest request) { if(!isEnabled()) return; String reqUrl = request.getRequestURL().toString();
if(ServletDebugUtil.isEnabled()){ t.printStackTrace();
/** * create the logic blocks for this configuration. It also configures the factory * @param configuration * @return */ protected LogicBlocks<? extends LogicBlock> createLogicBlocks(JSONObject configuration, Map<String, Object> claims){ ServletDebugUtil.dbg(this, "config:\n\n" + config.toString(2)); OA2FunctorFactory functorFactory = new OA2FunctorFactory(claims, null); JSONArray jsonArray = new JSONArray(); jsonArray.add(config); JSONObject j = new JSONObject(); j.put(FunctorTypeImpl.OR.getValue(), jsonArray); ServletDebugUtil.dbg(this, "created logic blocks:\n\n" + j.toString(2)); return functorFactory.createLogicBlock(j); } protected boolean executed = false;
protected void printAllParameters(HttpServletRequest request) { ServletDebugUtil.printAllParameters(this.getClass(), request); }
public IResponse2 processRTRequest(IssuerRequest req) { RTIRequest request = (RTIRequest) req; Map<String, String> reqParamMap = OA2Utilities.getParameters(request.getServletRequest()); ServletDebugUtil.dbg(this,"Request parameters:" + reqParamMap); reqParamMap.put(OA2Constants.CLIENT_ID, req.getClient().getIdentifierString()); OA2TokenForge tokenForge2 = (OA2TokenForge) tokenForge; RefreshToken refreshToken = tokenForge2.getRefreshToken(); AccessToken accessToken = tokenForge2.getAccessToken(); // spec says all new access token RTIResponse resp = new RTIResponse(accessToken,refreshToken); resp.setParameters(reqParamMap); return resp; } }
ServletDebugUtil.dbg(OA2ClientConfigurationUtil.class, "This does not contain the existing LDAP. Adding it."); ServletDebugUtil.dbg(OA2ClientConfigurationUtil.class, "Claim sources does not include old LDAP. No runtime/pre-processor, so creating default."); createDefaultPreProcessor(config, oldLDAPName); String newName = Long.toHexString(newValue); content.put(ID_TAG, newName); ServletDebugUtil.dbg(OA2ClientConfigurationUtil.class, ".convertToNewConfig: old LDAP size =" + oldLDAP.size() + ", keyset = " + oldLDAP.keySet()); oldLDAP.put(LDAP_TAG, content); claimSources.add(oldLDAP); ServletDebugUtil.dbg(OA2ClientConfigurationUtil.class, "Done creating new Claim source with id = " + newName + ". Create default processor?" + (!OA2ClientConfigurationUtil.hasClaimPreProcessor(config) && !hasRuntime(config))); if (!hasClaimPreProcessor(config) && !hasRuntime(config)) {
/** * If you have store updates that need to get done, put them in this method, * invoking super. Calls to this are managed by the servlet to make sure * nothing get called more than once. * @throws IOException * @throws SQLException */ protected void realStoreUpdates() throws IOException, SQLException{ ServletDebugUtil.dbg(this, "starting store updates"); processStoreCheck(getTransactionStore()); processStoreCheck(getServiceEnvironment().getClientStore()); processStoreCheck(getServiceEnvironment().getClientApprovalStore()); }
@Override public ClaimSource create(ClaimSourceFactoryRequest request) { if (request instanceof LDAPClaimSourceFactoryRequest) { ServletDebugUtil.dbg(this, ".create: request = " + request); LDAPClaimSourceFactoryRequest req = (LDAPClaimSourceFactoryRequest) request; LDAPClaimsSource h = new LDAPClaimsSource(req.getLdapConfiguration(), req.getLogger()); h.setScopes(req.getScopes()); return h; } BasicClaimsSourceImpl h = new BasicClaimsSourceImpl(); h.setConfiguration(request.getConfiguration()); h.setScopes(request.getScopes()); return h; }
JSONArray array = (JSONArray) temp; if (array.size() != 1) { ServletDebugUtil.dbg(this,"Got " + array.size() + " LDAP configurations. Using first one only...");