Browser/Javascript SignalR Authorization

SignalR AuthorizationI recently started working with ASP.NET Core SignalR 1.0 and immediately ran into roadblock with authorization.  If you need to add SignalR authorization via header such as the Authorization header, you’re going to also run into this roadblock.  Specifically this is only an issue when running in the browser/javascript as it’s not supported.

Headers

I was unaware that browsers do not support additional headers such as Authorization.  This was problematic for me as the authorization header sending a bearer token is the method of authorization used in the application I was adding SignalR hub to.

So how are you supposed to send a token?

Query String

The immediate answer and for the most part, the only answer I found was too pass via the query string.  Meaning specifying the toke in the query string when defining your connection in the .withUrl()

I wasn’t in love with this solution but I was able to make it work.  I decide to tweet about it had David Fowler provide a really interesting GitHub issue that I’d recommend reading.

Alternatives

If you you are using SignalR/WebSockets client from the browser, how are you passing additional information such as Authorization data to the server?  Let me know in the comments or on Twitter.

Enjoy this post? Subscribe!

Subscribe to our weekly Newsletter and stay tuned.

Roundup #5: .NET Core 2.1, ReSharper Perf Series, Rider 2018.1.1, EF Core Evaluation

Here are the things that caught my eye last week.  Obviously the big one is the release of .NET Core 2.1.  JetBrains are always up to good stuff with Rider 218.1.1 being released last Friday and a really cool series on ReSharper.

I’d love to hear what you found most interesting this week.  Let me know in the comments or on Twitter.

Announcing .NET Core 2.1

We’re excited to announce the release of .NET Core 2.1. It includes improvements to performance, to the runtime and tools. It also includes a new way to deploy tools as NuGet packages. We’ve added a new primitive type called Span<T> that operates on data without allocations. There are many other new APIs, focused on cryptography, compression, and Windows compatibility. It is the first release to support Alpine Linux and ARM32 chips. You can start updating existing projects to target .NET Core 2.1 today. The release is compatible with .NET Core 2.0, making updating easy.

This also includes the release of ASP.NET Core 2.1 and Entity Framework Core 2.1.

Link: https://blogs.msdn.microsoft.com/dotnet/2018/05/30/announcing-net-core-2-1/

 

ReSharper performance series

We use ReSharper to develop ReSharper. It may not always be visible, but we are working hard on improving ReSharper performance. And because those changes aren’t always visible, we are starting a blog series about the minor and major changes that are in the works.

Really cool series of posts so far by Maarten Balliauw and being pretty open about how ReSharper and Visual Studio work as well as how they are implementing perf improvements.

Link: https://blog.jetbrains.com/dotnet/2018/05/28/introducing-resharper-performance-series/

 

Rider 2018.1.1 is released

A polished version of Rider 2018.1 is ready. Just click download to get the latest Rider 2018.1.1 bug-fix update working on your machine.

Support for .NET Core 2.1 Project Templates and a pile of bug fixes.

Link: https://blog.jetbrains.com/dotnet/2018/05/25/rider-2018-1-1-released/

 

EF Core: Client vs. Server Evaluation

Entity Framework Core supports parts of the query being evaluated on the client and parts of it being pushed to the database. It is up to the database provider to determine which parts of the query will be evaluated in the database.

I thought this was really interesting.  By default it will produce warnings when client side evaluation occurs, but you may want configure to completely disable.

Link: https://docs.microsoft.com/en-us/ef/core/querying/client-eval

 

Enjoy this post? Subscribe!

Subscribe to our weekly Newsletter and stay tuned.

Roundup #4: Discover.NET, Signed Nuget Packages, Scheduled Messages in Jasper, RailsConf Keynote

Here are the things that caught my eye last week.  Throwing something out of my usual focus on .NET and tossing in the Railsconf keynote.  I generally pay attention to other ecosystems but just don;t really post it on this blog.  But I might start sneaking some in on the roundups.

I’d love to hear what you found most interesting this week.  Let me know in the comments or on Twitter.

 

Last week I was on vacation, hence the missed roundup.

Discover .NET

I am thrilled to announce the launch of Discover .NET. The site is an attempt to improve discoverability in the .NET ecosystem by collecting information on topics like projects, issues, blogs, groups, events, and resources.

What a awesome idea and really glad to see Dave take the time and effort to put this together.  I love this so much because ultimately this is my main goal for this blog and this series of posts.  To showcase some of the great people, libraries, tools, etc in ecosystem.

Link: https://discoverdot.net/
Link: https://daveaglick.com/posts/announcing-discoverdotnet

Signed package submissions to NuGet.org

In September 2017, we announced our plans to improve the security of the NuGet ecosystem by introducing the ability for package authors to sign packages. Today, we want to announce support for any NuGet.org user to submit signed packages to NuGet.org.

As the post mentions, this really revolves around Package integrity and authenticity.  Glad to see this is now available.

Link: https://blog.nuget.org/20180522/Introducing-signed-package-submissions.html

Scheduled or Delayed Message Execution in Jasper

The scheduled messages can be processed by any of the running nodes within your system, but we take some steps to guarantee that only one node will execute specific scheduled messages. Rather than using any kind of leader election, Jasper just takes advantage of advisory locks in Postgresql or application locks in Sql Server as a lightweight, global lock between the running nodes within your application.

As mentioned at the top of the post, this isn’t a replacement per say for something like Hangfire completely, but does offer the ability to schedule message execution.  I’m likely going to be looking at Jasper a bit more in the future.

Link: https://jeremydmiller.com/2018/05/23/scheduled-or-delayed-message-execution-in-jasper/

 

RailsConf 2018: Opening Keynote: FIXME by David Heinemeier Hansson

Found this to be a pretty interesting keynote.  Lower the barrier to entry, abstractions and complexity.  Worth a watch.

Link: https://www.youtube.com/watch?v=zKyv-IGvgGE

Enjoy this post? Subscribe!

Subscribe to our weekly Newsletter and stay tuned.