Don't worry about my above question, I found others have similar problem - register but also update the user info which broke the security stamp.
However, I have another question, as I need to create a Sign Up button in Angular. There is a navigateToLogin method in auth service, but there is no such navigateToRegister method. login() { this.authService.navigateToLogin(); }
I customised my own one, but it didn't invoke the /token endpoint therefore, the user registered through my custom flow will not be authenticated straight away, until they actively click on "register" / "login" to refresh the page to get logged in.
async navigateToRegisterEx2() {
const authServerUrl = environment.oAuthConfig.issuer;
const responseType = environment.oAuthConfig.responseType;
const clientId = environment.oAuthConfig.clientId;
const redirectUri = environment.oAuthConfig.redirectUri;
const scope = environment.oAuthConfig.scope;
// Generate PKCE parameters
const codeVerifier = this.generateCodeVerifier();
const codeChallenge = await this.generateCodeChallenge(codeVerifier);
const state = this.generateState();
const nonce = this.generateNonce();
// Store PKCE parameters in session storage for later use
sessionStorage.setItem('code_verifier', codeVerifier);
sessionStorage.setItem('state', state);
sessionStorage.setItem('nonce', nonce);
const returnUrl = encodeURIComponent(
`/connect/authorize?response_type=${responseType}&client_id=${clientId}&redirect_uri=${encodeURIComponent(
redirectUri
)}&scope=${encodeURIComponent(
scope
)}&state=${state}&code_challenge=${codeChallenge}&code_challenge_method=S256&nonce=${nonce}&culture=en&ui-culture=en`
);
window.location.href = `${authServerUrl}Account/Login?register=true&returnUrl=${returnUrl}`;
}
I could not find anywhere to invoke the out of box Register OAuthFlow in angular. Please advise.
Exception message and full stack trace:
[18:21:05 INF] Request starting HTTP/2 GET https://localhost:44318/Account/EmailConfirmation?userId=0841cd40-1ff0-0017-27e2-3a1ae6b1bafd&__tenant=712d7070-8d81-3fd3-eaa8-3a18008b6246&confirmationToken=CfDJ8C8bts6Bgc9OvV5TVAdDQVYp77XSKp4N1RHrG1eCiaGOlYEIka3r8jjzhMbFhrqrlIiNjWgVEjrKz4B5R3nUodUnKBmvk%2B3j0%2BSTnbyh5AUx8E9wnaP6q3TFQeG4CJG44Xu5fa6z52Y8QkC1ovb6PGWl8BbSevC82hcKj94GmpJgYSTmnLsx%2BSpELpUFCCfkIoQVpzIMiPKz4vez2dxmcbTOkOHKhIK7GJNAtrZfLYQL%2BmvCjKbqkRgLXYoDodQRYw%3D%3D&returnUrl=%2fconnect%2fauthorize%3fresponse_type%3dcode%26client_id%3dBetterBilling_App%26state%3ddmVLd3Z4LWlqSlBodzBOSlpSbEp2bUxzdWsxcjJPdko4ZTh5UlZ6aEVlUUJW%26redirect_uri%3dhttp%253A%252F%252Flocalhost%253A4200%26scope%3dopenid%2520offline_access%2520BetterBilling%26code_challenge%3dZsE0yr8Kl625hSK2SOsW86wIL6q_54oBGfP8CIsqw7Q%26code_challenge_method%3dS256%26nonce%3ddmVLd3Z4LWlqSlBodzBOSlpSbEp2bUxzdWsxcjJPdko4ZTh5UlZ6aEVlUUJW%26culture%3den%26ui-culture%3den - null null [18:21:05 DBG] The event OpenIddict.Validation.OpenIddictValidationEvents+ProcessRequestContext was successfully processed by OpenIddict.Validation.AspNetCore.OpenIddictValidationAspNetCoreHandlers+ResolveRequestUri. [18:21:05 DBG] The event OpenIddict.Server.OpenIddictServerEvents+ProcessRequestContext was successfully processed by OpenIddict.Server.AspNetCore.OpenIddictServerAspNetCoreHandlers+ResolveRequestUri. [18:21:05 DBG] The event OpenIddict.Server.OpenIddictServerEvents+ProcessRequestContext was successfully processed by OpenIddict.Server.OpenIddictServerHandlers+InferEndpointType. [18:21:05 DBG] The event OpenIddict.Server.OpenIddictServerEvents+ProcessRequestContext was successfully processed by Volo.Abp.Account.Web.Pages.Account.OpenIddictImpersonateInferEndpointType. [18:21:05 DBG] The event OpenIddict.Server.OpenIddictServerEvents+ProcessRequestContext was successfully processed by OpenIddict.Server.AspNetCore.OpenIddictServerAspNetCoreHandlers+ValidateTransportSecurityRequirement. [18:21:05 DBG] The event OpenIddict.Server.OpenIddictServerEvents+ProcessRequestContext was successfully processed by OpenIddict.Server.AspNetCore.OpenIddictServerAspNetCoreHandlers+ValidateHostHeader. [18:21:05 DBG] Get dynamic claims cache for user: 0841cd40-1ff0-0017-27e2-3a1ae6b1bafd [18:21:05 INF] Executing endpoint '/Account/EmailConfirmation' [18:21:05 INF] Route matched with {page = "/Account/EmailConfirmation", action = "", controller = "", area = ""}. Executing page /Account/EmailConfirmation [18:21:05 INF] Skipping the execution of current filter as its not the most effective filter implementing the policy Microsoft.AspNetCore.Mvc.ViewFeatures.IAntiforgeryPolicy [18:21:05 INF] Executing handler method Volo.Abp.Account.Public.Web.Pages.Account.EmailConfirmationModel.OnGetAsync - ModelState is Valid [18:21:05 DBG] VerifyUserTokenAsync() failed with purpose: EmailConfirmation for user. [18:21:05 INF] Executed handler method OnGetAsync, returned result Microsoft.AspNetCore.Mvc.RazorPages.PageResult. [18:21:05 DBG] Added 0 entity changes to the current audit log [18:21:05 DBG] Added bundle 'LeptonX.Global' to the page in 4.45 ms. [18:21:05 DBG] Added bundle 'LeptonX.Global' to the page in 3.16 ms. [18:21:05 INF] Executed page /Account/EmailConfirmation in 60.4712ms [18:21:05 INF] Executed endpoint '/Account/EmailConfirmation' [18:21:05 INF] Request finished HTTP/2 GET https://localhost:44318/Account/EmailConfirmation?userId=0841cd40-1ff0-0017-27e2-3a1ae6b1bafd&__tenant=712d7070-8d81-3fd3-eaa8-3a18008b6246&confirmationToken=CfDJ8C8bts6Bgc9OvV5TVAdDQVYp77XSKp4N1RHrG1eCiaGOlYEIka3r8jjzhMbFhrqrlIiNjWgVEjrKz4B5R3nUodUnKBmvk%2B3j0%2BSTnbyh5AUx8E9wnaP6q3TFQeG4CJG44Xu5fa6z52Y8QkC1ovb6PGWl8BbSevC82hcKj94GmpJgYSTmnLsx%2BSpELpUFCCfkIoQVpzIMiPKz4vez2dxmcbTOkOHKhIK7GJNAtrZfLYQL%2BmvCjKbqkRgLXYoDodQRYw%3D%3D&returnUrl=%2fconnect%2fauthorize%3fresponse_type%3dcode%26client_id%3dBetterBilling_App%26state%3ddmVLd3Z4LWlqSlBodzBOSlpSbEp2bUxzdWsxcjJPdko4ZTh5UlZ6aEVlUUJW%26redirect_uri%3dhttp%253A%252F%252Flocalhost%253A4200%26scope%3dopenid%2520offline_access%2520BetterBilling%26code_challenge%3dZsE0yr8Kl625hSK2SOsW86wIL6q_54oBGfP8CIsqw7Q%26code_challenge_method%3dS256%26nonce%3ddmVLd3Z4LWlqSlBodzBOSlpSbEp2bUxzdWsxcjJPdko4ZTh5UlZ6aEVlUUJW%26culture%3den%26ui-culture%3den - 200 null text/html; charset=utf-8 83.3383ms [18:21:05 INF] Request starting HTTP/2 GET https://localhost:44318/Abp/ApplicationLocalizationScript?cultureName=en - null null [18:21:05 INF] Request starting HTTP/2 GET https://localhost:44318/Abp/ApplicationConfigurationScript - null null [18:21:05 INF] Request starting HTTP/2 GET https://localhost:44318/Abp/ServiceProxyScript - null null **
As I don't have source code of /Account/EmailConfirmation, I suppose some of the keys are expired?
I have tried dataProtectionBuilder with both local aspnet and Redis, none of them are working.
var dataProtectionBuilder = context
.Services.AddDataProtection()
.SetApplicationName("BetterBilling")
// Keys expire after 1 year
.SetDefaultKeyLifetime(TimeSpan.FromDays(365));
if (!hostingEnvironment.IsDevelopment())
{
var redis = ConnectionMultiplexer.Connect(configuration["Redis:Configuration"]!);
dataProtectionBuilder.PersistKeysToStackExchangeRedis(
redis,
"BetterBilling-Protection-Keys"
);
}
I am sure it was working before, or does any of the abp upgrade impact it?
Thanks for the quick response, I figured it out, you are right, I need to add --version 8.3.4 to support .NET 8.
I am wondering why dotnet tool install -g Volo.Abp.Studio.Cli was working 4 days ago, then stopped today?
ABP Framework version: v8.2.2
UI Type: Angular
Database System: EF Core (SQL Server)
Tiered (for MVC) or Auth Server Separated (for Angular): yes
Exception message and full stack trace: Run dotnet tool install -g Volo.Abp.Studio.Cli dotnet tool install -g Volo.Abp.Studio.Cli shell: /usr/bin/bash -e {0} env: IMAGE_NAME: mb-betterbilling-api DOTNET_ROOT: /usr/share/dotnet
Tool 'volo.abp.studio.cli' failed to update due to the following: The settings file in the tool's NuGet package is invalid: Settings file 'DotnetToolSettings.xml' was not found in the package. Tool 'volo.abp.studio.cli' failed to install. Contact the tool author for assistance. Error: Process completed with exit code 1.
I had similar question 3 months ago - https://abp.io/support/questions/8403/Newer-version-of-CLI-broke-my-CI--CD-pipelines
It seems happening again, I don't want to upgrade my .NET 8 to 9, and I can reproduce the issue locally:
I tried 8.3.4, it's not working too :
dotnet tool install -g Volo.Abp.Cli --version 8.3.4
Thanks liming, I found install-libs is not necessary anymore. See those 2 steps below, install-libs was trying to run "yarn install v.22.22" too, that's why I think it conflicts with yarn install.
Run abp install-libs --working-directory . [03:41:36 INF] You are running the second generation of the ABP CLI. If you're interested in the legacy CLI, see https://abp.io/new-cli [03:41:36 WRN] Volo.Abp.Studio.Extensions.StandardSolutionTemplates extension not found in the NuGet cache. Directory: /home/runner/.nuget/packages/volo.abp.studio.extensions.standardsolutiontemplates/0.9.13/lib/net8.0 [03:41:36 INF] Volo.Abp.Studio.Extensions.StandardSolutionTemplates (v: 0.9.13) extension trying install from the NuGet 📌 ABP CLI 0.9.13 (Beta) Checking extensions... [03:41:41 INF] Volo.Abp.Studio.Extensions.StandardSolutionTemplates (v: 0.9.13) package downloaded from https://api.nuget.org/v3/index.json and saved to (/home/runner/.nuget/packages/) 🧩 Extensions downloaded: Volo.Abp.Studio.Extensions.StandardSolutionTemplates 🚲 The CLI is restarting to apply the changes with arguments: install-libs --working-directory . [03:41:42 INF] You are running the second generation of the ABP CLI. If you're interested in the legacy CLI, see https://abp.io/new-cli Checking extensions... [03:41:42 INF] Found 1 projects. [03:41:42 INF] . [03:41:43 INF] Running Yarn on . yarn install v1.22.22 [1/4] Resolving packages... [2/4] Fetching packages... 51s Run yarn install yarn install v1.22.22 [1/4] Resolving packages... [2/4] Fetching packages... error Error: ENOTEMPTY: directory not empty, rmdir '/home/runner/.cache/yarn/v6/npm-date-fns-2.30.0-f367e644839ff57894ec6ac480de40cae4b0f4d0-integrity/node_modules/date-fns' info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command. Error: Process completed with exit code 1.
After removing abp install-libs step, the pipeline works. I guess those licensed abp npm packages are not forced to be downloaded by install-libs anymore.
Hey mate, that's coming from your payment package. I don't have ng.theme-shared in my package.json.
{
"name": "@volo/abp.ng.payment",
"version": "8.2.3",
"peerDependencies": {
"@abp/ng.core": ">=8.2.3",
"@abp/ng.theme-shared": ">=8.2.3"
},
"dependencies": {
"@volo/abp.commercial.ng.ui": "~8.2.3",
"tslib": "^2.0.0"
},
"publishConfig": {
"access": "public"
},
"homepage": "https://abp.io",
"repository": {
"type": "git",
"url": "https://github.com/volosoft/volo.git"
},
"license": "LGPL-3.0",
"keywords": [
"aspnetcore",
"boilerplate",
"framework",
"web",
"best-practices",
"angular",
"maui",
"blazor",
"mvc",
"csharp",
"webapp"
],
"module": "fesm2022/volo-abp.ng.payment.mjs",
"typings": "index.d.ts",
"exports": {
"./package.json": {
"default": "./package.json"
},
".": {
"types": "./index.d.ts",
"esm2022": "./esm2022/volo-abp.ng.payment.mjs",
"esm": "./esm2022/volo-abp.ng.payment.mjs",
"default": "./fesm2022/volo-abp.ng.payment.mjs"
},
"./admin": {
"types": "./admin/index.d.ts",
"esm2022": "./esm2022/admin/volo-abp.ng.payment-admin.mjs",
"esm": "./esm2022/admin/volo-abp.ng.payment-admin.mjs",
"default": "./fesm2022/volo-abp.ng.payment-admin.mjs"
},
"./proxy": {
"types": "./proxy/index.d.ts",
"esm2022": "./esm2022/proxy/volo-abp.ng.payment-proxy.mjs",
"esm": "./esm2022/proxy/volo-abp.ng.payment-proxy.mjs",
"default": "./fesm2022/volo-abp.ng.payment-proxy.mjs"
},
"./admin/config": {
"types": "./admin/config/index.d.ts",
"esm2022": "./esm2022/admin/config/volo-abp.ng.payment-admin-config.mjs",
"esm": "./esm2022/admin/config/volo-abp.ng.payment-admin-config.mjs",
"default": "./fesm2022/volo-abp.ng.payment-admin-config.mjs"
}
},
"sideEffects": false
}
Please read and answer my questions one by one:
It's .NET 8.
I am not sure if the latest cli impacts install-libs or not, see the info below when I ran abp install-libs, it sounds like the CLI is not up to date.
[10:43:57 INF] You are running the second generation of the ABP CLI. If you're interested in the legacy CLI, see https://abp.io/new-cli
Checking extensions...
yarn start works fine locally.
I tried npm as well, it could not find the @abp/ng.theme-shared.
Run npm install npm warn ERESOLVE overriding peer dependency npm warn While resolving: @volo/abp.ng.payment@8.2.3 npm warn Found: @abp/ng.theme-shared@undefined npm warn node_modules/@abp/ng.theme-shared npm warn npm warn Could not resolve dependency: npm warn peer @abp/ng.theme-shared@">=8.2.3" from @volo/abp.ng.payment@8.2.3 npm warn node_modules/@volo/abp.ng.payment npm warn @volo/abp.ng.payment@"~8.2.2" from the root project npm error code E404 npm error 404 Not Found - GET https://registry.npmjs.org/@abp%2fng.theme-shared - Not found npm error 404 npm error 404 '@abp/ng.theme-shared@>=8.2.3' is not in this registry. npm error 404 npm error 404 Note that you can also install from a npm error 404 tarball, folder, http url, or git url. npm error A complete log of this run can be found in: /home/runner/.npm/_logs/2024-12-01T11_21_52_003Z-debug-0.log Error: Process completed with exit code 1.
ABP Framework version: v8.2.2
UI Type: Angular
Database System: EF Core (SQL Server)
Tiered (for MVC) or Auth Server Separated (for Angular): yes
Exception message and full stack trace:
Steps to reproduce the issue:
In my CI / CD pipelines, I have this step to install ABP CLI, however, the recent CLI upgrade (dotnet tool install -g Volo.Abp.Studio.Cli) made the old version unavailable. It was working 2 weeks ago - Tool 'volo.abp.cli' (version '8.3.4') was successfully installed.
Run dotnet tool install -g Volo.Abp.Cli dotnet tool install -g Volo.Abp.Cli shell: /usr/bin/bash -e {0} env: ENV_NAME: dev DOTNET_ROOT: /usr/share/dotnet Tool 'volo.abp.cli' failed to update due to the following: The settings file in the tool's NuGet package is invalid: Settings file 'DotnetToolSettings.xml' was not found in the package. Tool 'volo.abp.cli' failed to install. Contact the tool author for assistance.
After upgrading the CLI to the latest (dotnet tool install -g Volo.Abp.Studio.Cli), it broke my Angular pipeline:
##[debug]Evaluating condition for step: 'Install ABP libraries' ##[debug]Evaluating: success() ##[debug]Evaluating success: ##[debug]=> true ##[debug]Result: true ##[debug]Starting: Install ABP libraries ##[debug]Loading inputs ##[debug]Loading env Run abp install-libs ##[debug]Overwrite 'working-directory' base on job defaults. ##[debug]/usr/bin/bash -e /home/runner/work/_temp/0556fb7c-72bd-416c-8dda-f402e48e8778.sh [10:43:51 INF] You are running the second generation of the ABP CLI. If you're interested in the legacy CLI, see https://abp.io/new-cli [10:43:51 WRN] Volo.Abp.Studio.Extensions.StandardSolutionTemplates extension not found in the NuGet cache. Directory: /home/runner/.nuget/packages/volo.abp.studio.extensions.standardsolutiontemplates/0.9.13/lib/net8.0 [10:43:51 INF] Volo.Abp.Studio.Extensions.StandardSolutionTemplates (v: 0.9.13) extension trying install from the NuGet 📌 ABP CLI 0.9.13 (Beta) Checking extensions... [10:43:56 INF] Volo.Abp.Studio.Extensions.StandardSolutionTemplates (v: 0.9.13) package downloaded from https://api.nuget.org/v3/index.json and saved to (/home/runner/.nuget/packages/) 🧩 Extensions downloaded: Volo.Abp.Studio.Extensions.StandardSolutionTemplates 🚲 The CLI is restarting to apply the changes with arguments: install-libs [10:43:57 INF] You are running the second generation of the ABP CLI. If you're interested in the legacy CLI, see https://abp.io/new-cli Checking extensions... [10:43:57 INF] Found 1 projects. [10:43:57 INF] /home/runner/work/BetterBilling/BetterBilling/angular [10:43:57 INF] Running Yarn on /home/runner/work/BetterBilling/BetterBilling/angular yarn install v1.22.22 [1/4] Resolving packages... [2/4] Fetching packages... ##[debug]Finishing: Install ABP libraries 1m 1s ##[debug]Evaluating condition for step: 'Install dependencies' ##[debug]Evaluating: success() ##[debug]Evaluating success: ##[debug]=> true ##[debug]Result: true ##[debug]Starting: Install dependencies ##[debug]Loading inputs ##[debug]Loading env Run yarn install ##[debug]Overwrite 'working-directory' base on job defaults. ##[debug]/usr/bin/bash -e /home/runner/work/_temp/50a904a8-2569-4279-b67b-5fe35cfdd3ec.sh yarn install v1.22.22 [1/4] Resolving packages... [2/4] Fetching packages... error Error: ENOENT: no such file or directory, open '/home/runner/.cache/yarn/v6/npm-@microsoft-applicationinsights-cfgsync-js-3.3.4-4fd32c9fede703a6332ca82ed2cce359cbc5a8b7-integrity/node_modules/@microsoft/applicationinsights-cfgsync-js/.yarn-tarball.tgz' info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command. Error: Process completed with exit code 1. ##[debug]Finishing: Install dependencies
It blocked me from promoting to higher environment, please address ASAP.
Welcome back maliming, thanks for your reply.
I have resolved this issue referring to the others reply, similar to yours but ExposeService.
[ExposeServices(typeof(StripePaymentGateway))]
public class CustomStripeGateway : StripePaymentGateway
{
public CustomStripeGateway(
IPaymentRequestRepository paymentRequestRepository,
IPurchaseParameterListGenerator purchaseParameterListGenerator,
IPlanRepository planRepository,
IOptions<StripeOptions> stripeOptions,
ILogger<StripePaymentGateway> logger,
IDistributedEventBus eventBus,
IObjectMapper objectMapper
)
: base(
paymentRequestRepository,
purchaseParameterListGenerator,
planRepository,
stripeOptions,
logger,
eventBus,
objectMapper
)
{ }
public override Task HandleWebhookAsync(string payload, Dictionary<string, string> headers)
{
if (!headers.ContainsKey("Stripe-Signature") && headers.ContainsKey("stripe-signature"))
{
headers["Stripe-Signature"] = headers["stripe-signature"];
headers.Remove("stripe-signature");
// Log the information
Logger.LogInformation("Stripe-Signature header was missing, but stripe-signature was present. Converted stripe-signature to Stripe-Signature.");
}
// Volo Stripe Payment expects Stripe-Signature in the headers
return base.HandleWebhookAsync(payload, headers);
}
}
Is the header key case sensitive? I captured the header in the request, its lower case.
"stripe-signature": [ "t=1730242133,v1=decaaca94f84b9e6c0523c2f283945f52a8a2e6ce0ab654bade8aa51dc2a98a5,v0=08b2da9f09b998a63e483b36ee2cf7325769eeb650ab665ed42f3e14f4cfc69a" ],