- Timestamp:
- 07/08/10 21:48:27 (14 years ago)
- Location:
- branches/HeuristicLab.Services.Authentication Prototype/UnitTests
- Files:
-
- 9 added
- 1 deleted
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.Services.Authentication Prototype/UnitTests/UnitTests.csproj
r4002 r4020 45 45 <RequiredTargetFramework>3.5</RequiredTargetFramework> 46 46 </Reference> 47 <Reference Include="System.IdentityModel"> 48 <RequiredTargetFramework>3.0</RequiredTargetFramework> 49 </Reference> 50 <Reference Include="System.IdentityModel.Selectors"> 51 <RequiredTargetFramework>3.0</RequiredTargetFramework> 52 </Reference> 47 53 <Reference Include="System.Runtime.Serialization"> 48 54 <RequiredTargetFramework>3.0</RequiredTargetFramework> … … 62 68 <Compile Include="HeuristicLabRoleProviderTest.cs" /> 63 69 <Compile Include="Properties\AssemblyInfo.cs" /> 64 <Compile Include="Service References\ ServiceManagementRemote\Reference.cs">70 <Compile Include="Service References\AuthorizationManagementServiceRemote\Reference.cs"> 65 71 <AutoGen>True</AutoGen> 66 72 <DesignTime>True</DesignTime> … … 70 76 <Compile Include="service\HeuristicLabAuthorizationManagementServiceTest_old.cs" /> 71 77 <Compile Include="service\HeuristicLabManagementServiceTest.cs" /> 78 <Compile Include="service\MyX509Validator.cs" /> 72 79 </ItemGroup> 73 80 <ItemGroup> 74 81 <Content Include="AuthoringTests.txt" /> 75 <None Include="Service References\ ServiceManagementRemote\Reference.svcmap">82 <None Include="Service References\AuthorizationManagementServiceRemote\Reference.svcmap"> 76 83 <Generator>WCF Proxy Generator</Generator> 77 84 <LastGenOutput>Reference.cs</LastGenOutput> 78 85 </None> 79 <None Include="Service References\ ServiceManagementRemote\configuration.svcinfo" />80 <None Include="Service References\ ServiceManagementRemote\configuration91.svcinfo" />86 <None Include="Service References\AuthorizationManagementServiceRemote\configuration.svcinfo" /> 87 <None Include="Service References\AuthorizationManagementServiceRemote\configuration91.svcinfo" /> 81 88 </ItemGroup> 82 89 <ItemGroup> … … 98 105 <ItemGroup> 99 106 <None Include="app.config" /> 100 <None Include="Service References\ ServiceManagementRemote\AuthorizationManagementService.wsdl" />101 <None Include="Service References\ ServiceManagementRemote\metadata.xsd" />102 <None Include="Service References\ ServiceManagementRemote\metadata1.xsd" />107 <None Include="Service References\AuthorizationManagementServiceRemote\AuthorizationManagementService.wsdl" /> 108 <None Include="Service References\AuthorizationManagementServiceRemote\metadata.xsd" /> 109 <None Include="Service References\AuthorizationManagementServiceRemote\metadata1.xsd" /> 103 110 </ItemGroup> 104 111 <ItemGroup> 105 <WCFMetadataStorage Include="Service References\ ServiceManagementRemote\" />112 <WCFMetadataStorage Include="Service References\AuthorizationManagementServiceRemote\" /> 106 113 </ItemGroup> 107 114 <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> -
branches/HeuristicLab.Services.Authentication Prototype/UnitTests/app.config
r4002 r4020 1 1 <?xml version="1.0" encoding="utf-8" ?> 2 2 <configuration> 3 <system.serviceModel> 4 <bindings> 5 <basicHttpBinding> 6 <binding name="BasicHttpBinding_IAuthorizationManagementService" 7 closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" 8 sendTimeout="00:01:00" allowCookies="false" bypassProxyOnLocal="false" 9 hostNameComparisonMode="StrongWildcard" maxBufferSize="65536" 10 maxBufferPoolSize="524288" maxReceivedMessageSize="65536" 11 messageEncoding="Text" textEncoding="utf-8" transferMode="Buffered" 12 useDefaultWebProxy="true"> 13 <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384" 14 maxBytesPerRead="4096" maxNameTableCharCount="16384" /> 15 <security mode="None"> 16 <transport clientCredentialType="None" proxyCredentialType="None" 17 realm=""> 18 <extendedProtectionPolicy policyEnforcement="Never" /> 19 </transport> 20 <message clientCredentialType="UserName" algorithmSuite="Default" /> 21 </security> 22 </binding> 23 </basicHttpBinding> 24 </bindings> 25 <client> 26 <endpoint address="http://127.0.0.1:8888/AuthorizationManagementEndpoint" 27 binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IAuthorizationManagementService" 28 contract="ServiceManagementRemote.IAuthorizationManagementService" 29 name="BasicHttpBinding_IAuthorizationManagementService" /> 30 </client> 31 32 33 34 3 <system.web> 4 <compilation debug="true" /> 5 <membership defaultProvider="HeuristiclabMemberShipProvider" userIsOnlineTimeWindow="15"> 6 <providers> 7 <clear/> 8 <add 9 name="HeuristiclabMemberShipProvider" 10 type="Service.Provider.HeuristicLabMembershipProvider, Service" 11 passwordFormat="Hashed" /> 12 </providers> 13 </membership> 14 </system.web> 15 <system.serviceModel> 16 <client> 17 <endpoint address="http://127.0.0.1:8888/AuthorizationManagementEndpoint" 18 binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_IAuthorizationManagementService" 19 contract="AuthorizationManagementServiceRemote.IAuthorizationManagementService" 20 name="WSHttpBinding_IAuthorizationManagementService" behaviorConfiguration="myClientBehavior"> 21 <identity> 22 <certificate encodedValue="AwAAAAEAAAAUAAAAPQJndve7Q/IcQ7WtwQMm02KvlrsgAAAAAQAAALgBAAAwggG0MIIBYqADAgECAhDDg1lnKGezhkH5Ju3ecmECMAkGBSsOAwIdBQAwFjEUMBIGA1UEAxMLUm9vdCBBZ2VuY3kwHhcNMTAwNTI2MjE1NDExWhcNMzkxMjMxMjM1OTU5WjAXMRUwEwYDVQQDEwxNeVNlcnZlckNlcnQwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBANsuzLfWt1O+qHpnxGDkBZCthxB4MMIfx0QSFAbUaw2YTPQu4AaoxKoMo/TeHuFmJKtrRY0Z9UTVts+KCrn+3vozmSv67YgAGh+ney2X8WgoEowmYsfJlcCtJ8OX34OXASMLlu84Q7jFs5Y/VIxNA5pvlw7bCiHus6yDu7o+b86XAgMBAAGjSzBJMEcGA1UdAQRAMD6AEBLkCS0GHR1PAI1hIdwWZGOhGDAWMRQwEgYDVQQDEwtSb290IEFnZW5jeYIQBjdsAKoAZIoRz7jUqlw19DAJBgUrDgMCHQUAA0EADYxnIrj8jVWXvohKWb4N7dc2WQ//3hFdovHbsCiE4Pz7ozi8mR/GixdbLKhm/rCr1M5eoiaz8xNkoa5owMB/xQ==" /> 23 </identity> 24 </endpoint> 25 </client> 26 <bindings> 27 <wsHttpBinding> 28 <binding name="Binding"> 29 <security mode="Message"> 30 <transport> 31 <extendedProtectionPolicy policyEnforcement="Never" /> 32 </transport> 33 <message clientCredentialType="UserName" /> 34 </security> 35 </binding> 36 <binding name="WSHttpBinding_IAuthorizationManagementService" 37 closeTimeout="00:01:00" openTimeout="00:01:00" receiveTimeout="00:10:00" 38 sendTimeout="00:01:00" bypassProxyOnLocal="false" transactionFlow="false" 39 hostNameComparisonMode="StrongWildcard" maxBufferPoolSize="524288" 40 maxReceivedMessageSize="65536" messageEncoding="Text" textEncoding="utf-8" 41 useDefaultWebProxy="true" allowCookies="false"> 42 <readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384" 43 maxBytesPerRead="4096" maxNameTableCharCount="16384" /> 44 <reliableSession ordered="true" inactivityTimeout="00:10:00" 45 enabled="false" /> 46 <security mode="Message"> 47 <transport clientCredentialType="Windows" proxyCredentialType="None" 48 realm=""> 49 <extendedProtectionPolicy policyEnforcement="Never" /> 50 </transport> 51 <message clientCredentialType="UserName" negotiateServiceCredential="true" 52 algorithmSuite="Default" establishSecurityContext="true" /> 53 </security> 54 </binding> 55 </wsHttpBinding> 56 </bindings> 57 <behaviors> 58 <endpointBehaviors> 59 <behavior name="myClientBehavior"> 60 <clientCredentials> 61 <serviceCertificate> 62 <authentication certificateValidationMode="Custom" customCertificateValidatorType=" UnitTests.service.MyX509Validator,UnitTests" /> 63 </serviceCertificate> 64 </clientCredentials> 65 </behavior> 66 </endpointBehaviors> 35 67 36 37 38 </system.serviceModel>39 <system.web>40 <compilation debug="true" />41 <membership defaultProvider="HeuristiclabMemberShipProvider" userIsOnlineTimeWindow="15">42 <providers>43 <clear/>44 <add45 name="HeuristiclabMemberShipProvider"46 type="Service.Provider.HeuristicLabMembershipProvider, Service"47 passwordFormat= "Hashed"/>48 </providers>49 </membership>50 </system.web>51 52 <system.serviceModel>53 <behaviors>54 68 <serviceBehaviors> 55 69 <behavior name="HttpServiceBehavior"> 70 <serviceCredentials> 71 72 <userNameAuthentication membershipProviderName="HeuristiclabMemberShipProvider" userNamePasswordValidationMode="Custom" customUserNamePasswordValidatorType="Service.Provider.HeuristicLabUsernamePasswordValidator, Service" /> 73 <serviceCertificate findValue="MyServerCert" x509FindType="FindBySubjectName" storeLocation="LocalMachine" storeName="My" /> 74 </serviceCredentials> 56 75 <serviceMetadata httpGetEnabled="true" httpGetUrl="http://127.0.0.1:8888/metadata" /> 57 76 <serviceDebug httpHelpPageUrl="http://127.0.0.1:8888/debug" /> … … 62 81 <service behaviorConfiguration="HttpServiceBehavior" name="Service.Services.Administration.AuthorizationManagementService"> 63 82 <endpoint address="http://127.0.0.1:8888/AuthorizationManagementEndpoint" 64 binding=" basicHttpBinding" bindingConfiguration="" contract="Service.Services.Administration.IAuthorizationManagementService" />83 binding="wsHttpBinding" bindingConfiguration="Binding" contract="Service.Services.Administration.IAuthorizationManagementService" /> 65 84 <host> 66 85 <baseAddresses> … … 70 89 </service> 71 90 </services> 91 92 93 72 94 </system.serviceModel> 73 95 </configuration> -
branches/HeuristicLab.Services.Authentication Prototype/UnitTests/service/HeuristicLabManagementServiceTest.cs
r4002 r4020 4 4 using System.Linq; 5 5 using Microsoft.VisualStudio.TestTools.UnitTesting; 6 using System.Web.Security; 6 7 7 8 namespace UnitTests.service { … … 27 28 } 28 29 } 30 [TestMethod()] 29 31 public void TestCreateRoleTest() { 30 new ServiceManagementRemote.AuthorizationManagementServiceClient().CreateRole("myRole", true); 32 MembershipProvider provider = Membership.Provider; 33 MembershipCreateStatus status; 34 provider.CreateUser("testUser", "mypassword", "myMail", "question", "answer", true, null,out status); 35 Assert.AreEqual(MembershipCreateStatus.Success, status); 36 37 AuthorizationManagementServiceRemote.AuthorizationManagementServiceClient client = new AuthorizationManagementServiceRemote.AuthorizationManagementServiceClient(); 38 client.ClientCredentials.UserName.UserName = "testUser"; 39 client.ClientCredentials.UserName.Password = "mypassword"; 40 client.CreateRole("roleName", true); 31 41 } 32 42
Note: See TracChangeset
for help on using the changeset viewer.