예제 #1
0
        public ModifyResult UpdateOAuthUserAuthorization(Stream input, int id)
        {
            /*StreamReader reader = new StreamReader(input);
             * String content = reader.ReadToEnd();*/

            XmlSerializer      xmlSerializer = new XmlSerializer(typeof(OAuthAuthorization));
            OAuthAuthorization auth          = (OAuthAuthorization)xmlSerializer.Deserialize(input);

            // Create the mapper
            Arena.Custom.HDC.WebService.Contracts.OAuthAuthorizationMapper mapper =
                new Arena.Custom.HDC.WebService.Contracts.OAuthAuthorizationMapper();
            if (auth.AuthorizationId > 0)
            {
                return(mapper.Update(auth));
            }
            else
            {
                return(mapper.Create(auth));
            }
        }
예제 #2
0
        public ModifyResult UpdateOAuthUserAuthorization(String clientApiKey, OAuthAuthorization auth)
        {
            Arena.Custom.SECC.OAuth.Client client = new Arena.Custom.SECC.OAuth.Client(new Guid(clientApiKey));
            if (auth.ClientId != client.ClientId)
            {
                throw new ResourceNotFoundException("Client API Key mismatch.");
            }

            // Create the mapper
            Arena.Custom.HDC.WebService.Contracts.OAuthAuthorizationMapper mapper =
                new Arena.Custom.HDC.WebService.Contracts.OAuthAuthorizationMapper();
            if (auth.AuthorizationId > 0)
            {
                return(mapper.Update(auth));
            }
            else
            {
                return(mapper.Create(auth));
            }
        }
예제 #3
0
        public ModifyResult UpdateOAuthUserAuthorization(String clientApiKey, OAuthAuthorization auth)
        {
            Arena.Custom.SECC.OAuth.Client client = new Arena.Custom.SECC.OAuth.Client(new Guid(clientApiKey));
            if (auth.ClientId != client.ClientId)
            {
                throw new ResourceNotFoundException("Client API Key mismatch.");
            }

            // Create the mapper
            Arena.Custom.HDC.WebService.Contracts.OAuthAuthorizationMapper mapper =
                new Arena.Custom.HDC.WebService.Contracts.OAuthAuthorizationMapper();
            if (auth.AuthorizationId > 0)
            {
                return mapper.Update(auth);
            }
            else
            {
                return mapper.Create(auth);
            }
        }
예제 #4
0
        public ModifyResult UpdateOAuthUserAuthorization(Stream input, int id)
        {
            /*StreamReader reader = new StreamReader(input);
            String content = reader.ReadToEnd();*/

            XmlSerializer xmlSerializer = new XmlSerializer(typeof(OAuthAuthorization));
            OAuthAuthorization auth = (OAuthAuthorization)xmlSerializer.Deserialize(input);

            // Create the mapper
            Arena.Custom.HDC.WebService.Contracts.OAuthAuthorizationMapper mapper =
                new Arena.Custom.HDC.WebService.Contracts.OAuthAuthorizationMapper();
            if (auth.AuthorizationId > 0)
            {
                return mapper.Update(auth);
            }
            else
            {
                return mapper.Create(auth);
            }
        }