Activities of "maliming"

hi

Please share the logs of this request. Thanks

Answer

hi

Could you please let me know why this does not work anymore? Maybe it has something to do with the ABP version upgrade? If I remember it right, it was done for 4.x.

Does everything work fine if you don't upgrade?

hi

here I want to set defaultLanguage to use it in GenerateViolationReport() method

hi

You can switch the current culture

// get defaultLanguage for this tenant
var defaultLanguage = await _settingProvider.GetOrNullAsync(LocalizationSettingNames.DefaultLanguage);

// here I want to set defaultLanguage to use it in GenerateViolationReport() method 

using (CultureHelper.Use(CultureInfo.GetCultureInfo(defaultLanguage)))
{
    GenerateViolationReport()
}

hi

I will contact you by WeChat.

hi @abpVAndy

请分享这个请求的详细日志. 请把日志级别调整到最低Trace或者Debug

if you could just point us in the direction of an example that does what we're trying to achieve

ok, Please create a new brand project and send it to me, I will update it and get back to you. liming.ma@volosoft.com

hi

I think you can add email to id_token in your azure AD settings. https://docs.microsoft.com/en-us/azure/active-directory/develop/active-directory-optional-claims

or you can test with the below code.

private void ConfigureExternalProviders(ServiceConfigurationContext context)
    {
        context.Services.AddAuthentication()
            .AddMicrosoftIdentityWebApp(
                microsoftIdentityOptions =>
                {
                    microsoftIdentityOptions.Instance = "https://login.microsoftonline.com/";
                    microsoftIdentityOptions.Domain = "xxx";
                    microsoftIdentityOptions.TenantId = "xxx";
                    microsoftIdentityOptions.ClientId = "xxx";
                    microsoftIdentityOptions.ClientSecret = "xxx";
                    microsoftIdentityOptions.CallbackPath = "/signin-azuread-oidc";
                    microsoftIdentityOptions.SignedOutCallbackPath = "/signout-callback-oidc";

                    microsoftIdentityOptions.SignInScheme = IdentityConstants.ExternalScheme;
                },
                cookieAuthenticationOptions => { },
                OpenIdConnectDefaults.AuthenticationScheme,
                null);

        context.Services.PostConfigure<OpenIdConnectOptions>(OpenIdConnectDefaults.AuthenticationScheme, options =>
        {
            // Add email to id_token in your azure AD settings.
            options.ClaimActions.Add(new AddEmailClaim());
        });
    }
public class AddEmailClaim : ClaimAction
{
    public AddEmailClaim()
        : base(null, null)
    {
    }

    public override void Run(JsonElement userData, ClaimsIdentity identity, string issuer)
    {
        var preferred_username = identity.Claims.FirstOrDefault(x => x.Type == "preferred_username");
        if (preferred_username != null)
        {
            identity.AddClaim(new Claim(AbpClaimTypes.Email, preferred_username.Value));
        }
    }
}

hi

The LocalizationSettingNames.DefaultLanguage is a setting so you can change via https://docs.abp.io/en/abp/latest/Settings

how I can use it to translate string

https://docs.abp.io/en/abp/latest/Localization

hi

Yes, I will test is asap.

hi

Let's discuss this in https://support.abp.io/QA/Questions/3604#answer-999438a9-65ca-2b2d-72d6-3a060dff6511

Showing 8481 to 8490 of 11554 entries
Learn More, Pay Less
33% OFF
All Trainings!
Get Your Deal
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v10.1.0-preview. Updated on December 17, 2025, 07:08
1
ABP Assistant
🔐 You need to be logged in to use the chatbot. Please log in first.