HISE Logo Forum
    • Categories
    • Register
    • Login

    How can I submit auth token in header?

    Scheduled Pinned Locked Moved General Questions
    6 Posts 3 Posters 263 Views
    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.
    • ?
      A Former User
      last edited by A Former User

      I am just trying to use HISE Server API with a token system.

      When username and password information were inserted, there is a server token response like below. I am saving this information for credentials.

      {
        "token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodH",
      }
      

      I need to use this token with authorization request header on API calls. How can I submit auth token in header with Hise?
      I couldn't get a way to use this with Server.callWithPOST

      POST /resource HTTP/1.1
      Host: server.example.com
      Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodH
      
      1 Reply Last reply Reply Quote 0
      • Christoph HartC
        Christoph Hart
        last edited by

        Link Preview Image
        HISE | Scripting | Server

        The API class to communicate with a server

        favicon

        (docs.hise.audio)

        ? 1 Reply Last reply Reply Quote 0
        • ?
          A Former User @Christoph Hart
          last edited by

          @Christoph-Hart Hmm thank you. I will try it...

          1 Reply Last reply Reply Quote 0
          • Christoph HartC
            Christoph Hart
            last edited by

            In PercX we use this format for the header:

            Authorization: Token eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodH
            
            ? 1 Reply Last reply Reply Quote 0
            • ?
              A Former User @Christoph Hart
              last edited by

              @Christoph-Hart

              I see. In my system, I use a JWT wordpress plugin that excepts

              Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodH
              
              

              format. Because of that I guess I use this (decryptedData contains token value):

              Server.setHttpHeader("Authorization: Bearer " + decryptedData.token);
              
              
              d.healeyD 1 Reply Last reply Reply Quote 0
              • d.healeyD
                d.healey @A Former User
                last edited by

                This post is deleted!
                1 Reply Last reply Reply Quote 0
                • First post
                  Last post

                18

                Online

                1.8k

                Users

                12.0k

                Topics

                104.4k

                Posts