Problem statement
We have an ABP.io application using Angular + .NET Core + OpenIddict. After upgrading the application to ABP 10.6.0, the OpenID Connect discovery endpoint is not accessible in our DEV hosted environment.
The endpoint works correctly when running locally, but returns 404 or 504 in DEV.
Working locally
https://localhost:44350/.well-known/openid-configuration
This returns the expected OpenID Connect discovery document.
Failing in DEV
https://api-product.dev.<COMPANY_DOMAIN>/.well-known/openid-configuration
This returns either:
404 Not Found or 504 Gateway Timeout
Architecture
Our deployment architecture is:
Angular Application
|
| OIDC discovery request
|
v
`https://api-product.dev.<company_domain>`
|
+-- /Account/Login
+-- /connect/authorize
+-- /connect/token
+-- /.well-known/openid-configuration
|
v
AWS API Gateway / VPC Link
|
v
AWS ECS
|
v
ASP.NET Core / ABP AuthServer
|
v
OpenIddict
There is not a separate public AuthServer hostname in this environment.
The following URL is our AuthServer:
https://api-product.dev.<company_domain>/Account/Login
We were previously able to access the AuthServer login page successfully using this URL. Therefore App:SelfUrl is intentionally configured to the same public host: https://api-product.dev.<COMPANY_DOMAIN>. The issue occurs before the user logs in. When the Angular application is opened, the OIDC client automatically requests the discovery endpoint during authentication initialization.
Current configuration
Our AuthServer appsettings.json contains:
{
"App": {
"SelfUrl": "https://api-product.dev.<company_domain>",
"CorsOrigins": "https://*.litmus.financial,https://*.<company_domain>,http://localhost:4200"
}
}
C# Openiddict configuration
using Microsoft.Extensions.Logging;
using Volo.Abp.OpenIddict;
[DependsOn(typeof(AbpAccountPublicWebOpenIddictModule))]
public class LitmusIdentityServerModule : AbpModule
{
private static string _configuredIssuer;
private static bool _isDefaultIssuer;
public override void PreConfigureServices(ServiceConfigurationContext context)
{
var configuration = context.Services.GetConfiguration();
PreConfigure<OpenIddictBuilder>(builder =>
{
builder.AddServer(options =>
{
options.AllowPasswordFlow();
options.AllowClientCredentialsFlow();
options.AllowAuthorizationCodeFlow();
options.AllowImplicitFlow();
options.AllowDeviceAuthorizationFlow();
options.AllowRefreshTokenFlow();
});
builder.AddValidation(options =>
{
options.AddAudiences(/* configured scopes/audiences */);
options.UseLocalServer();
options.UseAspNetCore();
});
});
PreConfigure<OpenIddictServerBuilder>(builder =>
{
// Issuer configuration
var selfUrl = configuration["App:SelfUrl"];
// Grant types
builder.AllowPasswordFlow();
builder.AllowClientCredentialsFlow();
builder.AllowAuthorizationCodeFlow();
builder.AllowImplicitFlow();
builder.AllowDeviceAuthorizationFlow();
builder.AllowRefreshTokenFlow();
// Explicit endpoint configuration
builder.SetAuthorizationEndpointUris("/connect/authorize");
builder.SetTokenEndpointUris("/connect/token");
builder.SetIntrospectionEndpointUris("/connect/introspect");
builder.SetRevocationEndpointUris("/connect/revocation");
builder.SetConfigurationEndpointUris("/.well-known/openid-configuration");
builder.SetUserInfoEndpointUris("/connect/userinfo");
});
if (!hostingEnvironment.IsDevelopment())
{
PreConfigure<AbpOpenIddictAspNetCoreOptions>(options =>
{
options.AddDevelopmentEncryptionAndSigningCertificate = false;
});
PreConfigure<OpenIddictServerBuilder>(builder =>
{
builder.AddSigningCertificate(GetSigningCertificate(hostingEnvironment, configuration));
builder.AddEncryptionCertificate(GetSigningCertificate(hostingEnvironment, configuration));
});
}
}
public override void OnApplicationInitialization(ApplicationInitializationContext context)
{
var logger = context.ServiceProvider.GetRequiredService<ILogger<LitmusIdentityServerModule>>();
if (!string.IsNullOrEmpty(_configuredIssuer))
{
if (_isDefaultIssuer)
logger.LogWarning("OpenIddict issuer: App:SelfUrl not configured. Using default: {Issuer}", _configuredIssuer);
else
logger.LogInformation("OpenIddict issuer configured from App:SelfUrl: {Issuer}", _configuredIssuer);
}
// ... rest of initialization
}
}
<PackageReference Include="Volo.Abp.Account.Pro.Public.Web.OpenIddict" Version="10.6.0" />
Additional information
- Deployment is not exposing/using /getEnvConfig
- We dont have seperate public URL for Auth Server but via
https://api-product.dev.<company_domain>/Account/Login
Expectation
We would appreciate a short call with the ABP team so we can share the complete code/configuration and demonstrate the issue live, which should help us identify and resolve the root cause faster.
Note: Our team member has previously raised the following tickets for similar issues encountered during the upgrade.
- Exception message and full stack trace:
- Steps to reproduce the issue:
31 Answer(s)
-
0
In ABP 10.6 (OpenIddict), when your AuthServer is behind a reverse proxy/API Gateway that terminates TLS, the AuthServer process may see the incoming request as HTTP (or with a different host), unless forwarded headers are applied correctly.
- This typically results in OpenIddict endpoints (including
/.well-known/openid-configuration) behaving unexpectedly in hosted environments (404 via unmatched route/proxy mapping, or 504 due to gateway retries/timeouts), while still working locally.
- This typically results in OpenIddict endpoints (including
Fix it by ensuring the AuthServer trusts and applies forwarded headers (scheme/host), before ABP endpoints are executed.
Solution
1) Enable forwarded headers in the AuthServer pipeline
In your AuthServer project module (
*.HttpApi.Host/ AuthServer host module), addUseForwardedHeaders()early inOnApplicationInitialization.Example:
using Microsoft.AspNetCore.HttpOverrides; using Volo.Abp; public override void OnApplicationInitialization(ApplicationInitializationContext context) { var app = context.GetApplicationBuilder(); app.UseForwardedHeaders(new ForwardedHeadersOptions { ForwardedHeaders = ForwardedHeaders.XForwardedFor | ForwardedHeaders.XForwardedProto | ForwardedHeaders.XForwardedHost }); // If your proxy is not in KnownNetworks/KnownProxies, you may need: // options.KnownNetworks.Clear(); // options.KnownProxies.Clear(); // Continue with the standard ABP pipeline... }This ensures OpenIddict sees the request as
https://api-product.dev.<company_domain>(instead ofhttp://<internal-host>:<port>), so discovery generation/routing matches what the Angular OIDC client expects.2) Ensure AWS API Gateway forwards the required headers
Configure API Gateway / VPC Link integration so the backend receives:
X-Forwarded-Proto: httpsX-Forwarded-Host: api-product.dev.<company_domain>X-Forwarded-For: <client-ip>
Without these,
UseForwardedHeaders()can’t reconstruct the external URL correctly.3) Don’t rely on custom
SetConfigurationEndpointUrisunless necessaryABP/OpenIddict already exposes the discovery endpoint by default. Keeping custom endpoint URI setup is usually fine, but if your proxy rewrites paths or strips
/.well-known/*, remove the explicit endpoint overrides and retest to eliminate path-mapping issues at the gateway layer.4) About the “short call” request
For scheduling/support coordination (non-technical/support process), please contact us at: https://abp.io/contact
Sources
- https://abp.io/docs/latest/deployment/forwarded-headers
- https://abp.io/docs/latest/solution-templates/layered-web-application/deployment/openiddict-deployment
- https://abp.io/docs/10.6/modules/openiddict
- https://abp.io/contact
This response was generated by AI. If it didn’t solve your problem, feel free to post a new answer — our support team will jump in to help you soon.
Markdown supported.Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post) -
0
Hi,
A 404 for
/.well-known/openid-configurationisn't something the AuthServer produces by itself. When a request with that path reaches it, OpenIddict handles it, it doesn't fall through to a 404, and a CORS preflight for it is answered by the CORS middleware or by OpenIddict, again not with a 404. So the 404 means the request didn't reach the AuthServer, reached it with a different path, or reached a different service. The 504 is API Gateway not getting a response from the integration in time.So start with the API Gateway route for this path. It needs the same integration as
/Account/Login, and OPTIONS has to be covered too, either forwarded or answered by the gateway's CORS config, because the browser sends a preflight for this URL (the screenshot in https://abp.io/support/questions/10858/ shows that OPTIONS request getting the 404).The AuthServer log tells you which side it is. Search the logs of all tasks for one failing request:
Request starting ... /.well-known/openid-configuration Request finished ... /.well-known/openid-configuration - <status> ...- No
Request startingline: the request never reached the AuthServer, fix the route/integration. - The line is there but with a different path, or the app itself answered 404: the gateway rewrites the path, or that ECS service doesn't host OpenIddict. When OpenIddict does pick up the path it also logs
The request URI matched a server endpoint: Configuration. - 400 with "This server only accepts HTTPS requests": the task receives plain HTTP after TLS termination at the gateway. If your module still has the template's
AuthServer:RequireHttpsMetadatacheck, set it tofalsein the DEV appsettings. If that part was removed, add this toConfigureServices:
using OpenIddict.Server.AspNetCore; Configure<OpenIddictServerAspNetCoreOptions>(options => { options.DisableTransportSecurityRequirement = true; });Request finishedwith 200 in a few ms while the public URL gets 504: the problem is between API Gateway and the task, check the API Gateway access log and the integration latency for that request. NoRequest finishedat all: the app is hanging on that request, and the lines before it show on what.
Send the AuthServer log around one failing request, the API Gateway log for the same request, and the route/integration config for this path to liming.ma@volosoft.com and we'll go through it with you.
Thanks
Markdown supported.Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post) - No
-
0
Hi @maliming,
Thank for the quick response. I have shared the logs in mail
Thanks
Markdown supported.Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post) -
0
- Noted — since you’ve already emailed the logs, the remaining actionable checks on your side (that commonly explain 404/504 for
/.well-known/openid-configurationbehind AWS API Gateway) are:
Solution
- Verify API Gateway routing for BOTH
GETandOPTIONS
- Ensure
/.well-known/openid-configurationis mapped to the same integration/target as/Account/Login. - Make sure OPTIONS is handled:
- Either forwarded to ECS, or
- Answered by API Gateway CORS config.
- A browser will typically preflight (
OPTIONS) the discovery endpoint; if OPTIONS gets 404 at the gateway, the Angular OIDC init fails even if GET would work.
- Confirm the request actually reaches the AuthServer
- In the AuthServer logs, for a failing attempt you should see lines like:
Request starting ... /.well-known/openid-configurationRequest finished ... /.well-known/openid-configuration - <status> ...
- If there is no
Request startingfor that path, the problem is definitively API Gateway routing / path rewrite / wrong upstream (not ABP/OpenIddict).
- If you see “This server only accepts HTTPS requests” (ID2083) That means the app receives plain HTTP after TLS is terminated at the gateway.
- Recommended fix: enable forwarded headers in the AuthServer so the app reconstructs the external scheme/host correctly:
using Microsoft.AspNetCore.HttpOverrides; public override void OnApplicationInitialization(ApplicationInitializationContext context) { var app = context.GetApplicationBuilder(); app.UseForwardedHeaders(new ForwardedHeadersOptions { ForwardedHeaders = ForwardedHeaders.XForwardedFor | ForwardedHeaders.XForwardedProto | ForwardedHeaders.XForwardedHost }); // continue with ABP pipeline... }- Also ensure API Gateway forwards:
X-Forwarded-Proto: httpsX-Forwarded-Host: api-product.dev.<company_domain>
- Call request (scheduling) For arranging a short call / sharing environment details live, please use: https://abp.io/contact
Sources
- https://abp.io/docs/latest/deployment/forwarded-headers
- https://abp.io/docs/latest/solution-templates/layered-web-application/deployment/openiddict-deployment
- https://abp.io/docs/10.6/modules/openiddict
- https://abp.io/contact
This response was generated by AI. If it didn’t solve your problem, feel free to post a new answer — our support team will jump in to help you soon.
Markdown supported.Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post) - Noted — since you’ve already emailed the logs, the remaining actionable checks on your side (that commonly explain 404/504 for
-
0
Hi,
Thanks for the logs. The identity task itself is where to look. The
GET /.well-known/openid-configurationin the identity log arrives with the exact path and still ends with "reached the end of the middleware pipeline" after 0.1 ms. With the standard OpenIddict setup, the OpenIddict handler inUseAuthenticationtakes that request and writes the response itself, so it never gets to that 404. Add/Account/Loginreturning 404 on localhost inside the container, and what runs in that task isn't wired up like your local run: the OpenIddict server isn't handling requests there and the Account pages aren't mapped.To see why, send me these from the identity host:
Program.cs- The complete host module class, the one with
OnApplicationInitialization - The
.csprojof that project - The ECS task definition for that container: image tag, entry point/command and container port
- The task's startup log from process start to the first request, without a filter on the log category
- From inside the container, the full response of a request to
/.well-known/openid-configurationon the local port, headers included
Thanks
Markdown supported.Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post) -
0
Hi @maliming,
Thanks, I will share soon. Please also tell me if OpenIddict table data also need to review or its not needed?
- public."OpenIddictApplications"
- public."OpenIddictScopes"
Thanks
Markdown supported.Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post) -
0
Hi,
Not for this one. The discovery request isn't reaching OpenIddict at all, so nothing is read from those tables yet. They come into play once the endpoints respond: the discovery document lists the scopes from
OpenIddictScopes, andOpenIddictApplicationsis checked on the authorize/token calls of your Angular client. Leave them as they are for now.Thanks
Markdown supported.Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post) -
0
Hi,
Thanks, that's enough to see it. In the identity host's
Program.csthe two ABP calls aren't awaited:builder.AddApplicationAsync<LitmusIdentityServerModule>(); var app = builder.Build(); app.InitializeApplicationAsync(); app.Run();InitializeApplicationAsyncis whereOnApplicationInitializationruns, so it's whereUseAuthentication,UseConfiguredEndpointsand the rest get added. Without theawait,app.Run()starts the host straight away, and the host builds the request pipeline at that moment. If module initialization hasn't reached your module yet, nothing is in the pipeline and every request falls through to that 404. It's a timing thing, which is why it works on your machine and not on the task.Make
Mainasync and await both calls, the same way the template does:public static async Task<int> Main(string[] args) { var builder = WebApplication.CreateBuilder(args); // ... same as now ... await builder.AddApplicationAsync<LitmusIdentityServerModule>(); var app = builder.Build(); await app.InitializeApplicationAsync(); await app.RunAsync(); return 0; }The
HttpApi.HostProgram.cshas the same two lines, change it there as well. TheStartup.csfiles aren't used by theseProgram.csat all, you can delete them.Thanks
Markdown supported.Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post) -
0
Hi @mliming,
Thanks for quick response. I will implement and will confirm if its resolve our issue.
Thanks
Markdown supported.Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post) -
0
Hi @maliming,
Now I am getting following error. I have tried updating docker to copy wwwroot to the published location but still getting same error
2026-09-07T16:54:28.546+05:30 Info: Started envsubst process to render configuration files. 2026-09-07T16:54:28.795+05:30 Info: Rendering templates/appsettings.json.tmpl file. 2026-09-07T16:54:28.844+05:30 sh: PROJECT=product: unknown operand 2026-09-07T16:54:28.904+05:30 sh: AWS_DEFAULT_REGION=ap-southeast-1: unknown operand 2026-09-07T16:54:29.184+05:30 sh: AUTHAPIRESOURCE=Litmus: unknown operand 2026-09-07T16:54:29.243+05:30 sh: TENANTID=73105f70-6d76-46a7-a8b4-23a128bd768c: unknown operand 2026-09-07T16:54:29.399+05:30 Info: All templates files rendered successfully. 2026-09-07T16:54:29.399+05:30 Starting app service. 2026-09-07T16:54:29.948+05:30 Unhandled exception. Volo.Abp.AbpInitializationException: An error occurred during ConfigureServicesAsync phase of the module Volo.Abp.AspNetCore.AbpAspNetCoreModule, Volo.Abp.AspNetCore, Version=10.6.0.0, Culture=neutral, PublicKeyToken=null. See the inner exception for details. 2026-09-07T16:54:29.948+05:30 ---> System.IO.DirectoryNotFoundException: /src/SCV.Litmus/aspnet-core/microservices/SCV.Litmus.IdentityServer/wwwroot/ 2026-09-07T16:54:29.948+05:30 at Microsoft.Extensions.FileProviders.PhysicalFileProvider..ctor(String root, ExclusionFilters filters) 2026-09-07T16:54:29.948+05:30 at Microsoft.AspNetCore.Hosting.StaticWebAssets.StaticWebAssetsLoader.<>c.<UseStaticWebAssetsCore>b__1_0(String contentRoot) 2026-09-07T16:54:29.948+05:30 at Microsoft.AspNetCore.StaticWebAssets.ManifestStaticWebAssetFileProvider..ctor(StaticWebAssetManifest manifest, Func2 fileProviderFactory) 2026-09-07T16:54:29.948+05:30 at Microsoft.AspNetCore.Hosting.StaticWebAssets.StaticWebAssetsLoader.UseStaticWebAssetsCore(IWebHostEnvironment environment, Stream manifest) 2026-09-07T16:54:29.948+05:30 at Microsoft.AspNetCore.Hosting.StaticWebAssets.StaticWebAssetsLoader.UseStaticWebAssets(IWebHostEnvironment environment, IConfiguration configuration) 2026-09-07T16:54:29.948+05:30 at Volo.Abp.AspNetCore.AbpAspNetCoreModule.ConfigureServices(ServiceConfigurationContext context) 2026-09-07T16:54:29.948+05:30 at Volo.Abp.Modularity.AbpModule.ConfigureServicesAsync(ServiceConfigurationContext context) 2026-09-07T16:54:29.948+05:30 at Volo.Abp.AbpApplicationBase.ConfigureServicesAsync() 2026-09-07T16:54:29.948+05:30 --- End of inner exception stack trace --- 2026-09-07T16:54:29.948+05:30 at Volo.Abp.AbpApplicationBase.ConfigureServicesAsync() 2026-09-07T16:54:29.948+05:30 at Volo.Abp.AbpApplicationFactory.CreateAsync[TStartupModule](IServiceCollection services, Action1 optionsAction) 2026-09-07T16:54:29.948+05:30 at Microsoft.Extensions.DependencyInjection.ServiceCollectionApplicationExtensions.AddApplicationAsync[TStartupModule](IServiceCollection services, Action1 optionsAction) 2026-09-07T16:54:29.948+05:30 at Microsoft.Extensions.DependencyInjection.WebApplicationBuilderExtensions.AddApplicationAsync[TStartupModule](WebApplicationBuilder builder, Action1 optionsAction) 2026-09-07T16:54:29.948+05:30 at SCV.Litmus.Program.Main(String[] args) in /src/SCV.Litmus/aspnet-core/microservices/SCV.Litmus.IdentityServer/Program.cs:line 49 2026-09-07T16:54:29.948+05:30 at SCV.Litmus.Program.<Main>(String[] args) 2026-09-07T16:54:30.100+05:30 Aborted (core dumped)Markdown supported.Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post) -
0
Hi,
Keep the
Program.cschange. This one is the Dockerfile: it packages thedotnet buildoutput, which includesSCV.Litmus.IdentityServer.staticwebassets.runtime.json. Switch it to thedotnet publishoutput, that file isn't part of it.The gateway image needs the same change.
Thanks
Markdown supported.Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post) -
0
Hi ABP team,
Is it possible that we could get over a short call, as we 're running short of time and we have critical deliveries dependent on this upgrade we did?
We're facing issues logging into the application post ABP IO upgrade. And I see some of your suggestions are helping but itsn;t fast enough for us to do it over support tickets and meet our deadlines.
Just sharing a summary of .NET and Angular upgrades we did here. UPGRADE_COMPLETION_REPORT.md
ANGULAR-22-ABP-10.6-UPGRADE-COMPLETE-SUMMARY.md
Pls review them and let us know when can we connect today? Thanks!
Markdown supported.Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post) -
0
Hi,
Please share the details below before the call. Without them I'd still be working through the same things during the meeting.
Two changes came out of this thread last week, both for the identity service:
Program.cs: awaitAddApplicationAsyncandInitializeApplicationAsync, with an asyncMain. Yaduraj applied this one.- Dockerfile: package the
dotnet publishoutput rather than thedotnet buildoutput. No result reported on this one yet.
Where does each stand now? Then, from the build that's running, search the identity task's startup log for this line:
Initialized all ABP modules.If it's there, the ABP pipeline is up and the login problem is elsewhere. If it isn't, the app still isn't initializing, and the lines around it tell me why. Send me that part of the log, unfiltered.
Also:
- From inside the container, the response of
/.well-known/openid-configurationand/connect/token, status code and body - What "can't log in" looks like exactly: which step it stops at, and what the browser network tab shows for the failing request
Thanks
Markdown supported.Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post) -
0
Hi @maliming
We have done above changes, and Identity Server is working fine. We are able to generate token and openid-configuration is working fine too.
Now the problem is
application-configurationis not returning an authenticated current User.currentUser : {isAuthenticated: falseThis is always false even if login credentials are correct. Let me quickly check the task's startup log and share with you.Thanks
Markdown supported.Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post) -
0
Hi,
Good to hear the identity service is up.
In ABP,
currentUser.isAuthenticatedisId.HasValue, sofalseonly tells us the API ended up with no claim matchingAbpClaimTypes.UserIdon the principal. That covers two different things: the token not being accepted at all, or the token being fine while the user id claim sits under a different claim type than the API expects.To tell those apart, send me:
- The authentication setup of the API host, the body of your
ConfigureAuthenticationSetup.ConfigureAuthentication - A complete access token that produces this. If you'd rather not put it in the thread, send it to liming.ma@volosoft.com
- The API host's debug log and its
identitymodellog, both for oneapplication-configurationcall made with that token
Both logs are described here: https://abp.io/support/questions/8622/How-to-enable-Debug-logs-for-troubleshoot-problems
The
identitymodelone is what shows why a token gets refused. In the API host'sProgram.cs:using System.Diagnostics.Tracing; using Microsoft.IdentityModel.Logging; IdentityModelEventSource.ShowPII = true; IdentityModelEventSource.Logger.LogLevel = EventLevel.Verbose; var wilsonTextLogger = new TextWriterEventListener("Logs/identitymodel.txt"); wilsonTextLogger.EnableEvents(IdentityModelEventSource.Logger, EventLevel.Verbose);Thanks
Markdown supported.Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post) - The authentication setup of the API host, the body of your
-
0
Here are the logs from Identity and Gateway projects:
Identity API:
identitymodel-identity.txt
Gateway API:
identitymodel-gateway.txt
On the email, I'm sending you a copy of the Application and Network tab contents.
thanks!
Markdown supported.Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post) -
0
Hi,
Thanks for the logs, they pinned it down. The gateway reads the discovery document over https, but the
jwks_uriinside it ishttp://api-product.dev.tasconnect.net/.well-known/jwks, and port 80 refuses the connection. With no keys the gateway has no configuration to validate against, which is theIDX10204you see, and the request ends up anonymous.OpenIddict builds the endpoint URLs of that document from the scheme of the incoming request, and the identity task receives plain HTTP once the gateway terminates TLS.
SetIssueronly fixes theissuerfield, not those URLs.In the identity host, right after
app.UseForwardedHeaders()and beforeapp.UseAuthentication():app.Use(async (context, next) => { if (context.Request.Path.StartsWithSegments("/.well-known")) { context.RequestServices .GetRequiredService<ILogger<LitmusIdentityServerModule>>() .LogWarning("Scheme: {Scheme}, Host: {Host}, X-Forwarded-Proto: {Proto}, X-Forwarded-Host: {ForwardedHost}", context.Request.Scheme, context.Request.Host.Value, context.Request.Headers["X-Forwarded-Proto"].ToString(), context.Request.Headers["X-Forwarded-Host"].ToString()); } context.Request.Scheme = "https"; await next(); });Once it's deployed,
https://api-product.dev.tasconnect.net/.well-known/openid-configurationshould listjwks_uriwithhttps.If it still fails, send the new
identitymodellogs from both projects together with thoseScheme/X-Forwarded-Protolines. They tell us what the gateway really forwards, and we go from there.Thanks
Markdown supported.Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post) -
0
Hi,
Thanks for the latest file. Two things, otherwise the scheme change alone won't get you there.
The access token carries no
audclaim, while the gateway setsoptions.AudiencefromAuthServer:ApiResource. Audience validation will reject it as soon as the signing keys are reachable again.To confirm that quickly, turn the check off for now in the JwtBearer scheme:
options.TokenValidationParameters.ValidateAudience = false;If login works with that, the missing
audis what's left. The real fix is on the AuthServer side: ABP fillsaudfrom the resources attached to the granted scopes, so the rows inOpenIddictScopescurrently have none. The OpenIddict tables do matter here, contrary to what I said earlier.select "Name", "Resources" from "OpenIddictScopes";Resourcesof theLitmusscope has to contain the API resource name, the way the seeder creates it:await _scopeManager.CreateAsync(new OpenIddictScopeDescriptor { Name = "Litmus", DisplayName = "Litmus API", Resources = { "Litmus" } });Also take
options.MapInboundClaims = falseback out. On the API side ABP reads the user id throughAbpClaimTypes.UserId, and that staysClaimTypes.NameIdentifierunless an OpenIddict module runs in the same process, which your gateway doesn't have. The default mapping is what turnssubinto that claim, so switching it off leavescurrentUserempty.AddAbpJwtBearerkeeps the default for this reason, and it also explains whyFindFirst("sub")in your new logging comes back null.Thanks
Markdown supported.Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post) -
0
Thanks @maliming,
We will update the code and will share the outcome soon.
Markdown supported.Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post) -
0
Hi,
Both. They aren't alternatives, each one fixes a different project, in this order:
- Identity host, from https://abp.io/support/questions/10870#answer-3a23a2b0-aad3-9c4a-1b74-7106468c25bb : add the middleware that sets
context.Request.Scheme = "https", afterapp.UseForwardedHeaders()and beforeapp.UseAuthentication(). Once deployed,jwks_uriin/.well-known/openid-configurationhas to start withhttps. - Gateway, from https://abp.io/support/questions/10870#answer-3a23a2c1-65ae-2cd5-f4cd-b434774cfa2d : remove
options.MapInboundClaims = false, and for now setoptions.TokenValidationParameters.ValidateAudience = false. - Log in again and look at
currentUserinapplication-configuration.
If
isAuthenticatedistrueafter that, add the missing resources toOpenIddictScopesas described in the second reply, then turn audience validation back on. If it's stillfalse, send the newidentitymodellogs from both projects.Yaduraj said on Friday he was updating the code, so part of this may already be in place on his side.
Thanks
Markdown supported.Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post) - Identity host, from https://abp.io/support/questions/10870#answer-3a23a2b0-aad3-9c4a-1b74-7106468c25bb : add the middleware that sets
-
0
[maliming] said: TokenValidationParameters
thank you. Yaduraj is on a leave this week and the changes are not yet implemented. I just did and waiting for deployment. I'll update you soon. thank you!
Markdown supported.Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post) -
0
[maliming] said: ok : )
Sorry for the delayed response. After including changes as suggested, I still face the same issue.
Do let me know: apart from the identitymodel logs, is there anything else you would like me to share? I could do it over email. Also, let me know if we could connect over a short call I can walk you through the code and changes we have made so far. Thank you!
Markdown supported.Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)