I am trying to add a policy to have a certain scope required.
Normally you can add a policy like such inside the AddOpenIDConnect() extension:
config.AddPolicy("mypolicy", x => x.RequireAssertion(context =>
{
//debugger never reaches here
//pseudocode: determine if certain scope is present
return true;
}));
The policy is added and is throwing UnauthorizedAccessException. But it is working incorrectly and I am not able to debug it because the code inside the RequireAssertion is never triggered. So my conclusion was that adding a policy does 'something' but it's not actually looking inside the policy to execute the correct implementation.
I am trying to add a policy to have a certain scope required.
Normally you can add a policy like such inside the
AddOpenIDConnect()extension:The policy is added and is throwing
UnauthorizedAccessException. But it is working incorrectly and I am not able to debug it because the code inside theRequireAssertionis never triggered. So my conclusion was that adding a policy does 'something' but it's not actually looking inside the policy to execute the correct implementation.