dotps1 / HPWarranty

PowerShell module to help retrieve Hewlett-Packard Warranty Information
https://www.powershellgallery.com/packages/HPWarranty/
43 stars 17 forks source link

Invalid Security Credentials #24

Closed jplandry908 closed 8 years ago

jplandry908 commented 8 years ago

My warranty update script started producing errors this week, so I looked into the root cause. I think the Security Credentials may have changed. Is anyone else having issues?

     <SecurityCredentials>
        <UserName>HPSF</UserName>
        <UserPassword>answer42</UserPassword>
     </SecurityCredentials>

I am now getting this error when trying to query a warranty.

$reply.EIAMessage.MessageBody.EIAError

TimeStamp : 2016-03-10T19:23:31.504 ErrorLevel : FATAL ErrorID : 111 ErrorText : Access to service denied: Authorization failure ErrorClass : Misconfiguration DataPayLoad :

kelmansoury commented 8 years ago

Hi,

Yes. It seems HP have abandoned that API and now use a different one for their HP Support Assistant. Hence why the HPSF (HP Support Framework) credentials no longer work.

Here's the new HTTP request I captured with Fiddler2.

POST https://api-uns-sgw.external.hp.com/gw/hpit/egit/obligation.sa/1.1 HTTP/1.1
Content-Type: text/xml;charset=UTF-8
X-HP-SBS-ApplicationId: hpi-obligation-hpsa
X-HP-SBS-ApplicationKey: ft2VGa2hx9j$
Host: api-uns-sgw.external.hp.com
Expect: 100-continue
Connection: Close

<?xml version="1.0" encoding="utf-16"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:int="http://interfaces.obligation.sbs.it.hp.com/">
  <soapenv:Header />
  <soapenv:Body>
    <int:retrieveServiceObligationResponsesByServiceObligationRequests>
      <context>
        <appContextName>HPSF</appContextName>
        <userLocale>en-US</userLocale>
      </context>
      <obligationRequests>
        <lnkServiceObligationDepthFilter>
          <includeProductObjectOfServiceInstance>true</includeProductObjectOfServiceInstance>
          <includeServiceObligation>true</includeServiceObligation>
          <includeServiceObligationHeaderOffer>true</includeServiceObligationHeaderOffer>
          <includeServiceObligationMessage>true</includeServiceObligationMessage>
          <maxNumberOfProductObjectOfServiceInstance>100</maxNumberOfProductObjectOfServiceInstance>
        </lnkServiceObligationDepthFilter>
        <lnkServiceObligationEnrichment>
          <iso2CountryCode>GB</iso2CountryCode>
        </lnkServiceObligationEnrichment>
        <lnkServiceObligationProductObjectOfServiceIdentifier>
          <hpProductNumber>{PRODUCTNUMBER}</hpProductNumber>
          <hpSerialNumber>{SERIALNUMBER}</hpSerialNumber>
        </lnkServiceObligationProductObjectOfServiceIdentifier>
      </obligationRequests>
    </int:retrieveServiceObligationResponsesByServiceObligationRequests>
  </soapenv:Body>
</soapenv:Envelope>

Sadly the result XML is not as well structured as the previous API which was much easier to read and understand.

dotps1 commented 8 years ago

LOL, this project has just been hell to support. I have been so wrapped up with other stuff I haven't had hardly anytime to mess with. I will try to squeeze some time tomorrow for this. Thanks for the XML, I really appreciate it.

jplandry908 commented 8 years ago

Thanks @kelmansoury & @dotps1. I appreciate your time and assistance. Why can't HP just leave the API alone! Or better yet, provide a real public API like Dell and other vendors. :)

kelmansoury commented 8 years ago

@jplandry908 @dotps1 You're welcome. Exactly. I wonder if HP do offer a real public API, but just haven't advertised it publicly. I don't know if any of you have tried contacting them and asking for such?

jplandry908 commented 8 years ago

I've searched online looking for one without any luck, but have not reached out to HP directly. It may be worth a shot.

kelmansoury commented 8 years ago

@jplandry908 Do let me know please if you decide to contact them any time soon and what their reply is. That'd be extremely helpful.

Just to note regarding the above request, it appears that more "filters" are available to use (you find out in the error message if you send a non-existent one). Here is the complete set:

        <lnkServiceObligationDepthFilter>
          <includeServiceDeliverable>true</includeServiceDeliverable>
          <includeServiceOfferModifier>true</includeServiceOfferModifier>
          <includeServiceObligationLineItem>true</includeServiceObligationLineItem>
          <includeProductPartObjectOfServiceInstance>true</includeProductPartObjectOfServiceInstance>
          <includeServiceObligationMessage>true</includeServiceObligationMessage>
          <includeServiceObligationHeader>true</includeServiceObligationHeader>
          <includeServiceDeliverableModifier>true</includeServiceDeliverableModifier>
          <maxNumberOfProductObjectOfServiceInstance>100</maxNumberOfProductObjectOfServiceInstance>
          <includeServiceObligation>true</includeServiceObligation>
          <includeProductObjectOfServiceInstance>true</includeProductObjectOfServiceInstance>
          <includeServiceObligationHeaderOffer>true</includeServiceObligationHeaderOffer>
        </lnkServiceObligationDepthFilter>
dotps1 commented 8 years ago

the most I did was reach out via twitter to hpe directly telling them how disappointed that the hp one works and the hpe one does not. but I don't have any HP contracts or anything to go off of to reach out. I will be digging into this after lunch, hopefully I can turn something up today.

thanks everyone.

coach1988 commented 8 years ago

Hi@all,

had to find a way to get warranty information for HP machines for work today and stumbled across this. Thanks to the information posted by @kelmansoury, i was able to get the following script to work.

Edit: Had to remove the source as it got interpreted by github, sorry, attached the file instead HP-Incorporated.txt

As you can see, i just had to extract the warranty date, but everything else is returned, too i guess. Perhaps this can come in handy for someone working on this;)

PS: I'm not really into PowerShell, so please forgive me beginners' flaws;)

jplandry908 commented 8 years ago

Thanks @coach1988. I just tested your code in my warranty script and it worked great!

dotps1 commented 8 years ago

I just tested it with some Server data, too bad they didn't consolidate into 1, still getting this:

This product is not eligible for HP Inc warranty; Support is obtained from HEWLETT PACKARD ENTERPRISE

ill keep digging.

good work on the HPInc one, I will get that code base updated at aleast.

thanks.

coach1988 commented 8 years ago

@dotps1,i only had workstation serials to test,so just send me a server serial/product number and i'll see if can get that to work, as i'll have to write a script for that,too.

dotps1 commented 8 years ago

OK, so I have implemented @coach1988's fixes for the HPIncWarranty Lookup (huge thanks btw). I have change all the other lookups to HPEntWarranty (even though they don't work). and I have restricted this to match my other modules as far as hierarchy. Still need to test more, but my initial look ups are working. I am going to close this ticket, lets go with issue #21 for the server (HPEnt) issues. Thanks everyone!

dotps1 commented 8 years ago

i have also commented out Get-HPEntWarrantyEntitlement from the manifest, so you will not see that cmdlet right now.

dotps1 commented 8 years ago

@coach1988 do you know the URL that will be used for HPE? because the ISEE does not seem to be in existence any more.