I want to login to my ABP project and execute an authenticated Rest API action with the token.
Set the token as Bearer token in your HttpClient
client.SetBearerToken(accessToken);
See https://github.com/abpframework/abp/blob/740fb05644d1097877bbb34446956958e4dc36bd/framework/src/Volo.Abp.Cli.Core/Volo/Abp/Cli/Http/CliHttpClient.cs#L48
Also check out https://support.abp.io/QA/Questions/560/How-can-I-call-an-ABP-remote-service-method#answer-19f25faa-e2f5-bc56-3bc7-39f8e32906bf
For you question2:
Inject ISettingProvider
then set the default language for a user with this method _settingProvider.SetForUserAsync()
you can use LocalizationSettingNames.DefaultLanguage
constant for the setting name.
I'll answer 2 & 3 . 2- There's no out of box feature to set a language for a user manually. However you can set a language as default. A user can change his language on his own. See also https://github.com/abpframework/abp/issues/2775 https://github.com/abpframework/abp/issues/2469 (If I find a smooth way of implementing this, I'll write)
3- I guess below code can help you to get all language texts.
public class LanguageAppService : LanguageAppServiceBase, ILanguageAppService
{
protected ISettingManager SettingManager { get; }
protected ILanguageRepository LanguageRepository { get; }
protected AbpLocalizationOptions AbpLocalizationOptions { get; }
public LanguageAppService(
ISettingManager settingManager,
IOptions<AbpLocalizationOptions> abpLocalizationOptions,
ILanguageRepository languageRepository)
{
SettingManager = settingManager;
LanguageRepository = languageRepository;
AbpLocalizationOptions = abpLocalizationOptions.Value;
}
public async Task<PagedResultDto<LanguageDto>> GetListAsync(GetLanguagesTextsInput input)
{
var languages = await LanguageRepository.GetListAsync(input.Sorting,input.MaxResultCount,input.SkipCount,input.Filter);
var totalCount = await LanguageRepository.GetCountAsync(input.Filter);
var defaultLanguage = await FindDefaultLanguage(languages);
var languageDtos = ObjectMapper.Map<List<Language>, List<LanguageDto>>(languages);
if (defaultLanguage != null)
{
var defaultLanguageDto = languageDtos.Find(
l => l.CultureName == defaultLanguage.CultureName &&
l.UiCultureName == defaultLanguage.CultureName
);
if (defaultLanguageDto != null)
{
defaultLanguageDto.IsDefaultLanguage = true;
}
}
return new PagedResultDto<LanguageDto>(totalCount,languageDtos);
}
}
public class GetLanguagesTextsInput : PagedAndSortedResultRequestDto
{
public string Filter { get; set; }
public string ResourceName { get; set; }
public string BaseCultureName { get; set; }
public string TargetCultureName { get; set; }
public bool GetOnlyEmptyValues { get; set; }
}
public class LanguageDto : ExtensibleCreationAuditedEntityDto<Guid>
{
public string CultureName { get; set; }
public string UiCultureName { get; set; }
public string DisplayName { get; set; }
public string FlagIcon { get; set; }
public bool IsEnabled { get; set; }
public bool IsDefaultLanguage { get; set; }
}
if there's a document that you can show this issue (that Azure doesn't accept dots in setting name)
@joe looks like you are having the same issue as reported here => https://support.abp.io/QA/Questions/183/New-Solution-From-ABP-Suite---Errors#answer-c61ff67a-6c21-86b7-99c5-39f5506f9cc7
@jason.smith if you think this is a subject of the Nginx reverse proxy problem, you can keep on discussing it here. If you think it's a separate issue, it'd be better to discuss it in a different thread. If you are worried about your question credits, I already increased your question credits by 1.
@jason.smith does the same URL work in the MVC application?
@rbarbosa I think you should ask in the Angular official repo. But I guess you have a custom link that starts with https://localhost/
. Your links should start with /