Telerik Forums
UI for ASP.NET MVC Forum
0 answers
67 views

I have an app thats working with SignalR grids, but now we want to add bearer auth.

The token handling stuff has to happen before my SignalR promise is set, but the problem is the Kendo components required the SignalR promise to bind.

How can I set a SignalR promise that the Kendo components can use which will not resolve until my own token handling functions are complete?

Here is a sample of what we're doing:


getTokenPopup({
                scopes: ["api://918c95d7-8c39-4486-9e15-83d061a30fa6/access_as_user"]
            })
                .then(response => {
                    $.ajaxSetup({
                        beforeSend: function (xhr) {
                            xhr.setRequestHeader('Authorization', 'Bearer ' + response.accessToken);
                        }
                    });

                    myApp.hub = $.connection.searchHub;
                   myApp.hubStart = $.connection.hub.start({
                      waitForPageLoad: false,
                      transport: "longPolling"
                    });
                })
                .catch(error => {
                    console.error(error);
                });

iCognition
Top achievements
Rank 1
 asked on 31 Oct 2022
0 answers
136 views
Narrow your results
Selected tags
Tags
+? more
Top users last month
Mark
Top achievements
Rank 1
Yurii
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Hon
Top achievements
Rank 1
Iron
Deltaohm
Top achievements
Rank 3
Bronze
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Mark
Top achievements
Rank 1
Yurii
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Hon
Top achievements
Rank 1
Iron
Deltaohm
Top achievements
Rank 3
Bronze
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?