Can you try this?
services.AddAbpSwaggerGenWithOAuth(
services.AddTransient<SwaggerGenerator>();
services.Replace(ServiceDescriptor.Transient<ISwaggerProvider, MySwaggerGenerator>());
using System;
using Microsoft.OpenApi.Models;
using Swashbuckle.AspNetCore.Swagger;
using Swashbuckle.AspNetCore.SwaggerGen;
using Volo.Abp.MultiTenancy;
namespace MyCompanyName.MyProjectName.Web;
public class MySwaggerGenerator : ISwaggerProvider
{
private readonly SwaggerGenerator _innerSwaggerGenerator;
private readonly SwaggerGeneratorOptions _options;
private readonly ICurrentTenant _currentTenant;
public MySwaggerGenerator(SwaggerGenerator innerSwaggerGenerator, SwaggerGeneratorOptions options, ICurrentTenant currentTenant)
{
_innerSwaggerGenerator = innerSwaggerGenerator;
_options = options;
_currentTenant = currentTenant;
}
public OpenApiDocument GetSwagger(string documentName, string host = null, string basePath = null)
{
foreach (var securityScheme in _options.SecuritySchemes)
{
if (securityScheme.Value.Flows.AuthorizationCode != null && _currentTenant.IsAvailable)
{
securityScheme.Value.Flows.AuthorizationCode.AuthorizationUrl = new Uri(securityScheme.Value.Flows.AuthorizationCode.AuthorizationUrl.ToString().Replace("ids", $"{_currentTenant.Name}.ids"));
securityScheme.Value.Flows.AuthorizationCode.TokenUrl = new Uri(securityScheme.Value.Flows.AuthorizationCode.TokenUrl.ToString().Replace("ids", $"{_currentTenant.Name}.ids"));
}
}
return _innerSwaggerGenerator.GetSwagger(documentName, host, basePath);
}
}
You can save the refresh token when calling the request token. it will both return the access token and refresh token.
hi
abp is modular, when you want to call the API of another project, you can only refer to its contract or http client module, which is a modular design.
Also, it would be useful if you provided an example of proper way to create HttpClient and make HTTP requests in ABP app.
The default module template already includes these APIs and examples.
hi
You can consider to custom the Manage(account\src\Volo.Abp.Account.Pro.Public.Web\Pages\Account\Manage.cshtml.cs) page.
hi
There is no document for this case because it is not related to the framework but to asp net core. I think you can copy the code of asp net core directly to the abp project. If you have any issues, please feel free to give feedback.
You can also share your external Identity provider code and I will confirm it.