You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
2.6 KiB
2.6 KiB
LINGYUN.Abp.OpenIddict.HttpApi.Client
Introduction
LINGYUN.Abp.OpenIddict.HttpApi.Client is the HTTP API client module for OpenIddict, providing client proxies for remote OpenIddict HTTP API calls.
Features
-
HTTP API Client Proxies
- Automatic HTTP client proxy generation
- Support for remote service calls
- Integration with ABP dynamic HTTP client proxies
-
Remote Service Configuration
- Support for configuring remote service URLs
- Support for configuring authentication methods
- Support for configuring request headers
Installation
dotnet add package LINGYUN.Abp.OpenIddict.HttpApi.Client
Usage
-
Add
[DependsOn(typeof(AbpOpenIddictHttpApiClientModule))]to your module class. -
Configure remote services:
public override void ConfigureServices(ServiceConfigurationContext context)
{
var configuration = context.Services.GetConfiguration();
Configure<AbpRemoteServiceOptions>(options =>
{
options.RemoteServices.Default = new RemoteServiceConfiguration
{
BaseUrl = configuration["RemoteServices:Default:BaseUrl"]
};
});
}
- Usage example:
// Inject client proxy
private readonly IOpenIddictApplicationAppService _applicationService;
public YourService(IOpenIddictApplicationAppService applicationService)
{
_applicationService = applicationService;
}
// Call remote service
var input = new OpenIddictApplicationCreateDto
{
ClientId = "your-client-id",
DisplayName = "Your App",
// ... other properties
};
var result = await _applicationService.CreateAsync(input);
Configuration
- RemoteServices
- Default:BaseUrl - Default remote service URL
- OpenIddict:BaseUrl - OpenIddict remote service URL
Notes
- Correct remote service URLs need to be configured
- If remote services require authentication, corresponding authentication information needs to be configured
- HTTPS is recommended in production environments
- Client proxies automatically handle authentication token transmission