How can I submit auth token in header?
-
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 withServer.callWithPOST
POST /resource HTTP/1.1 Host: server.example.com Authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodH
-
-
@Christoph-Hart Hmm thank you. I will try it...
-
In PercX we use this format for the header:
Authorization: Token eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJodH
-
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);
-
This post is deleted!