コード例 #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
ファイル: AuthAPI.cs プロジェクト: secc/arena-secc-webservice
        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
ファイル: AuthAPI.cs プロジェクト: secc/arena-secc-webservice
        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);
            }
        }