Example #1
0
        public override ValidateTokenResponse callValidateTokenEndpoint(ValidateTokenRequest treq)
        {
            ValidateTokenResponse vtr             = new ValidateTokenResponse();
            FBPermssionData       fbPermssionData = new FBPermssionData();

            string url = TokenEndpointUrl + "/" + treq.UserID + "/permissions?access_token=" + treq.access_token.token;

            HttpWebRequest             request    = (HttpWebRequest)WebRequest.Create(url);
            HttpWebResponse            response   = (HttpWebResponse)request.GetResponse();
            DataContractJsonSerializer serializer = new DataContractJsonSerializer(typeof(FBPermssionData));

            fbPermssionData = serializer.ReadObject(response.GetResponseStream()) as FBPermssionData;

            CST_Ops.recordme(new OAuth20NameSpace.AuthorizationServerImpl(), treq, vtr, typeof(AuthorizationServer).GetMethod("ValidateTicket"), "facebook.com", false, false);
            vtr.UserID       = treq.UserID;
            vtr.scope        = treq.scope;
            vtr.access_token = treq.access_token;

            return(vtr);
        }
Example #2
0
        public override ValidateTokenResponse callValidateTokenEndpoint(ValidateTokenRequest treq)
        {
            ValidateTokenResponse vtr = new ValidateTokenResponse();
            FBPermssionData fbPermssionData = new FBPermssionData();

            string url = TokenEndpointUrl + "/" + treq.UserID + "/permissions?access_token=" + treq.access_token.token;

            HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
            HttpWebResponse response = (HttpWebResponse)request.GetResponse();
            DataContractJsonSerializer serializer = new DataContractJsonSerializer(typeof(FBPermssionData));
            fbPermssionData = serializer.ReadObject(response.GetResponseStream()) as FBPermssionData;

            CST_Ops.recordme(new OAuth20NameSpace.AuthorizationServerImpl(), treq, vtr, typeof(AuthorizationServer).GetMethod("ValidateTicket"), "facebook.com", false, false);
            vtr.UserID = treq.UserID;
            vtr.scope = treq.scope;
            vtr.access_token = treq.access_token;

            return vtr;
        }