Altiris Software Dev Kit (ASDK)

 View Only
  • 1.  Passing Current Credential to Web Service

    Posted Jul 15, 2015 11:03 AM

    Can anyone provide an example were the current logged on credential are passed to the ASDK web service?  I can implement a form login, but I'd much prefer simply passing the credentials to the webservice.



  • 2.  RE: Passing Current Credential to Web Service
    Best Answer

    Posted Jul 16, 2015 01:54 AM

    Does this not help? 

     

    To connect to a Web service on another machine with a different user name and password, you must create the proper credentials. The following code is an example of how to do this using an existing itemMS proxy class object.

    CopyC#
    string targetServer = "computer5";
    string domain = "WORKGROUP";
    string username = args[0];
    string password = args[1];
    
    itemMS.Url = string.Format( "http://{0}/Altiris/ASDK.NS/ItemManagementService.asmx", targetServer );
    CredentialCache cache = new CredentialCache();
    cache.Add( new Uri(itemMS.Url), "Negotiate", new NetworkCredential( username, password, domain ) );
    itemMS.Credentials = cache;


  • 3.  RE: Passing Current Credential to Web Service

    Posted Jul 17, 2015 08:13 AM

    Not really.  I believe that would require a form to capture the user name and password.  I want to capture the Default Windows Credentials and pass them to the web service.  In your example the user name and password need to be supplied.



  • 4.  RE: Passing Current Credential to Web Service

    Posted Aug 10, 2015 08:26 AM

    What are you trying to do?

    Why I am asking there is a "limitation" of the ASDK which only allows users part of the "Symantec Administrator" group to call the ASDK webservices. So even if you pass on the users credential to the webservice they might not be able to use it....
     



  • 5.  RE: Passing Current Credential to Web Service

    Posted Aug 10, 2015 02:39 PM

    I'm trying to manipulate Assets.  I'm connecting to the NSWebService\ResourceModel.asmx.  I originally added this as a web service which seemed problematic.

    The proxy class mentioned by SK has allowed me to pass the current credentials.  the only other thing I needed to do was switch the application pool to classic; instead of, integrated.