Client Credentials and DSA

Topics: CAB & Smart Client Software Factory
Aug 10, 2007 at 4:15 PM
Can someone please tell me how I can provide ClientCredentials using a disconnected service agent?

We are using a ssl-secured transport layer and an asp.net membership provider on the server side.

Thanx for your help....
Aug 10, 2007 at 8:32 PM
Hi Flo!

Check with the Endpoint Catalog Application Block
The DSA Application Block uses this to described in this guidance to manage the lists of physical addresses and other details for each connection point.
The Endpoint Catalog automatically populates its catalog with details of all the endpoints declared in your application configuration file, including the credentials, the addresses, and the network names.

For example, to get information about an endpoint, use the methods of the EndpointCatalog class:
// Get the number of endpoints in the catalog.
int endpointCount = catalog.Count;
 
// Get the address for an endpoint if it exists.
String epName = "MyWebServiceEndpoint";
String epNetworkName = "MyHost"; 
 
if (catalog.AddressExistsForEndpoint(epName, epNetworkName))
{
  String epAddress = catalog.GetAddressForEndpoint(epName, epNetworkName);
  
  // Get the credentials for this endpoint.
  NetworkCredential epCredentials = catalog.GetCredentialForEndpoint(epName, epNetworkName);
  String epUsername = epCredentials.UserName;
  String epPassword = epCredentials.Password;
  String epDomain = epCredentials.Domain;
}

For more information about the Endpoint Catalog application block, please, read in the SCSF doc, this topic:
  • Design of the Disconnected Service Agent Application Block (Inspecting the Software Factory Assets -> Application Blocks -> The Disconnected Service Agent Application Block)
  • Extending the Disconnected Service Agent Application Block (Inspecting the Software Factory Assets -> Application Blocks -> The Disconnected Service Agent Application Block -> Working with the Disconnected Service Agent Application Block)
  • The Endpoint Catalog Application Block (Inspecting the Software Factory Assets -> Application Blocks)

Also, you can see the SCSF Quickstart for an example implementation of the Endpoint Catalog.

Hope it helps!

Sebastian Iacomuzzi
http://staff.southworks.net/blogs/siacomuzzi
Aug 18, 2007 at 10:07 AM
Hi Sebastian.

Thank you for your tipp. I´m using the endpoint catalog now.
One last question. Is there a way to change the credential information on the fly in an elegant way?

I now change all endpoint credentials after a successfull login using the logged in users credentials like this:

NetworkCredential credential = _catalog.GetCredentialForEndpoint("EndpointName", "Network");
redential.UserName = e.User.UserName;
credential.Password = e.User.Password;

I do this for each and every endpoint and network combination. But I have to parse the app.config file. Is there any endpoint collection?

Thanx for your help in advance.....