예제 #1
0
        public OAuthArguments(RequestAuthenticationInfo info)
        {
            signViewer         = false;
            signOwner          = false;
            bypassSpecCache    = false;
            origClientState    = null;
            requestTokenSecret = null;
            requestToken       = null;
            tokenName          = "";
            serviceName        = "";
            useToken           = UseToken.ALWAYS;
            Dictionary <string, string> attrs = info.getAttributes();

            useToken           = ParseUseToken(info.getAuthType(), GetAuthInfoParam(attrs, USE_TOKEN_PARAM, ""));
            serviceName        = GetAuthInfoParam(attrs, SERVICE_PARAM, "");
            tokenName          = GetAuthInfoParam(attrs, TOKEN_PARAM, "");
            requestToken       = GetAuthInfoParam(attrs, REQUEST_TOKEN_PARAM, null);
            requestTokenSecret = GetAuthInfoParam(attrs,
                                                  REQUEST_TOKEN_SECRET_PARAM, null);
            origClientState = null;
            bypassSpecCache = false;
            signOwner       = info.isSignOwner();
            signViewer      = info.isSignViewer();
            foreach (var pair in info.getAttributes())
            {
                requestOptions.Add(pair.Key, pair.Value);
            }
        }
예제 #2
0
 public static sRequest newHttpRequest(GadgetContext context,
             RequestAuthenticationInfo authenticationInfo)
 {
     sRequest request = new sRequest(authenticationInfo.getHref())
         .setSecurityToken(context.getToken())
         .setOAuthArguments(new OAuthArguments(authenticationInfo))
         .setAuthType(authenticationInfo.getAuthType())
         .setContainer(context.getContainer())
         .setGadget(Uri.fromJavaUri(context.getUrl()));
     return request;
 }
예제 #3
0
        public static sRequest newHttpRequest(GadgetContext context,
                                              RequestAuthenticationInfo authenticationInfo)
        {
            sRequest request = new sRequest(authenticationInfo.getHref())
                               .setSecurityToken(context.getToken())
                               .setOAuthArguments(new OAuthArguments(authenticationInfo))
                               .setAuthType(authenticationInfo.getAuthType())
                               .setContainer(context.getContainer())
                               .setGadget(Uri.fromJavaUri(context.getUrl()));

            return(request);
        }
예제 #4
0
 public OAuthArguments(RequestAuthenticationInfo info)
 {
     signViewer = false;
     signOwner = false;
     bypassSpecCache = false;
     origClientState = null;
     requestTokenSecret = null;
     requestToken = null;
     tokenName = "";
     serviceName = "";
     useToken = UseToken.ALWAYS;
     Dictionary<string, string> attrs = info.getAttributes();
     useToken = ParseUseToken(info.getAuthType(), GetAuthInfoParam(attrs, USE_TOKEN_PARAM, ""));
     serviceName = GetAuthInfoParam(attrs, SERVICE_PARAM, "");
     tokenName = GetAuthInfoParam(attrs, TOKEN_PARAM, "");
     requestToken = GetAuthInfoParam(attrs, REQUEST_TOKEN_PARAM, null);
     requestTokenSecret = GetAuthInfoParam(attrs,
                                           REQUEST_TOKEN_SECRET_PARAM, null);
     origClientState = null;
     bypassSpecCache = false;
     signOwner = info.isSignOwner();
     signViewer = info.isSignViewer();
     foreach (var pair in info.getAttributes())
     {
         requestOptions.Add(pair.Key,pair.Value);
     }
 }
예제 #5
0
        protected override AuthenticationResult OnAuthenticationRequest(ISIPExtension extension, RequestAuthenticationInfo authInfo)
        {
            Console.WriteLine("Authentication request received from: " + authInfo.From.UserName);

            var success = _sessionCache.VerifySession(authInfo.From.UserName, authInfo.AuthName);

            if (success)
            {
                Console.WriteLine("Authentication accepted. UserName: "******"Authentication denied. UserName: " + extension.ExtensionID);
            }

            return(new AuthenticationResult(success));
        }