protected static String getInstanceId(sRequest request) { if (request.AuthType != AuthType.NONE) { return(request.getSecurityToken().getModuleId().ToString()); } // Requests that don't use authentication can share the result. return(DEFAULT_KEY_VALUE); }
protected static String getViewerId(sRequest request) { if (request.AuthType != AuthType.NONE && request.getOAuthArguments().getSignViewer()) { return(request.getSecurityToken().getViewerId()); } // Requests that don't use authentication can share the result. return(DEFAULT_KEY_VALUE); }
protected static String getTokenOwner(sRequest request) { ISecurityToken st = request.getSecurityToken(); if (request.AuthType != AuthType.NONE && st.getOwnerId() != null && st.getOwnerId().Equals(st.getViewerId()) && request.getOAuthArguments().mayUseToken()) { return(st.getOwnerId()); } // Requests that don't use authentication can share the result. return(DEFAULT_KEY_VALUE); }
protected static String getInstanceId(sRequest request) { if (request.AuthType != AuthType.NONE) { return request.getSecurityToken().getModuleId().ToString(); } // Requests that don't use authentication can share the result. return DEFAULT_KEY_VALUE; }
protected static String getTokenOwner(sRequest request) { ISecurityToken st = request.getSecurityToken(); if (request.AuthType != AuthType.NONE && st.getOwnerId() != null && st.getOwnerId().Equals(st.getViewerId()) && request.getOAuthArguments().mayUseToken()) { return st.getOwnerId(); } // Requests that don't use authentication can share the result. return DEFAULT_KEY_VALUE; }
protected static String getViewerId(sRequest request) { if (request.AuthType != AuthType.NONE && request.getOAuthArguments().getSignViewer()) { return request.getSecurityToken().getViewerId(); } // Requests that don't use authentication can share the result. return DEFAULT_KEY_VALUE; }
/** * OAuth authenticated fetch. */ public sResponse fetch(sRequest request) { realRequest = request; clientState = new OAuthClientState( fetcherConfig.getStateCrypter(), request.getOAuthArguments().getOrigClientState()); responseParams = new OAuthResponseParams(request.getSecurityToken(), request, fetcherConfig.getStateCrypter()); try { return fetchNoThrow(); } catch (Exception e) { // We log here to record the request/response pairs that created the failure. responseParams.logDetailedWarning("OAuth fetch unexpected fatal error", e); throw e; } }