From 55de66375ab8090b8459c63e772f3f40bd542e79 Mon Sep 17 00:00:00 2001 From: Andrew Stanton-Nurse Date: Mon, 24 Sep 2018 08:24:26 -0700 Subject: [PATCH] fix access token sample in SignalR auth document (#8680) Fixes #8631 The `AccessTokenFactory` expects a `Task` so we need to wrap it in `Task.FromResult` in the sample (which is synchronous). --- aspnetcore/signalr/authn-and-authz.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/aspnetcore/signalr/authn-and-authz.md b/aspnetcore/signalr/authn-and-authz.md index e6615822e8..3abbb57eab 100644 --- a/aspnetcore/signalr/authn-and-authz.md +++ b/aspnetcore/signalr/authn-and-authz.md @@ -39,7 +39,7 @@ In the .NET client, there is a similar [AccessTokenProvider](xref:signalr/config var connection = new HubConnectionBuilder() .WithUrl("https://example.com/myhub", options => { - options.AccessTokenProvider = () => _myAccessToken; + options.AccessTokenProvider = () => Task.FromResult(_myAccessToken); }) .Build(); ```