Skip to content
This repository has been archived by the owner on Dec 13, 2018. It is now read-only.

Enable default policy for MVC authorize attribute #376

Closed
blowdart opened this issue Jul 27, 2015 · 3 comments
Closed

Enable default policy for MVC authorize attribute #376

blowdart opened this issue Jul 27, 2015 · 3 comments

Comments

@blowdart
Copy link
Member

This would make the multiple identities scenarios easier, as a dev could set the default behaviour to use Cookie auth, which in turn would mean you wouldn't have to set cookie auth to be automatic, and filtering would work as expected when you limit to bearer.

@HaoK
Copy link
Member

HaoK commented Jul 27, 2015

Looks like this behavior actually comes from Policy.Combine, where we add RequireAuthenticatedUser by default.

How about we just add a default policy to the options which we use for this instead? The default behavior would be the same, just requiring any authenticated user.

You could replace it via

services.ConfigureAuthorization(options => options.DefaultPolicy = new PolicyBuilder().AddWhatever().Build())

@blowdart
Copy link
Member Author

Might work - can you give it a shot?

@HaoK
Copy link
Member

HaoK commented Aug 12, 2015

3294de1

@HaoK HaoK closed this as completed Aug 12, 2015
@HaoK HaoK added the 3 - Done label Aug 12, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants