signalr bearer token authentication

Discussion of open issues, suggestions and bugs regarding network security and data protection solution - SecureBridge
Post Reply
oscar
Posts: 1
Joined: Tue 17 Feb 2009 09:14

signalr bearer token authentication

Post by oscar » Mon 09 Mar 2020 11:29

Hi All,

When using the TscHubConnection, how can i pass the required access token (jwt) used for authentication?

Tia, Rj

ViktorV
Devart Team
Posts: 3168
Joined: Wed 30 Jul 2014 07:16

Re: signalr bearer token authentication

Post by ViktorV » Wed 11 Mar 2020 14:19

For authorization using Bearer Token, we do not have a separate property, therefore, to use it, you should also use the ScHubConnection.HttpConnectionOptions.Headers property. You can use the ScHubConnection1.HttpConnectionOptions.Headers.Add method to set the required values.
For example:

Code: Select all

ScHubConnection.HttpConnectionOptions.Headers.Add('Authorization', 'Bearer AbCdEf123456'); //The string "AbCdEf123456" in the example above is the bearer authorization token.

Post Reply