Advertisement
Guest User

Untitled

a guest
Jun 4th, 2016
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.44 KB | None | 0 0
  1. public ActionResult test(LoginViewModel model)
  2. {
  3. string username = model.Email;
  4. string password = model.Password;
  5.  
  6. client.ClientCredentials.UserName.UserName = "Ravi";
  7. client.ClientCredentials.UserName.Password = "asdas";
  8.  
  9. string a=client.GetData(1);
  10.  
  11. return View();
  12. }
  13.  
  14. <?xml version="1.0"?>
  15. <!--
  16. For more information on how to configure your ASP.NET application, please visit
  17. http://go.microsoft.com/fwlink/?LinkId=301880
  18. -->
  19. <configuration>
  20. <configSections>
  21. <!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
  22. <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false"/>
  23. </configSections>
  24. <connectionStrings/>
  25. <appSettings>
  26. <add key="webpages:Version" value="3.0.0.0"/>
  27. <add key="webpages:Enabled" value="false"/>
  28. <add key="ClientValidationEnabled" value="true"/>
  29. <add key="UnobtrusiveJavaScriptEnabled" value="true"/>
  30. </appSettings>
  31. <system.web>
  32. <compilation debug="true"/>
  33. </system.web>
  34. <system.webServer>
  35. <modules>
  36. <remove name="FormsAuthentication"/>
  37. </modules>
  38. </system.webServer>
  39. <runtime>
  40. <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
  41. <dependentAssembly>
  42. <assemblyIdentity name="Microsoft.Owin.Security" publicKeyToken="31bf3856ad364e35"/>
  43. <bindingRedirect oldVersion="1.0.0.0-3.0.1.0" newVersion="3.0.1.0"/>
  44. </dependentAssembly>
  45. <dependentAssembly>
  46. <assemblyIdentity name="Microsoft.Owin.Security.OAuth" publicKeyToken="31bf3856ad364e35"/>
  47. <bindingRedirect oldVersion="1.0.0.0-3.0.1.0" newVersion="3.0.1.0"/>
  48. </dependentAssembly>
  49. <dependentAssembly>
  50. <assemblyIdentity name="Microsoft.Owin.Security.Cookies" publicKeyToken="31bf3856ad364e35"/>
  51. <bindingRedirect oldVersion="1.0.0.0-3.0.1.0" newVersion="3.0.1.0"/>
  52. </dependentAssembly>
  53. <dependentAssembly>
  54. <assemblyIdentity name="Microsoft.Owin" publicKeyToken="31bf3856ad364e35"/>
  55. <bindingRedirect oldVersion="1.0.0.0-3.0.1.0" newVersion="3.0.1.0"/>
  56. </dependentAssembly>
  57. <dependentAssembly>
  58. <assemblyIdentity name="Newtonsoft.Json" culture="neutral" publicKeyToken="30ad4fe6b2a6aeed"/>
  59. <bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0"/>
  60. </dependentAssembly>
  61. <dependentAssembly>
  62. <assemblyIdentity name="System.Web.Optimization" publicKeyToken="31bf3856ad364e35"/>
  63. <bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="1.1.0.0"/>
  64. </dependentAssembly>
  65. <dependentAssembly>
  66. <assemblyIdentity name="WebGrease" publicKeyToken="31bf3856ad364e35"/>
  67. <bindingRedirect oldVersion="0.0.0.0-1.5.2.14234" newVersion="1.5.2.14234"/>
  68. </dependentAssembly>
  69. <dependentAssembly>
  70. <assemblyIdentity name="System.Web.Helpers" publicKeyToken="31bf3856ad364e35"/>
  71. <bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="3.0.0.0"/>
  72. </dependentAssembly>
  73. <dependentAssembly>
  74. <assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35"/>
  75. <bindingRedirect oldVersion="1.0.0.0-5.2.3.0" newVersion="5.2.3.0"/>
  76. </dependentAssembly>
  77. <dependentAssembly>
  78. <assemblyIdentity name="System.Web.WebPages" publicKeyToken="31bf3856ad364e35"/>
  79. <bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="3.0.0.0"/>
  80. </dependentAssembly>
  81. </assemblyBinding>
  82. </runtime>
  83. <entityFramework>
  84. <defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework"/>
  85. <providers>
  86. <provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer"/>
  87. </providers>
  88. </entityFramework>
  89. <system.codedom>
  90. <compilers>
  91. <compiler language="c#;cs;csharp" extension=".cs" type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" warningLevel="4" compilerOptions="/langversion:6 /nowarn:1659;1699;1701"/>
  92. <compiler language="vb;vbs;visualbasic;vbscript" extension=".vb" type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.VBCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" warningLevel="4" compilerOptions="/langversion:14 /nowarn:41008 /define:_MYTYPE="Web" /optionInfer+"/>
  93. </compilers>
  94. </system.codedom>
  95. <system.serviceModel>
  96. <behaviors>
  97. <serviceBehaviors>
  98. <behavior name="ServiceBehavior"/>
  99. </serviceBehaviors>
  100. </behaviors>
  101. <bindings>
  102. <basicHttpBinding>
  103. <binding name="BasicHttpBinding_IService1"/>
  104. </basicHttpBinding>
  105. </bindings>
  106. <client>
  107. <endpoint address="http://localhost:19009/Service1.svc" binding="basicHttpBinding" bindingConfiguration="BasicHttpBinding_IService1" contract="LocServiceReference.IService1" name="BasicHttpBinding_IService1"/>
  108. </client>
  109. </system.serviceModel>
  110. </configuration>
  111.  
  112. <?xml version="1.0"?>
  113. <configuration>
  114.  
  115. <configSections>
  116. <!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
  117. <!--<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />-->
  118. </configSections>
  119. <connectionStrings>
  120. <add name="MyLocalSQLServer" connectionString="Data Source=RAVI-PCSQL;Initial Catalog=aspnetdb;Integrated Security=True" />
  121. </connectionStrings>
  122. <appSettings>
  123. <add key="aspnet:UseTaskFriendlySynchronizationContext" value="true" />
  124. </appSettings>
  125. <system.web>
  126. <!--<membership defaultProvider="MySqlMembershipProvider" >
  127. <providers>
  128. <clear/>
  129.  
  130. </providers>
  131. </membership>-->
  132. <membership defaultProvider="MySqlMembershipProvider" >
  133. <providers>
  134. <clear />
  135. <add
  136. name="MySqlMembershipProvider"
  137. type="System.Web.Security.SqlMembershipProvider"
  138. connectionStringName="MyLocalSQLServer"
  139. applicationName="wcf"
  140. enablePasswordRetrieval="false"
  141. enablePasswordReset="false"
  142. requiresQuestionAndAnswer="false"
  143. requiresUniqueEmail="false"
  144. minRequiredPasswordLength="1"
  145. minRequiredNonalphanumericCharacters="0"
  146. passwordFormat="Hashed" />
  147. </providers>
  148. </membership>
  149. <roleManager enabled="true" defaultProvider="MySqlRoleProvider" >
  150. <providers>
  151. <clear/>
  152. <add name="MySqlRoleProvider"
  153. connectionStringName="MyLocalSQLServer"
  154. applicationName="wcf"
  155. type="System.Web.Security.SqlRoleProvider" />
  156. </providers>
  157. </roleManager>
  158. <authentication mode="None" />
  159. <compilation debug="true" targetFramework="4.5.1" />
  160. <httpRuntime targetFramework="4.5.1" />
  161. </system.web>
  162. <system.serviceModel>
  163. <bindings>
  164. <wsHttpBinding>
  165.  
  166. <binding name="MembershipBinding">
  167. <security mode="Message" >
  168. <message clientCredentialType="UserName" />
  169. </security>
  170. </binding>
  171. </wsHttpBinding>
  172. </bindings>
  173. <behaviors>
  174. <serviceBehaviors>
  175. <behavior name="ServiceBehavior">
  176. <serviceAuthorization principalPermissionMode="UseAspNetRoles"
  177. roleProviderName="MySqlRoleProvider" />
  178. <serviceCredentials>
  179. <userNameAuthentication userNamePasswordValidationMode="MembershipProvider" membershipProviderName="SqlMembershipProvider" />
  180. </serviceCredentials>
  181. </behavior>
  182. </serviceBehaviors>
  183. </behaviors>
  184. <protocolMapping>
  185. <add binding="basicHttpsBinding" scheme="https" />
  186. </protocolMapping>
  187. <serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
  188. </system.serviceModel>
  189. <system.webServer>
  190. <modules runAllManagedModulesForAllRequests="true"/>
  191. <!--
  192. To browse web app root directory during debugging, set the value below to true.
  193. Set to false before deployment to avoid disclosing web app folder information.
  194. -->
  195. <directoryBrowse enabled="true"/>
  196. </system.webServer>
  197.  
  198. </configuration>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement