locked
SignalR with Reference Token as Bearer Token RRS feed

  • Question

  • User-1338803362 posted

    Dear all,

    I have a web API ( ASP.NET core with C# ) which is doing some EF Core DB stuff, using IdentityServer 4 implicit flow, and reference token as bearer token. I have implemented SignalR server in it ( which is working ), but i can't mark my hub with the [Authorize] attribute ( when i do that, i cannot reach the hub anymore, but for my API calls, it is working ), and i cannot see the actual user in the Hubcontext Principals. Can i do it this way ? Should i separate my API from my SignalR Server?

    I have been poking around this site: https://docs.microsoft.com/en-us/aspnet/core/signalr/authn-and-authz?view=aspnetcore-2.1

    but I cannot find reference token authentication in it, just the JWT bearer token one, which is not really a good solution for me. Can even SignalR do "reference" token authentication?

    Any help would be appreciated.

    Tuesday, October 30, 2018 2:40 PM

Answers

  • User-1338803362 posted

    Dear Fei Han,

    I have found a solution to my problem, and now it is working with reference token as well.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, November 5, 2018 2:39 PM

All replies

  • User61956409 posted

    Hi ImHoTeP_Hun,

    I cannot find reference token authentication in it, just the JWT bearer token one, which is not really a good solution for me. Can even SignalR do "reference" token authentication?

    As you siad, we can not find any official documentation/blog that explain how to setup SignalR server and IdentityServer to implement authentication using reference token. If possible, you can post your question in github "https://github.com/aspnet/SignalR/issues", perhaps you can get response/help from SignalR team.

    With Rgards,

    Fei Han

    Wednesday, October 31, 2018 3:00 AM
  • User-1338803362 posted

    Dear Fei Han,

    I have found a solution to my problem, and now it is working with reference token as well.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, November 5, 2018 2:39 PM