Initial Commit
This commit is contained in:
@@ -0,0 +1,33 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using McKesson.PPS.Fusion.Authentication.Business;
|
||||
using Pluto.Api;
|
||||
using McKesson.PPS.Fusion.Business.Common.Context;
|
||||
|
||||
namespace PlutoServer.PracticeChoice.Security {
|
||||
public class Authentication {
|
||||
public UserInfo1 Login(string userName, string password, int siteId) {
|
||||
UserInfo1 userInfo = null;
|
||||
|
||||
var identity = MagicIdentity.GetIdentity(userName, password, siteId, string.Empty);
|
||||
if(identity.IsAuthenticated) {
|
||||
//MagicPrincipal principal = new MagicPrincipal(identity);
|
||||
//Csla.ApplicationContext.User = principal;
|
||||
var userContext = UserContext.GetInstance();
|
||||
userInfo = new UserInfo1() {
|
||||
AuthToken = identity.ToCookieString(),
|
||||
FirstName = userContext.FirstName,
|
||||
Id = userContext.PersonId.ToString(),
|
||||
IsProvider = userContext.IsProvider,
|
||||
LastName = userContext.LastName,
|
||||
UserName = userName
|
||||
};
|
||||
} else {
|
||||
throw new Exception(string.Format("You are not authorized. Error{0}", identity.UserLoginError));
|
||||
}
|
||||
return userInfo;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,120 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProductVersion>8.0.30703</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{B8DB8F11-ADFC-4BC4-89A1-EA0D47CFAE71}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>PlutoServer.PracticeChoice.Security</RootNamespace>
|
||||
<AssemblyName>PlutoServer.PracticeChoice.Security</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>..\Target\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="Authentication.Business">
|
||||
<HintPath>..\..\3rdParty\PracticeChoice\Authentication.Business.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Authentication.Data">
|
||||
<HintPath>..\..\3rdParty\PracticeChoice\Authentication.Data.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Authentication.DataAccess">
|
||||
<HintPath>..\..\3rdParty\PracticeChoice\Authentication.DataAccess.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Authentication.Resources.Server">
|
||||
<HintPath>..\..\3rdParty\PracticeChoice\Authentication.Resources.Server.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Business.BusinessBase">
|
||||
<HintPath>..\..\3rdParty\PracticeChoice\Business.BusinessBase.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Business.Common">
|
||||
<HintPath>..\..\3rdParty\PracticeChoice\Business.Common.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Business.Common.Security">
|
||||
<HintPath>..\..\3rdParty\PracticeChoice\Business.Common.Security.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Csla">
|
||||
<HintPath>..\..\3rdParty\PracticeChoice\Csla.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Csla.XmlSerializers">
|
||||
<HintPath>..\..\3rdParty\PracticeChoice\Csla.XmlSerializers.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Practices.EnterpriseLibrary.Common">
|
||||
<HintPath>..\..\3rdParty\PracticeChoice\Microsoft.Practices.EnterpriseLibrary.Common.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Practices.EnterpriseLibrary.Data">
|
||||
<HintPath>..\..\3rdParty\PracticeChoice\Microsoft.Practices.EnterpriseLibrary.Data.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Practices.EnterpriseLibrary.ExceptionHandling">
|
||||
<HintPath>..\..\3rdParty\PracticeChoice\Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Logging">
|
||||
<HintPath>..\..\3rdParty\PracticeChoice\Microsoft.Practices.EnterpriseLibrary.ExceptionHandling.Logging.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Practices.EnterpriseLibrary.Logging">
|
||||
<HintPath>..\..\3rdParty\PracticeChoice\Microsoft.Practices.EnterpriseLibrary.Logging.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Practices.EnterpriseLibrary.Logging.Database">
|
||||
<HintPath>..\..\3rdParty\PracticeChoice\Microsoft.Practices.EnterpriseLibrary.Logging.Database.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Practices.EnterpriseLibrary.PolicyInjection">
|
||||
<HintPath>..\..\3rdParty\PracticeChoice\Microsoft.Practices.EnterpriseLibrary.PolicyInjection.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Practices.ServiceLocation">
|
||||
<HintPath>..\..\3rdParty\PracticeChoice\Microsoft.Practices.ServiceLocation.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Practices.Unity">
|
||||
<HintPath>..\..\3rdParty\PracticeChoice\Microsoft.Practices.Unity.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Practices.Unity.Interception">
|
||||
<HintPath>..\..\3rdParty\PracticeChoice\Microsoft.Practices.Unity.Interception.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="RemObjects.SDK">
|
||||
<HintPath>..\..\3rdParty\RemObjects\Server\RemObjects.SDK.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Authentication.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\PlutoServer.PracticeChoice.Interfaces\PlutoServer.PracticeChoice.Interfaces.csproj">
|
||||
<Project>{77B7DE2F-677F-49E7-A452-D60FC4D27944}</Project>
|
||||
<Name>PlutoServer.PracticeChoice.Interfaces</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
||||
@@ -0,0 +1,36 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("PlutoServer.PracticeChoice.Authentication")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("PlutoServer.PracticeChoice.Authentication")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2012")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
[assembly: Guid("c10752ab-0ce0-4218-9eae-abe406ef8a94")]
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
Reference in New Issue
Block a user