Yeah but I am using remote iOS simulator on my mac and the backend app is running on my windows so is the Maui project so to see it I have used pair to Mac and need the Mac to be able to browse to the back end so easiest way was to use ngrok and modify the handler
I have followed all the documentation and the application successfully runs but when I click on the login button i get the following error
I am even using ngrok so the backend is available on the web
System.InvalidOperationException Message=Error loading discovery document: Error connecting to https://<omited>.au.ngrok.io/.well-known/openid-configuration. An error occurred while sending the request..
When i go to that URL in browser I do get a response with off the openid-configuration
Message=Error loading discovery document: Error connecting to https://localhost:44330/.well-known/openid-configuration. Failed to connect to localhost/127.0.0.1:44330.
appsetting.json
in Maui project
{
"Oidc": {
"Options": {
"Authority": "https://localhost:44330",
"ClientId": "Mobile_Maui",
"RedirectUri": "mobile://",
"PostLogoutRedirectUri": "mobile://",
"Scope": "offline_access Mobile"
}
},
"RemoteServices": {
"Default": {
"BaseUrl": "https://localhost:44330"
}
}
}
appsettings.json in Web project
{
"App": {
"SelfUrl": "https://localhost:44381"
},
"Redis": {
"Configuration": "127.0.0.1"
},
"ConnectionStrings": {
"Default": "Server=localhost;Database=AmazingSoftwareMobile;Trusted_Connection=True"
},
"AuthServer": {
"Authority": "https://localhost:44381",
"RequireHttpsMetadata": "false"
},
"StringEncryption": {
"DefaultPassPhrase": "<omitted>"
}
}
even if I change https://localhost:44330 to https://localhost:44381 it doesn't work
Why do i still get a warning [16:35:30 WRN] Couldn't determinate version of "@abp/ng.schematics" package.
?
looks like the generation is fine
These are the errors I am getting in the console
here is the log in debug mode
2022-05-02 10:42:51.038 +00:00 [DBG] Added bundle 'Lepton.Global' to the page in 8.59 ms.
2022-05-02 10:42:51.039 +00:00 [INF] Executed page /Index in 762.1019ms
2022-05-02 10:42:51.039 +00:00 [INF] Executed endpoint '/Index'
2022-05-02 10:42:51.040 +00:00 [INF] Request finished HTTP/1.1 GET http://staging.ppm.desertfireonline.com/ - - - 200 - text/html;+charset=utf-8 851.3424ms
2022-05-02 10:42:59.894 +00:00 [INF] Request starting HTTP/1.1 GET http://dfo-dev-web.azurewebsites.net/.well-known/openid-configuration - -
2022-05-02 10:42:59.916 +00:00 [INF] CORS policy execution successful.
2022-05-02 10:42:59.973 +00:00 [DBG] CORS request made for path: /.well-known/openid-configuration from origin: http://localhost:8100
2022-05-02 10:43:00.831 +00:00 [DBG] CorsPolicyService allowed origin: http://localhost:8100
2022-05-02 10:43:00.832 +00:00 [INF] CORS policy execution successful.
2022-05-02 10:43:00.850 +00:00 [DBG] Request path /.well-known/openid-configuration matched to endpoint type Discovery
2022-05-02 10:43:02.760 +00:00 [DBG] Endpoint enabled: Discovery, successfully created handler: IdentityServer4.Endpoints.DiscoveryEndpoint
2022-05-02 10:43:02.761 +00:00 [INF] Invoking IdentityServer endpoint: IdentityServer4.Endpoints.DiscoveryEndpoint for /.well-known/openid-configuration
2022-05-02 10:43:02.769 +00:00 [DBG] Start discovery request
2022-05-02 10:43:04.085 +00:00 [INF] Request finished HTTP/1.1 GET http://dfo-dev-web.azurewebsites.net/.well-known/openid-configuration - - - 200 - application/json;+charset=UTF-8 4185.0806ms
2022-05-02 10:43:04.144 +00:00 [INF] Request starting HTTP/1.1 GET http://dfo-dev-web.azurewebsites.net/api/abp/application-configuration - -
2022-05-02 10:43:04.145 +00:00 [INF] CORS policy execution successful.
2022-05-02 10:43:04.233 +00:00 [DBG] CORS request made for path: /api/abp/application-configuration from origin: http://localhost:8100 but was ignored because path was not for an allowed IdentityServer CORS endpoint
2022-05-02 10:43:04.233 +00:00 [INF] No CORS policy found for the specified request.
2022-05-02 10:43:04.282 +00:00 [INF] Executing endpoint 'Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.AbpApplicationConfigurationController.GetAsync (Volo.Abp.AspNetCore.Mvc)'
2022-05-02 10:43:04.302 +00:00 [INF] Route matched with {area = "abp", action = "Get", controller = "AbpApplicationConfiguration", page = ""}. Executing controller action with signature System.Threading.Tasks.Task`1[Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ApplicationConfigurationDto] GetAsync() on controller Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.AbpApplicationConfigurationController (Volo.Abp.AspNetCore.Mvc).
2022-05-02 10:43:04.398 +00:00 [DBG] Executing AbpApplicationConfigurationAppService.GetAsync()...
2022-05-02 10:43:06.477 +00:00 [DBG] Executed AbpApplicationConfigurationAppService.GetAsync().
2022-05-02 10:43:06.487 +00:00 [INF] Executing ObjectResult, writing value of type 'Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ApplicationConfigurationDto'.
2022-05-02 10:43:06.644 +00:00 [INF] Executed action Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.AbpApplicationConfigurationController.GetAsync (Volo.Abp.AspNetCore.Mvc) in 2341.717ms
2022-05-02 10:43:06.644 +00:00 [INF] Executed endpoint 'Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.AbpApplicationConfigurationController.GetAsync (Volo.Abp.AspNetCore.Mvc)'
2022-05-02 10:43:06.652 +00:00 [INF] Request finished HTTP/1.1 GET http://dfo-dev-web.azurewebsites.net/api/abp/application-configuration - - - 200 - application/json;+charset=utf-8 2507.7572ms
2022-05-02 10:44:00.151 +00:00 [INF] Request starting HTTP/1.1 GET http://dfo-dev-web.azurewebsites.net/ - -
2022-05-02 10:44:00.228 +00:00 [INF] Executing endpoint '/Index'
2022-05-02 10:44:00.228 +00:00 [INF] Route matched with {page = "/Index", action = "", controller = "", area = ""}. Executing page /Index
2022-05-02 10:44:00.228 +00:00 [INF] Skipping the execution of current filter as its not the most effective filter implementing the policy Microsoft.AspNetCore.Mvc.ViewFeatures.IAntiforgeryPolicy
2022-05-02 10:44:00.236 +00:00 [INF] Executing handler method Volo.Abp.Identity.Web.Pages.Identity.Users.PpmIndexModel.OnGetAsync - ModelState is "Valid"
2022-05-02 10:44:00.236 +00:00 [INF] Executed handler method OnGetAsync, returned result Microsoft.AspNetCore.Mvc.RazorPages.PageResult.
Guys I am trying to run the angular project locally with a production ABP instance which is live and it gives me a cors error …. My cors setting in my appsetting.json includes Localhost … when in production does ABP not accept connections from Localhost ?
looking at the logs my production website says
2022-04-30 12:46:42.118 +00:00 [INF] Executed action Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.AbpApplicationConfigurationController.GetAsync (Volo.Abp.AspNetCore.Mvc) in 566.6566ms
2022-04-30 12:46:42.118 +00:00 [INF] Executed endpoint 'Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.AbpApplicationConfigurationController.GetAsync (Volo.Abp.AspNetCore.Mvc)'
2022-04-30 12:46:42.118 +00:00 [INF] Request finished HTTP/1.1 GET http://dfo-dev-web.azurewebsites.net/api/abp/application-configuration - - - 200 - application/json;+charset=utf-8 626.0485ms
2022-04-30 12:46:42.371 +00:00 [INF] Executing ObjectResult, writing value of type 'Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ApplicationConfigurationDto'.
2022-04-30 12:46:42.390 +00:00 [INF] Executed action Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.AbpApplicationConfigurationController.GetAsync (Volo.Abp.AspNetCore.Mvc) in 397.8441ms
2022-04-30 12:46:42.390 +00:00 [INF] Executed endpoint 'Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.AbpApplicationConfigurationController.GetAsync (Volo.Abp.AspNetCore.Mvc)'
2022-04-30 12:46:42.390 +00:00 [INF] Request finished HTTP/1.1 GET http://dfo-dev-web.azurewebsites.net/api/abp/application-configuration - - - 200 - application/json;+charset=utf-8 456.3726ms
2022-04-30 12:46:56.404 +00:00 [INF] Request starting HTTP/1.1 GET http://dfo-dev-web.azurewebsites.net/.well-known/openid-configuration - -
2022-04-30 12:46:56.404 +00:00 [INF] CORS policy execution successful.
2022-04-30 12:46:56.453 +00:00 [WRN] Origin is not allowed: http://localhost:8100
2022-04-30 12:46:56.453 +00:00 [WRN] CorsPolicyService did not allow origin: http://localhost:8100
2022-04-30 12:46:56.453 +00:00 [INF] No CORS policy found for the specified request.
2022-04-30 12:46:56.483 +00:00 [INF] Invoking IdentityServer endpoint: IdentityServer4.Endpoints.DiscoveryEndpoint for /.well-known/openid-configuration
2022-04-30 12:46:56.501 +00:00 [INF] Request finished HTTP/1.1 GET http://dfo-dev-web.azurewebsites.net/.well-known/openid-configuration - - - 200 - application/json;+charset=UTF-8 97.3644ms
2022-04-30 12:46:56.523 +00:00 [INF] Request starting HTTP/1.1 GET http://dfo-dev-web.azurewebsites.net/api/abp/application-configuration - -
2022-04-30 12:46:56.524 +00:00 [INF] CORS policy execution successful.
2022-04-30 12:46:56.570 +00:00 [INF] No CORS policy found for the specified request.
2022-04-30 12:46:56.581 +00:00 [INF] Executing endpoint 'Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.AbpApplicationConfigurationController.GetAsync (Volo.Abp.AspNetCore.Mvc)'
2022-04-30 12:46:56.581 +00:00 [INF] Route matched with {area = "abp", action = "Get", controller = "AbpApplicationConfiguration", page = ""}. Executing controller action with signature System.Threading.Tasks.Task`1[Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.ApplicationConfigurationDto] GetAsync() on controller Volo.Abp.AspNetCore.Mvc.ApplicationConfigurations.AbpApplicationConfigurationController (Volo.Abp.AspNetCore.Mvc).
or appsettings.json is as follows
{ "App": { "SelfUrl": "https://dfo-dev-web.azurewebsites.net", "ClientUrl": "https://dfo-dev-word.azurewebsites.net", "CorsOrigins": "https://*.dfo-dev-web.azurewebsites.net,https://dfo-dev-word.azurewebsites.net,https://dfo-dev-web.azurewebsites.net,https://dfo-dev-public.azurewebsites.net,http://localhost:4200,http://localhost:8100", "RedirectAllowedUrls": "http://localhost:4200,https://localhost:44307,http://localhost:8100" }, .....
Can you please refund this ticket, i have figured out how to change the Environment at run time using the import { EnvironmentService } from '@abp/ng.core';
in my custom anular app.
Hi i am building an mobile app but i want the user to be able to specify the issuer and api to their instance of ABP ... what is the best way i can do this.
Currently the environment has these specified as const
strings i want to be able to let the user enter their issuer
and api url
store it in json file or local storage and dynamicly change it when calls are made to ABP.