C# - not receiving OTCSTicketExpires header?

Options

Hi Members,

I am running <server>otcs/cs.exe/api/v1/auth command in Postman and getting the header just fine:

But when I run C# code (generated from Postman), my http response message does NOT contain this header :-(.

Any ideas, what am I missing in my requests?

Best Answer

  • GinoDivx
    #2 Answer ✓
    Options

    Update - of course, this was my error :-(

    For whatever reason, I was looking at httpResponseMessage.Content.Headers. BUT I really should've been looking at httpResponseMessage.Headers!

    And of course, the ticket was there, every time.

    Mystery solved, hopefully this will help others :-)

Answers

  • appuq
    Options

    my gut feel tells me that OT designed that in this way.

    1. The first request to /auth returns otcsticket:nnnnnnn
    2. Code performs api call like /nodes returns api result as well as refreshed ticket otcsticket:nlnlnlnl
    3. Another api with the otcsticket:nlnlnlnl perhaps versions returns result and otcsticket:nlmnlmnlm

    I think OT wants you to chain the tickets and not use just the first authentication

    The SOAP implementation had a valid TTL,I do not fully know if that is applicable for REST.

    This is just my thought you might be better informed to ask through a ticket…

  • GinoDivx
    Options

    Well, this is definitely not the behavior that I see, even in Postman. When I use the ticket issued by "auth", there is no new/refreshed ticket being returned. I do see the OTCSTicketExpires header in each response, as well as OTCSTicket header, BUT it's the same value as in the request. My C# code on the other hand, gets none of the two headers above…

  • appuq
    Options

    @GinoDivx I do not have access to code or API design of OT so my answer may not be correct. Why don't you ask OT? AFAIk in this API call OT Documentation does not specify headers returned it just says you will receive a ticket so the anomaly may better be answered by someone at OT

    https://developer.opentext.com/ce/products/extendedecm/apis/contentserver203restapi

  • GinoDivx
    Options

    Thank you, I started here, because this seemed like a good space :-).

    If anyone else might have an answer, it would be very much appreciated!

  • GinoDivx
    #7 Answer ✓
    Options

    Update - of course, this was my error :-(

    For whatever reason, I was looking at httpResponseMessage.Content.Headers. BUT I really should've been looking at httpResponseMessage.Headers!

    And of course, the ticket was there, every time.

    Mystery solved, hopefully this will help others :-)