F# Weekly #5, 2017

Welcome to F# Weekly,

A roundup of F# content from this past week:

News

Videos

Blogs

F# vNext

Open source projects

  • IoTHubFsharp – Get started with Azure IoT Hub in F#
  • neovimfs – Neovimfs is that Fsi works on Suave server

New Releases

That’s all for now. Have a great week.

Previous F# Weekly edition – #4Subscribe

ASP.NET MVC with Simple Windows Authorization

A lot of enterprises use Active Directory (AD) to manage user accounts and Security Groups to manage access to resources.

So (I think) that there is a common task when you want to create some internal resource that will provide certain functionality for your team, but you do not want to expose your data outside. We can easily enable Windows authentication, however usually we also need to add an authorization(limit access to certain groups)

The task is simple, but I do not know why it is so hard to find manual for this. Steps are as follows:

  • Enable Windows authentication in web.config
  • Add WindowsTokenRoleProvider that transforms all Security Groups to ASP.NET Roles
  • Configure Authorization rules based on roles
  • Disable anonymous authentication for IIS Express.

Changes in Web.config:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  ...
  <system.web>
    ...
    <authentication mode="Windows" />
    <authorization>
      <allow roles="DOMAIN\MyTeam" />
      <deny users="*"/>
    </authorization>
    <roleManager cacheRolesInCookie="false" defaultProvider="WindowsProvider" enabled="true">
      <providers>
        <clear />
        <add name="WindowsProvider" type="System.Web.Security.WindowsTokenRoleProvider" applicationName="/" />
      </providers>
    </roleManager>
  </system.web>
  ...
</configuration>

Changes in project file:

<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup>
    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
    ...
    <TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
    <UseIISExpress>true</UseIISExpress>
    <IISExpressSSLPort />
    <IISExpressAnonymousAuthentication>disabled</IISExpressAnonymousAuthentication>
    <IISExpressWindowsAuthentication>enabled</IISExpressWindowsAuthentication>
    <IISExpressUseClassicPipelineMode />
    <UseGlobalApplicationHostFile />
    ...
  </PropertyGroup>
  ...

P.S. You can use security groups to restrict access to Controllers/Views based on the roles (AuthorizeAttribute)

F# Weekly #4, 2017

Welcome to F# Weekly,

A roundup of F# content from this past week:

News

Videos

Blogs

F# vNext

Open source projects

New Releases

That’s all for now. Have a great week.

Previous F# Weekly edition – #3Subscribe

F# Weekly #3, 2017

Welcome to F# Weekly,

A roundup of F# content from this past week:

News

Videos

Blogs

F# vNext

Open source projects

  • Microsoft/fsharplu – This library provides a set of F# helpers for string manipulations, logging, collection data structures, file operations, text processing, security, async, parsing, diagnostics, configuration files and Json serialization.
  • expecto-adapter – Visual Studio test adapter for Expecto
  • fue – F# templating library with simple syntax designed for smooth work with F# types.
  • pipes-and-filters – Sources for the pipes and filters presentation

New Releases

That’s all for now. Have a great week.

Previous F# Weekly edition – #2Subscribe

F# Weekly #2, 2017

Welcome to F# Weekly,

A roundup of F# content from this past week:

News

Videos

Blogs

F# vNext

Open source projects

New Releases

That’s all for now. Have a great week.

Previous F# Weekly edition – #1Subscribe

F# Weekly #1, 2017 – New Year Edition

Welcome to F# Weekly,

Happy New Year to everyone, thank you for reading F# weekly this past year and for doing F#. Thank you to everyone who wrote for F# Advent calendar 2016 and who read it. Let’s stay together in 2017.

A roundup of F# content from this past week:

News

F# Advent Calendar

Blogs

F# vNext

Open source projects

  • froto – Froto: F# Protocol Buffers

New Releases

That’s all for now. Have a great week.

Previous F# Weekly edition – #52Subscribe

F# Weekly #52, 2016

Welcome to F# Weekly,

A roundup of F# content from this past week:

News

F# Advent Calendar

Blogs

F# vNext

Open source projects

New Releases

That’s all for now. Have a great week.

Previous F# Weekly edition – #51Subscribe

F# Weekly #51, 2016

Welcome to F# Weekly,

A roundup of F# content from this past week:

News

Videos/Presentations

F# Advent Calendar

Blogs

F# vNext

Open source projects

New Releases

That’s all for now. Have a great week.

Previous F# Weekly edition – #50Subscribe

F# Weekly #50, 2016

Welcome to F# Weekly,

A roundup of F# content from this past week:

News

Videos/Presentations

F# Advent Calendar

Blogs

F# vNext

Open source projects

New Releases

That’s all for now. Have a great week.

Previous F# Weekly edition – #49Subscribe