Closed cotepatrice closed 10 years ago
This is a known problem - use the static CustomAuthorizationManager property on ClaimsAuthorization to set your specific authorization manager instance (or move to the new OWIN based one if you are using OWIN hosting)
Good ! I've moved to OWIN based solution as recommended and it works fine. Thanks for the quick response.
I know its been a while, but I just ran into this for a silly reason, in my web.config file I had used the wrong XML tag for the Authorisation. claimsAuthenticationManager instead of claimsAuthorizationManager.
Hi ! This is not 100% related to the Authorization Server app, but rather to the samples that comes along with it. I'm trying to implement a custom AuthorizeAttribute in the "Ressource Server v2 web api" app provided in the "Flows" solution, since it is the exact same thing we want to do in our production app. So basically, here's what I did :
-Added a class ClaimsAuthorizeAttribute extending System.Web.Http.AuthorizeAttribute -Added an AuthorizationExtension that gets a reference to the registered AutorizationManager
The extension is part of a shared infrastructure project. All our other projects works the same so I reused it. Note that most of the code below comes from some Thinktecture version (at least that's why my team told me)
Here's the extrension code :
using System.Collections.ObjectModel; using System.IdentityModel.Services; using System.Linq; using System.Security; using System.Security.Claims;
namespace My.Infrastructure.Core.Security { ///
}
Now the AuthorizeAttribute code :
using System; using System.Web.Http; using GUI.Infrastructure.Core.Security; using GUI.Infrastructure.Entities;
namespace Thinktecture.Samples.Helpers { ///
}
The problem is that I get an error saying ID1029 The custom type is not suitable because it does not extend the correct base class in the get AuthorizationManager static property. Do you have any idea what could be my mistake here ? Probably has to do with loading from configuration while it has been added by AuthConfig.Configure ?