-
Notifications
You must be signed in to change notification settings - Fork 85
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
replace AllowAnonymous for SignumAllowAnonymous
- Loading branch information
1 parent
4945a6a
commit 1ad8c24
Showing
2 changed files
with
14 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Threading.Tasks; | ||
|
||
namespace Signum.React.Filters | ||
{ | ||
[System.AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, Inherited = false)] | ||
public sealed class SignumAllowAnonymousAttribute : Attribute | ||
{ | ||
} | ||
} |
1ad8c24
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Windows Authentication with Single Sign-On.
The good news is that Signum framework has now support for Single Sign-On. 😄
In the Client side: you need to call
AuthClient.registerWindowsAuthenticator
in your Main.tsx beforeAuthClient.registerUserTicketAuthenticator
(or just replace it).In the Server side you need to register the ActiveDirectoryAuthorizer
In IIS you need to install and enable Windows authentication in IIS as explained here. https://docs.microsoft.com/en-us/aspnet/core/security/authentication/windowsauth?view=aspnetcore-2.2&tabs=visual-studio
The current implementation supports both Windows Authentication mode:
And mixed mode
Replace
AllowAnonymous
bySignumAllowAnonymous
💣In order to support mixed mode, the action
AuthController.LoginWindowsAuthentication
requires the attributeMicrosoft.AspNetCore.Authorization.AuthorizeAttribute
(to create the challenge response that forces the browser to provide windows information).Additionally this method needs to skip the
SignumAuthenticationFilter
pipeline that provides every request with aUserEntity
. This was traditionally done in Signum with theMicrosoft.AspNetCore.Authorization.AllowAnonymousAttribute
but, as explained here, this has the effect of disabling Microsft's AuthorizeAttribute.The solution is a run-time breaking change 💣 . There is a new
SignumAllowAnonymousAttribute
that disablesSignumAuthenticationFilter
, and all the controllers that previously useAllowAnonymous
should now use the new attribute. This includes custom actions for public portals or file downloads.Example here: signumsoftware/extensions@aae765a
1ad8c24
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Asweome!