{"record":{"id":"95b1fc9d62481f1c","repo":"OrchardCMS/OrchardCore","slug":"the-application-details-cannot-be-found","errorCode":null,"errorMessage":"The application details cannot be found.","messagePattern":"The application details cannot be found\\.","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"src/OrchardCore.Modules/OrchardCore.OpenId/Controllers/AccessController.cs","lineNumber":117,"sourceCode":"\n            // To avoid endless login endpoint -> authorization endpoint redirects, a special temp data entry is\n            // used to skip the challenge if the user agent has already been redirected to the login endpoint.\n            //\n            // Note: this flag doesn't guarantee that the user has accepted to re-authenticate. If such a guarantee\n            // is needed, the existing authentication cookie MUST be deleted AND revoked (e.g using ASP.NET Core\n            // Identity's security stamp feature with an extremely short revalidation time span) before triggering\n            // a challenge to redirect the user agent to the login endpoint.\n            TempData[\"IgnoreAuthenticationChallenge\"] = true;\n\n            return Challenge(new AuthenticationProperties\n            {\n                RedirectUri = Request.PathBase + Request.Path + QueryString.Create(\n                    Request.HasFormContentType ? Request.Form : Request.Query),\n            });\n        }\n\n        var application = await _applicationManager.FindByClientIdAsync(request.ClientId) ??\n            throw new InvalidOperationException(\"The application details cannot be found.\");\n\n        var authorizations = await _authorizationManager.FindAsync(\n            subject: result.Principal.GetUserIdentifier(),\n            client: await _applicationManager.GetIdAsync(application),\n            status: Statuses.Valid,\n            type: AuthorizationTypes.Permanent,\n            scopes: request.GetScopes()).ToListAsync();\n\n        switch (await _applicationManager.GetConsentTypeAsync(application))\n        {\n            case ConsentTypes.External when authorizations.Count == 0:\n                return Forbid(new AuthenticationProperties(new Dictionary<string, string>\n                {\n                    [OpenIddictServerAspNetCoreConstants.Properties.Error] = Errors.ConsentRequired,\n                    [OpenIddictServerAspNetCoreConstants.Properties.ErrorDescription] =\n                        \"The logged in user is not allowed to access this client application.\",\n                }), OpenIddictServerAspNetCoreDefaults.AuthenticationScheme);\n","sourceCodeStart":99,"sourceCodeEnd":135,"githubUrl":"https://github.com/OrchardCMS/OrchardCore/blob/4306c0717fe573f6fca1b4955909ddab6a192807/src/OrchardCore.Modules/OrchardCore.OpenId/Controllers/AccessController.cs#L99-L135","documentation":"In AccessController.Authorize, after OpenIddict validates the authorize request, the controller looks up the OpenID application record by the request's client_id via IOpenIdApplicationManager.FindByClientIdAsync. If no application matches, it throws InvalidOperationException('The application details cannot be found.') instead of continuing the authorization flow.","triggerScenarios":"GET/POST to the authorize endpoint with a client_id that has no corresponding registered OpenID application in the current tenant (deleted application, wrong tenant, or a client_id typo).","commonSituations":"Client configured in the app points at the wrong Orchard tenant; the OpenID application was deleted or renamed after the client was deployed; running the same flow on a fresh environment where applications were not recreated (no recipe/migration).","solutions":["Register or re-create the OpenID application in the tenant's admin UI (OpenID Connect > Applications) with the exact client_id the client sends.","Fix the client_id configured in the consuming application to match an existing application record.","Verify you are hitting the correct tenant/host; applications are per-tenant.","Apply the setup recipe or migration that defines the application on the target environment."],"exampleFix":"// before\nclient_id: \"my-app\"\n// after (must equal an existing OpenID application's ClientId in this tenant)\nclient_id: \"orchard-admin-app\"","handlingStrategy":"validation","validationCode":"// Before starting the authorize flow, verify the client_id exists\nvar apps = await adminClient.GetOpenIdApplicationsAsync(tenantUrl);\nbool exists = apps.Any(a => a.ClientId == clientId);\nif (!exists) throw new InvalidOperationException($\"Client '{clientId}' is not registered.\");","typeGuard":"bool ClientExists(string clientId, IEnumerable<OpenIdAppSummary> apps) =>\n    !string.IsNullOrWhiteSpace(clientId) && apps?.Any(a => a.ClientId == clientId) == true;","tryCatchPattern":"try\n{\n    return await AuthorizeAsync(clientId);\n}\ncatch (InvalidOperationException ex) when (ex.Message.Contains(\"application details cannot be found\"))\n{\n    logger.LogError(ex, \"Unknown client_id {ClientId}\", clientId);\n    return BadRequest(\"Unknown client_id.\");\n}","preventionTips":["Keep client registrations in setup recipes so all environments have them.","Align client_id in client config with the Orchard OpenID application record via shared configuration.","Re-check registrations after deleting/renaming applications in admin."],"tags":["openid","oauth","client-id","not-found"],"backgroundTag":"entity-not-found","analyzedSha":"4306c0717fe573f6fca1b4955909ddab6a192807","analyzedAt":"2026-09-13T17:41:05.024Z","contentChangedAt":"2026-09-13T17:41:05.024Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}