Create a mix of ScopesRequiredHttpContextExtensions and RolesRequired…#1814
Create a mix of ScopesRequiredHttpContextExtensions and RolesRequired…#1814BluMichele wants to merge 2 commits intoAzureAD:masterfrom
Conversation
…HttpContextExtensions
| using Bludata.Blu.Web.Security.Entities; | ||
| using Bludata.Blu.Web.Security.Interface; | ||
|
|
||
| namespace Bludata.Blu.Web.Security.Utils; |
There was a problem hiding this comment.
namespace needs to be updated and using removed.
please add license info like we have on other classes
There was a problem hiding this comment.
I did it, thanks for letting me know. Hope it will be useful.
|
thanks for this @BluMichele. We have something similar on the attributes and will need to test once you have updated the file. It will take us sometime to circle back on this, just an FYI. |
| lock (context) | ||
| { | ||
| context.Response.StatusCode = (int)HttpStatusCode.Forbidden; | ||
| context.Response.WriteAsync(message); |
There was a problem hiding this comment.
We should rather set that in an ErrorDescription header or www-Authenticate header, maybe (and not WriteAsync / CompleteAsync())
There was a problem hiding this comment.
You might be right, I quite much copied the code style of https://github.com/AzureAD/microsoft-identity-web/blob/master/src/Microsoft.Identity.Web/Resource/ScopesRequiredHttpContextExtensions.cs
…HttpContextExtensions