Hi,
These are the standard OIDC parameters, and I don't recommend you change them.
Anyway, You can change it in the following:
context.Services.Configure<OpenIdConnectOptions>("oidc", options =>
{
var previousOnRedirectToIdentityProvider = options.Events.OnRedirectToIdentityProvider;
options.Events.OnRedirectToIdentityProvider = async ctx =>
{
ctx.ProtocolMessage.IssuerAddress = "...../connect/authorize";
//...
if (previousOnRedirectToIdentityProvider != null)
{
await previousOnRedirectToIdentityProvider(ctx);
}
};
});
ok, I will check it
Hi,
This is the limit of ExtraProperties, it only supports primitives.
You can track this: https://github.com/abpframework/abp/issues/17927
Hi,
We will check it.
Hi,
I think the data result is no problem, right?
Hi,
Could you provide the full steps or share a project to reproduce the problem? I will check it. my email is shiwei.liang@volosoft.com
Hi,
You can try to overwrite the page: https://docs.abp.io/en/abp/latest/UI/AspNetCore/Customization-User-Interface
public class UrlHelper : ITransientDependency
{
private readonly ICurrentTenant _currentTenant;
public UrlHelper(ICurrentTenant currentTenant)
{
_currentTenant = currentTenant;
}
public const string TenantNamePlaceHolder = "{{tenantName}}";
public string ReplaceTenantPlaceholder(string url)
{
var tenantNamePlaceHolder = TenantNamePlaceHolder;
if (url.Contains(TenantNamePlaceHolder + '.'))
{
tenantNamePlaceHolder = TenantNamePlaceHolder + '.';
}
if (url.Contains(tenantNamePlaceHolder))
{
url = _currentTenant.Id.HasValue ? url.Replace(tenantNamePlaceHolder, _currentTenant.Name + ".") : url.Replace(tenantNamePlaceHolder, "");
}
return url;
}
}
Pages/Payment/GatewaySelection.cshtml
@page
@using Microsoft.AspNetCore.Mvc.Localization
@using Volo.Payment.Localization
@model Volo.Payment.Pages.Payment.MyGatewaySelectionModel
@inject IHtmlLocalizer<PaymentResource> Localizer
@section scripts {
<abp-script-bundle>
<abp-script src="/client-proxies/payment-proxy.js" />
<abp-script src="/Pages/Payment/gateway-selection.js" />
</abp-script-bundle>
}
<div class="container">
<div class="row">
<div class="col-md-7 mx-auto">
<div class="card">
<div class="card-header">
<h4 class="m-0 text-center">Select a Payment Gateway</h4>
</div>
<div class="card-body">
<form id="frmGatewaySelection" method="post" action="">
@Html.AntiForgeryToken()
<div class="row">
@for (int gatewayIndex = 0; gatewayIndex < Model.Gateways.Count; gatewayIndex++)
{
var gateway = Model.Gateways[gatewayIndex];
<div class="col">
<div class="form-check">
<input type="hidden" id="@($"{@gateway.Name}PrePaymentUrl")" value="@(Model.UrlHelper.ReplaceTenantPlaceholder(gateway.PrePaymentUrl))?paymentRequestId=@Model.PaymentRequestId"/>
<input type="radio" name="gateway" class="form-check-input" checked="@(gatewayIndex == 0)" value="@gateway.Name" id="@gateway.Name">
<label for="@gateway.Name" class="form-check-label">
<strong>@Localizer["PayWithGateway", Localizer[gateway.Name]]</strong>
@if (gateway.Recommended)
{
<small class="text-muted">(Recommended)</small>
}
</label>
@if (gateway.ExtraInfos.Any())
{
<div class="payment-info-boxes">
@foreach (var extraInfo in gateway.ExtraInfos)
{
<p class="mt-1 mb-0 text-muted">
<small class="d-block"><i class="fa fa-info-circle"></i> @Html.Raw(extraInfo)</small>
</p>
}
</div>
}
</div>
</div>
<input type="hidden" name="paymentRequestId" value="@Model.PaymentRequestId" />
}
</div>
</form>
</div>
<div class="card-body">
<div class="d-grid gap-2">
<a id="btnSubmit" href="#" class="btn btn btn-success @Model.CheckoutButtonStyle">Continue to Checkout <i class="fas fa-arrow-right"></i></a>
</div>
<p class="mt-2 mb-1 text-muted text-center">
<small>
<i class="fa fa-info-circle"></i> Next, you will be redirected to the selected payment gateway's website for the transaction
</small>
</p>
</div>
</div>
</div>
</div>
</div>
[ExposeServices(typeof(GatewaySelectionModel))]
public class MyGatewaySelectionModel : GatewaySelectionModel
{
private readonly IOptions<PaymentWebOptions> _paymentWebOptions;
private readonly IGatewayAppService _gatewayAppService;
private readonly IPaymentRequestAppService _paymentRequestAppService;
public UrlHelper UrlHelper { get; set; }
public MyGatewaySelectionModel(
IPaymentRequestAppService paymentRequestAppService,
IOptions<PaymentWebOptions> paymentWebOptions,
IGatewayAppService gatewayAppService) : base(paymentRequestAppService, paymentWebOptions, gatewayAppService)
{
_paymentWebOptions = paymentWebOptions;
_gatewayAppService = gatewayAppService;
_paymentRequestAppService = paymentRequestAppService;
}
public override async Task<IActionResult> OnPostAsync()
{
CheckoutButtonStyle = _paymentWebOptions.Value.GatewaySelectionCheckoutButtonStyle;
var paymentRequest = await _paymentRequestAppService.GetAsync(PaymentRequestId);
List<GatewayDto> gatewaysDtos;
if (paymentRequest.Products.Any(a => a.PaymentType == PaymentType.Subscription))
{
gatewaysDtos = await _gatewayAppService.GetSubscriptionSupportedGatewaysAsync();
}
else
{
gatewaysDtos = await _gatewayAppService.GetGatewayConfigurationAsync();
}
Gateways = _paymentWebOptions.Value.Gateways
.Where(x => gatewaysDtos.Any(a => a.Name == x.Key))
.Select(x => x.Value)
.ToList();
if (!Gateways.Any())
{
throw new ApplicationException("No payment gateway configured!");
}
if (Gateways.Count == 1)
{
var gateway = Gateways.First();
return LocalRedirectPreserveMethod(UrlHelper.ReplaceTenantPlaceholder((gateway.PrePaymentUrl) + "?paymentRequestId=" + PaymentRequestId));
}
return Page();
}
}
[ExposeServices(typeof(PostPaymentModel))]
public class MyPostPaymentModel : PostPaymentModel
{
public UrlHelper UrlHelper { get; set; }
private IOptions<PaymentWebOptions> _paymentWebOptions;
public MyPostPaymentModel(IPaymentRequestAppService paymentRequestAppService, IOptions<PaymentWebOptions> paymentWebOptions) : base(paymentRequestAppService, paymentWebOptions)
{
_paymentWebOptions = paymentWebOptions;
}
public override async Task<IActionResult> OnGetAsync()
{
if (SessionId.IsNullOrWhiteSpace())
{
return BadRequest();
}
var paymentRequest = await PaymentRequestAppService.CompleteAsync(
StripeConsts.GatewayName,
new()
{
{ StripeConsts.ParameterNames.SessionId, SessionId },
});
if (!_paymentWebOptions.Value.CallbackUrl.IsNullOrWhiteSpace())
{
var callbackUrl = UrlHelper.ReplaceTenantPlaceholder(_paymentWebOptions.Value.CallbackUrl + "?paymentRequestId=" + paymentRequest.Id);
Response.Redirect(callbackUrl);
}
return Page();
}
}
Hi,
You can use the javascript oidc library.