: )
hi
I guess can i access subfields with a '.' after ExtraProperties?
I think you can do that. https://docs.abp.io/en/abp/latest/Object-Extensions#getproperty
hi
Please share the logs of this request. Thanks
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.
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