That's great. This worked on Azure too. Thank you. Have a good weekend.
Thanks. That works locally. Let me try in Azure as well. I will let you know if that fails.
Yes
I have applied it however, there is no progress. It is still working only for the host tenant regardless of the subdomain. Could you provide me a working sample for the separated authserver ? I want to see how ....HttpApiHostModule.cs is implemented in this regards
How can I find and override the file? It is not in my project file (framework/src/Volo.Abp.Swashbuckle/Microsoft/Extensions/DependencyInjection/AbpSwaggerGenServiceCollectionExtensions.cs)
Thanks for your answer. However, I have already implemented this solution before reopening this ticket. The issue is if I use any of the below format for AuthServer:Authority
https://{0}.authserver.mystore.dev https://{{tenantName}}.authserver.mystore.dev https://{{tenantId}}.authserver.mystore.dev
Everything works for Angular + Host API + Separated Auth Server with a subdomain, except Swagger. **context.Services.AddAbpSwaggerGenWithOAuth has failed. ** How can I resolve the parsing URI issue?
Volo.Abp.AbpInitializationException: An error occurred during ConfigureServicesAsync phase of the module ImmoProv.ImmoProvHttpApiHostModule, ImmoProv.HttpApi.Host, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null. See the inner exception for details.
---> System.UriFormatException: Invalid URI: The hostname could not be parsed.
at System.Uri.CreateThis(String uri, Boolean dontEscape, UriKind uriKind, UriCreationOptions& creationOptions)
at System.Uri..ctor(String uriString)
at Microsoft.Extensions.DependencyInjection.AbpSwaggerGenServiceCollectionExtensions.AddAbpSwaggerGenWithOAuth(IServiceCollection services, String authority, Dictionary2 scopes, Action
1 setupAction, String authorizationEndpoint, String tokenEndpoint)
at ImmoProv.ImmoProvHttpApiHostModule.ConfigureSwagger(ServiceConfigurationContext context, IConfiguration configuration) in C:\Projects\ImmoProv\aspnet-core\src\ImmoProv.HttpApi.Host\ImmoProvHttpApiHostModule.cs:line 288
at ImmoProv.ImmoProvHttpApiHostModule.ConfigureServices(ServiceConfigurationContext context) in C:\Projects\ImmoProv\aspnet-core\src\ImmoProv.HttpApi.Host\ImmoProvHttpApiHostModule.cs:line 118
at Volo.Abp.Modularity.AbpModule.ConfigureServicesAsync(ServiceConfigurationContext context)
at Volo.Abp.AbpApplicationBase.ConfigureServicesAsync()
--- End of inner exception stack trace ---
at Volo.Abp.AbpApplicationBase.ConfigureServicesAsync()
at Volo.Abp.AbpApplicationFactory.CreateAsync[TStartupModule](IServiceCollection services, Action1 optionsAction) at Microsoft.Extensions.DependencyInjection.ServiceCollectionApplicationExtensions.AddApplicationAsync[TStartupModule](IServiceCollection services, Action
1 optionsAction)
at Microsoft.Extensions.DependencyInjection.WebApplicationBuilderExtensions.AddApplicationAsync[TStartupModule](WebApplicationBuilder builder, Action`1 optionsAction)
at ImmoProv.Program.Main(String[] args) in C:\Projects\ImmoProv\aspnet-core\src\ImmoProv.HttpApi.Host\Program.cs:line 49
Thanks for your answer. However, I have already implemented this solution before reopening this ticket. The issue is if I use any of the below format for AuthServer:Authority
https://{0}.authserver.mystore.dev https://{{tenantName}}.authserver.mystore.dev https://{{tenantId}}.authserver.mystore.dev
Everything works for Angular + Host API + Separated Auth Server with a subdomain, except Swagger. **context.Services.AddAbpSwaggerGenWithOAuth has failed. ** How can I resolve the parsing URI issue?
Volo.Abp.AbpInitializationException: An error occurred during ConfigureServicesAsync phase of the module ImmoProv.ImmoProvHttpApiHostModule, ImmoProv.HttpApi.Host, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null. See the inner exception for details.
---> System.UriFormatException: Invalid URI: The hostname could not be parsed.
at System.Uri.CreateThis(String uri, Boolean dontEscape, UriKind uriKind, UriCreationOptions& creationOptions)
at System.Uri..ctor(String uriString)
at Microsoft.Extensions.DependencyInjection.AbpSwaggerGenServiceCollectionExtensions.AddAbpSwaggerGenWithOAuth(IServiceCollection services, String authority, Dictionary2 scopes, Action
1 setupAction, String authorizationEndpoint, String tokenEndpoint)
at ImmoProv.ImmoProvHttpApiHostModule.ConfigureSwagger(ServiceConfigurationContext context, IConfiguration configuration) in C:\Projects\ImmoProv\aspnet-core\src\ImmoProv.HttpApi.Host\ImmoProvHttpApiHostModule.cs:line 288
at ImmoProv.ImmoProvHttpApiHostModule.ConfigureServices(ServiceConfigurationContext context) in C:\Projects\ImmoProv\aspnet-core\src\ImmoProv.HttpApi.Host\ImmoProvHttpApiHostModule.cs:line 118
at Volo.Abp.Modularity.AbpModule.ConfigureServicesAsync(ServiceConfigurationContext context)
at Volo.Abp.AbpApplicationBase.ConfigureServicesAsync()
--- End of inner exception stack trace ---
at Volo.Abp.AbpApplicationBase.ConfigureServicesAsync()
at Volo.Abp.AbpApplicationFactory.CreateAsync[TStartupModule](IServiceCollection services, Action1 optionsAction) at Microsoft.Extensions.DependencyInjection.ServiceCollectionApplicationExtensions.AddApplicationAsync[TStartupModule](IServiceCollection services, Action
1 optionsAction)
at Microsoft.Extensions.DependencyInjection.WebApplicationBuilderExtensions.AddApplicationAsync[TStartupModule](WebApplicationBuilder builder, Action`1 optionsAction)
at ImmoProv.Program.Main(String[] args) in C:\Projects\ImmoProv\aspnet-core\src\ImmoProv.HttpApi.Host\Program.cs:line 49
$"authority.TrimEnd('/')}{authorizationEndpoint.EnsureStartswith('/')}
Respectively authorization URL and token Url as follows;
http://{0}.authserver.immoprov.local:44319/connect/authorize
http://{0}.authserver.immoprov.local:44319/connect/token