hi
**Client validation failed because 'https://ccalp.net' was not a valid redirect_uri for CompuCare_App.
The authorization request was rejected because the redirect_uri was invalid: 'https://ccalp.net'.**
What's the application definition of CompuCare_App in the database?
I think adding options.WildcardDomainsFormat.Add("https://ccalp.net"); will solve it. but you better add https://ccalp.net to CompuCare_App as its redirect_uri.
PreConfigure(options =>
{
options.EnableWildcardDomainSupport = true;
options.WildcardDomainsFormat.Add("https://ccalp.net");
options.WildcardDomainsFormat.Add("https://{0}.ccalp.net/signin-oidc");
options.WildcardDomainsFormat.Add("https://{0}.ccalp.net/signout-callback-oidc");
});
hi
You have to bootstrap an abp module to use the client proxy.
You can use AbpApplicationFactory in your function
https://github.com/abpframework/abp/blob/554960d59626fc355a67f063dc6d375e3fa23844/docs/en/_deleted/Bootstrap-Modules.md#console
hi
Please share your project with me. liming.ma@volosoft.com
I will check it locally.
hi
but the code in that example doesn't work in Azure Functions
Are there any errors or anything?
Please share the logs of AuthServer when you get 400.
hi
You can override the application service in the module without source code.
https://docs.abp.io/en/abp/latest/Customizing-Application-Modules-Guide
hi
I downloaded your project and inserted data into postgres DocsProjects table.
INSERT INTO public."DocsProjects" ("Id", "Name", "ShortName", "Format", "DefaultDocumentName", "NavigationDocumentName", "ParametersDocumentName", "MinimumVersion", "DocumentStoreType", "MainWebsiteUrl", "LatestVersionBranchName", "ExtraProperties", "ConcurrencyStamp") VALUES ('12f21123-e08e-4f15-bedb-ae0b2d939658', 'ABP framework (GitHub)', 'abp', 'md', 'Index', 'docs-nav.json', '', null, 'GitHub', '/', 'dev', '{"GitHubRootUrl":"https://github.com/abpframework/abp/tree/{version}/docs","GitHubAccessToken":"","GitHubUserAgent":""}', null);
hi
Can you try to create a new template project and test it?
hi
You are using 6.0
Add MyMvcCachedApplicationConfigurationClient class. set AbsoluteExpirationRelativeToNow = TimeSpan.Zero
using System;
using System.Globalization;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.Caching.Distributed;
using Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations;
using Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ClientProxies;
using Volo.Abp.AspNetCore.Mvc.Client;
using Volo.Abp.Caching;
using Volo.Abp.DependencyInjection;
using Volo.Abp.Threading;
using Volo.Abp.Users;
namespace MyCompanyName.MyProjectName.Web;
[Dependency(ReplaceServices = true)]
[ExposeServices(typeof(ICachedApplicationConfigurationClient), typeof(MyMvcCachedApplicationConfigurationClient))]
public class MyMvcCachedApplicationConfigurationClient : ICachedApplicationConfigurationClient, ITransientDependency
{
protected IHttpContextAccessor HttpContextAccessor { get; }
protected AbpApplicationConfigurationClientProxy ApplicationConfigurationAppService { get; }
protected ICurrentUser CurrentUser { get; }
protected IDistributedCache<ApplicationConfigurationDto> Cache { get; }
public MyMvcCachedApplicationConfigurationClient(
IDistributedCache<ApplicationConfigurationDto> cache,
AbpApplicationConfigurationClientProxy applicationConfigurationAppService,
ICurrentUser currentUser,
IHttpContextAccessor httpContextAccessor)
{
ApplicationConfigurationAppService = applicationConfigurationAppService;
CurrentUser = currentUser;
HttpContextAccessor = httpContextAccessor;
Cache = cache;
}
public async Task<ApplicationConfigurationDto> GetAsync()
{
var cacheKey = CreateCacheKey();
var httpContext = HttpContextAccessor?.HttpContext;
if (httpContext != null && httpContext.Items[cacheKey] is ApplicationConfigurationDto configuration)
{
return configuration;
}
configuration = await Cache.GetOrAddAsync(
cacheKey,
async () => await ApplicationConfigurationAppService.GetAsync(),
() => new DistributedCacheEntryOptions
{
AbsoluteExpirationRelativeToNow = TimeSpan.Zero //TODO: Should be configurable.
}
);
if (httpContext != null)
{
httpContext.Items[cacheKey] = configuration;
}
return configuration;
}
public ApplicationConfigurationDto Get()
{
var cacheKey = CreateCacheKey();
var httpContext = HttpContextAccessor?.HttpContext;
if (httpContext != null && httpContext.Items[cacheKey] is ApplicationConfigurationDto configuration)
{
return configuration;
}
return AsyncHelper.RunSync(GetAsync);
}
private string CreateCacheKey()
{
var userKey = CurrentUser.Id?.ToString("N") ?? "Anonymous";
return $"ApplicationConfiguration_{userKey}_{CultureInfo.CurrentUICulture.Name}";
}
}