XCP-ng
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    REST auth in Postman

    Scheduled Pinned Locked Moved Solved REST API
    3 Posts 2 Posters 397 Views 1 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • J Offline
      jkatz
      last edited by

      I'm trying to use Postman to test out these REST calls to XO and am having trouble setting up the authentication token cookie.

      This works in the command line:
      curl -b authenticationToken=IJqaWKJGHL9pHv64lRLa-5QH-xG-YC9wzctfv3rypm4 https://server.company.name/rest/v0/vms

      But in Postman I keep geeting 401 Unauthorized. So it seems I'm not setting up the token cookie correctly.
      829a62cc-a0cf-47ac-bf55-f4eefcc30d8a-image.png

      The format of the cookie text correct? And/or what should be used for the domain? Or do i put the ip of the xo server there? Path? I've tried a lot of variations, but still no luck.

      Thanks,
      jonathan

      1 Reply Last reply Reply Quote 0
      • DanpD Offline
        Danp Pro Support Team
        last edited by

        This is how I setup my Postman --
        7fc3eeb2-da6e-43b9-9018-eab959b4861a-image.png

        This is on the root folder, and Auth Type for all requests are set to Inherit auth from parent. {{token}} is an environmental variable, so it can easily be updated in a single location. Also, this allows you to easily switch environments to go from XOA, XO from sources, etc.

        HTH, Dan

        J 1 Reply Last reply Reply Quote 1
        • J Offline
          jkatz @Danp
          last edited by

          @Danp Yup, that will do it. Thanks. No longer pulling out my hair. 🙂

          1 Reply Last reply Reply Quote 0
          • olivierlambertO olivierlambert marked this topic as a question on
          • olivierlambertO olivierlambert has marked this topic as solved on

          Hello! It looks like you're interested in this conversation, but you don't have an account yet.

          Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

          With your input, this post could be even better 💗

          Register Login
          • First post
            Last post