Security Error

Discussions related to SoftPro Select Server development.

Moderator: Phil Barton

dmalhotra
Posts: 6
Joined: Thu Sep 23, 2010 1:52 am

Security Error

Post by dmalhotra »

I am trying to connect to select server via SDK and getting following exception:

The caller was not authenticated by the service.
Fault Code: http://www.w3.org/2003/05/soap-envelopeSender -> http://schemas.xmlsoap.org/ws/2005/02/t ... entication
Reason: The request for security token could not be satisfied because authentication failed.
Message: The request for security token could not be satisfied because authentication failed.

Lps.Pirt.Services.SoftProSyncUp.vshost.exe Information: 0 : Failed to authenticate the current user. The token provider cannot get tokens for target 'http://ixc1-ini70802c2:7070/Integration/v1/Security.svc'.
A first chance exception of type 'System.Security.SecurityException' occurred in SoftPro.ClientModel.dll



I am using following code. I am able to connect to same server with with same user credentials via SoftPro client.

SelectServer server;

// Create the server object.
NetworkCredential credential = new NetworkCredential(@"user1", @"password1");
server = new SelectServer(null, "http://IXC1-INI70802c2:7070", credential);

server.EnsureAuthenticated();

Also in SDK help file in most of examples we have code like following but could not find SelectDomain value defined in enum SoftPro.Select.Client.Constants

NetworkCredential credential = new NetworkCredential(@"<username>", @"<password>", SoftPro.Select.Client.Constants.SelectDomain);


Thanks,
Deepak
Hadi Chemaly

Re: Security Error

Post by Hadi Chemaly »

dmalhotra wrote: Also in SDK help file in most of examples we have code like following but could not find SelectDomain value defined in enum SoftPro.Select.Client.Constants

NetworkCredential credential = new NetworkCredential(@"<username>", @"<password>", SoftPro.Select.Client.Constants.SelectDomain);
The constant has been relocated to SoftPro.ClientModel.Constants.SelectDomain, give that a try. And thank you for bringing it to our attention, I will submit a request to have the SDK documentation and samples updated in our next release.

Let us know if your authentication problem persists.
dmalhotra
Posts: 6
Joined: Thu Sep 23, 2010 1:52 am

Re: Security Error

Post by dmalhotra »

I used constant SoftPro.ClientModel.Constants.ServerDomain and now it throws following exception when server.EnsureAuthenticated() is called

Method not found: 'Boolean SoftPro.Administration.Common.IAuthorizationService.HasPermission(System.String, SoftPro.Security.Rights)'.
jbright

Re: Security Error

Post by jbright »

Change your compilation settings in Visual Studio so the "Platform target" is "x86".
dmalhotra
Posts: 6
Joined: Thu Sep 23, 2010 1:52 am

Re: Security Error

Post by dmalhotra »

I changed Visual Studio the "Platform target" to "x86" and now I get following exception:

Method not found: 'Void SoftPro.Administration.Common.ISecurityDataAccessService.GetAllSecurityInformation(SoftPro.Security.Classes.SecurityTrusteeCollection, SoftPro.Security.Classes.SecurityTrusteeCollection, SoftPro.Security.Classes.SecurityTrusteeCollection, SoftPro.Security.Classes.ProfileCollection, System.Collections.Generic.Dictionary`2<System.Guid,System.Guid>, SoftPro.Security.Classes.RoleCollection, SoftPro.Security.Classes.MyScreenCollection, SoftPro.Security.Classes.SecuredObjectCollection, Boolean)'.
jbright

Re: Security Error

Post by jbright »

If you have multiple projects in your solution, you should apply that same change to all of them or at least all projects that reference SoftPro assemblies. You may need to use the Microsoft tool for analyzing class loader related issues. That is how I figured out the 64-bit incompatibility some time ago. The link below will help you get started. It's not difficult to get setup.

http://blogs.msdn.com/b/suzcook/archive ... lures.aspx
dmalhotra
Posts: 6
Joined: Thu Sep 23, 2010 1:52 am

Re: Security Error

Post by dmalhotra »

We analyzed assembly depenencies and we had to add reference to more than 30 assemblies like
SoftPro.Security.Cache
SoftPro.Security.Classes
SoftPro.Security.Data

and none of these are mentioned in any example in SDK help. In SDK we have list of just 10 assemblies with which it does not work.

Now next, I want to fetch billing codes, values from table zrefBillCode whcih is invoice billing code.

I tried getting those via LookupService.GetTable() method but that does not work. What API we should use to get these values.
roteague
Posts: 292
Joined: Thu Sep 25, 2008 4:49 pm
Location: Honolulu, Hawaii

Re: Security Error

Post by roteague »

I don't know your environment, but I have not found any need for the references you indicate. You need to make sure you have ALL the SoftPro assemblies in your application's directory.

For working with reference tables, try something like this:

Code: Select all

LookupQuerySpec spec = new LookupQuerySpec()
{
   Table = tableName,
   Filter = "[Name] = " + lookupCode,
};

ILookupTable lookupTable = lookupSvc.QueryTable(spec);
if (lookupTable != null)
{
   ILookupRowCollection foundRows = lookupTable.Rows;
   foreach (ILookupRow row in foundRows)
   {
      // Do something with the row                
   }

   lookupSvc.ApplyChanges(lookupTable);
}
Robert
dmalhotra
Posts: 6
Joined: Thu Sep 23, 2010 1:52 am

Re: Security Error

Post by dmalhotra »

I am not able to get lookup values in table "zrefBillCode".

When I use following code from, its going to in backend to check some entry in [TableMap] table in the database where there's no entry for this table.

Lookups lookupSvc = this.Server.GetService<Lookups>();
DataTable table = lookupSvc.GetTable("zrefBillCode");

Now all I need is existing values in table "zrefBillCode", please guide me how I can get that.
John Morris
Posts: 411
Joined: Thu Sep 11, 2008 11:35 am
Location: Raleigh, NC, USA
Contact:

Re: Security Error

Post by John Morris »

The zrefBillCode table in the database is NOT a lookup table. It's a "DropDown List". We do not currently have a public API into those lists. You will need to query the database table directly for that content.
John Morris
Sr. Software Architect
SoftPro
Post Reply