We are trying to get Graph integrated into our version 12 ABP ASP Net Zero (.Net Core MVC)
We have AD working fine after following method 2 of the following: https://community.abp.io/posts/how-to-use-the-azure-active-directory-authentication-for-mvc-razor-page-applications-4603b9cf?_ga=2.167438713.612361716.1679501585-1726878413.1679501585
Our Configure method in AuthConfigurer looks like so:
However, when we call the graphclient, for example:
We get the following error:
---> System.InvalidOperationException: IDW10503: Cannot determine the cloud Instance. The provided authentication scheme was ''. Microsoft.Identity.Web inferred 'Identity.Application' as the authentication scheme. Available authentication schemes are 'Identity.Application,Identity.External,Identity.TwoFactorRememberMe,Identity.TwoFactorUserId,idsrv,idsrv.external,Cookies,OpenIdConnect,Bearer,IdentityBearerIdentityServerAuthenticationJwt,IdentityBearerIdentityServerAuthenticationIntrospection,IdentityBearer'. See https://aka.ms/id-web/authSchemes.
at Microsoft.Identity.Web.TokenAcquisitionAspnetCoreHost.GetOptions(String authenticationScheme, String& effectiveAuthenticationScheme)
at Microsoft.Identity.Web.TokenAcquisition.GetAuthenticationResultForUserAsync(IEnumerable1 scopes, String authenticationScheme, String tenantId, String userFlow, ClaimsPrincipal user, TokenAcquisitionOptions tokenAcquisitionOptions) at Microsoft.Identity.Web.DefaultAuthorizationHeaderProvider.CreateAuthorizationHeaderForUserAsync(IEnumerable
1 scopes, AuthorizationHeaderProviderOptions downstreamApiOptions, ClaimsPrincipal claimsPrincipal, CancellationToken cancellationToken)
The AD part is working fine and a user can create a account and login with their Microsoft account. It is just the Graph part that is not working. Anyone any ideas? Thanks
We have resolved this by moving the GetEditionValueOrNull and GetEditionValueOrNullAsync methods from the FeatureStore up into the EditionManager. We have then stopped using the cache manager and just doing a call to the repository to get the value everytime. This is getting rid of the cache manager and related issue:
<br>
Thanks @ismcagdas
I have narrowed the problem down to AbpFeatureValueStore. I have moved all methods to our own FeatureValueStore so we can debug and make any necessary changes.
I can see that a cache is being used for the retreival of setting values and I think this may be the issue. Is there a way of disabling this or perhaps forcing a re-get of the value? And would this have any negative effects on perofrmance?
Thanks
Possibly related to https://github.com/aspnetboilerplate/aspnetboilerplate/issues/1433
and https://github.com/aspnetboilerplate/aspnetboilerplate/issues/1574 ?
It's causing problems. If setting back to the default value, it does not get the value correctly. It's as if the IAbpZeroFeatureValueStore is caching when setting back to the default value.
Restarting the application resolves the issue but this is obviously not a viable solution.
Thanks
ASP.NET CORE MVC & JQuery v12.0.1 .NET 7
Edition feature settings are not saved when setting the value back to it's default value.
Steps to reproduce:
Having to remove the default values from AppFeatureProvider to get around this which is far from ideal. Especially when evaluating a feature setting that hasnt had a value saved against it yet.
I can debug it as far as the EditionManager:
public virtual Task SetFeatureValueAsync(int editionId, string featureName, string value)
{
return _featureValueStore.SetEditionFeatureValueAsync(editionId, featureName, value);
}
But then lose the trail into ABP Source code.
Thank you
Ok, so not just checkboxes. For any setting, when trying to set the value back to it's default value the save does not happen.
Workaround is to remove all default values in AppFeatureProvider which isn't ideal but will do for now.
@ismcagdas - can this be looked into and resolved please?
Thanks