示例#1
0
 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);
 }
示例#2
0
 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);
 }
示例#3
0
        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);
        }
示例#4
0
 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;
 }
示例#5
0
 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;
 }
示例#6
0
 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;
 }
示例#7
0
 /**
 * 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;
     }
 }