Base solution for your next web application
Starts in:
01 DAYS
01 HRS
01 MIN
01 SEC

Activities of "Astech"

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:

And our app settings:

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(IEnumerable1 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

Changed our minds and decided to just clear the cache on feature update. This way we get instant change and keep the benefits of the cache manager normally:

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 ?

AppFeatureProvider: Start the app. Change the value to true, then immediately to false again. The value has now dissapeared as expected from database:

On edit of the edition, the value still comes through as TRUE:

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:

  1. Ensure you have an edition with at least one feature with a default value (for example, enable chat with a default value of true):
  2. Edit an edition and change the setting to false.
  3. Edit the edition again and change back to true (default value). The setting does not get saved. The same applies when setting textboxes etc. back to their default values.

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

It appears to be something to do with the default value set in AppFeatureProvider: The setting will not update if you are trying to set the checkbox back to it's default value.

Showing 21 to 30 of 77 entries