Activities of "nhontran"

Hi, anyone can help us on this query?

Hi, I want to throw BusinessException with custom message without passing the error code or using error code does not exist in en.json:

// no error code
throw new BusinessException(null, "custom error message", null);

// error code does not exist
throw new BusinessException("NoErrorCode", "custom error message", null);

But received the output as below:

// no error code
{
  "error": {
    "code": null,
    "message": "An internal error occurred during your request!",
    "details": null,
    "data": {},
    "validationErrors": null
  }
}

// error code does not exist
{
  "error": {
    "code": "NoErrorCode",
    "message": "An internal error occurred during your request!",
    "details": null,
    "data": {},
    "validationErrors": null
  }
}

Any idea?

Hi @maliming, which version did you check? it does not work with version 5.2.2.

Could you check and let me know? Thank you.

Hi @maliming, I have tried and it does not work, the claim is not returned in the claim list:

public class CustomClaimsPrincipalContributor : IAbpClaimsPrincipalContributor, ITransientDependency
    {
        public Task ContributeAsync(AbpClaimsPrincipalContributorContext context)
        {
            var identity = context.ClaimsPrincipal.Identities.FirstOrDefault();
            if (identity != null)
            {
                // these 2 claims not found
                var uniqueNameClaim = identity.FindFirst("unique_name");
                var preferredUserNameClaim = identity.FindFirst("preferred_username");
                identity.TryRemoveClaim(uniqueNameClaim);
                identity.TryRemoveClaim(preferredUserNameClaim);
            }
            return Task.CompletedTask;
        }
    }
  • ABP Framework version: v5.2.2
  • UI type: Angular
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): yes / no
  • Exception message and stack trace:
  • Steps to reproduce the issue:"

Hi, I want to remove the "unique_name" and "preferred_username" claims in the access token but could not figure out how to do it, I have tried to remove all the claims in Api Resources, but these claims still exist.

any idea how to remove it?

Thank @maliming, I managed to replace the file.

Hi maliming,

Thanks for your reply, may I know what are the steps to replace the jquery-extensions.js?

Hi @maliming,

I have disabled the bundle and minify, this is the code caused the error:

Could you please help us take a look? thank you.

  • ABP Framework version: v5.2.2.
  • UI type: Angular
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): yes
  • Exception message and stack trace:
  • Steps to reproduce the issue:"

Hi, we have upgraded our solution to Abp 5.2.2 and got 1 issue when accessing the TenantSwitchModal, we are not allowed to add 'unsafe-eval' into script-src due to security test, below is our CSP:

default-src 'self'; script-src 'self'; frame-ancestors 'none'; style-src 'self' 'unsafe-inline'; img-src 'self' data:;

Could you please help us take a look and advise?

Thanks, we will check the provided link.

Showing 21 to 30 of 195 entries
Made with ❤️ on ABP v9.1.0-rc.1. Updated on January 17, 2025, 14:13