Exemplo n.º 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);
 }
Exemplo n.º 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);
 }
Exemplo n.º 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);
        }
Exemplo n.º 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;
 }
Exemplo n.º 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;
 }
Exemplo n.º 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;
 }
Exemplo n.º 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;
     }
 }