Add UseJwtTokenMiddleware

pull/1561/head
Halil İbrahim Kalkan 6 years ago
parent 87090fe970
commit a15b608368

@ -2,7 +2,7 @@ export const environment = {
production: false, production: false,
hmr: true, hmr: true,
oAuthConfig: { oAuthConfig: {
issuer: 'https://localhost:44301', issuer: 'https://localhost:44305',
clientId: 'MyProjectName_ConsoleTestApp', clientId: 'MyProjectName_ConsoleTestApp',
dummyClientSecret: '1q2w3e*', dummyClientSecret: '1q2w3e*',
scope: 'MyProjectName', scope: 'MyProjectName',
@ -12,7 +12,7 @@ export const environment = {
}, },
apis: { apis: {
default: { default: {
url: 'https://localhost:44300', url: 'https://localhost:44305',
}, },
}, },
localization: { localization: {

@ -2,7 +2,7 @@ export const environment = {
production: true, production: true,
hmr: false, hmr: false,
oAuthConfig: { oAuthConfig: {
issuer: 'https://localhost:44301', issuer: 'https://localhost:44305',
clientId: 'MyProjectName_ConsoleTestApp', clientId: 'MyProjectName_ConsoleTestApp',
dummyClientSecret: '1q2w3e*', dummyClientSecret: '1q2w3e*',
scope: 'MyProjectName', scope: 'MyProjectName',
@ -12,7 +12,7 @@ export const environment = {
}, },
apis: { apis: {
default: { default: {
url: 'https://localhost:44300', url: 'https://localhost:44305',
}, },
}, },
localization: { localization: {

@ -2,7 +2,7 @@ export const environment = {
production: false, production: false,
hmr: false, hmr: false,
oAuthConfig: { oAuthConfig: {
issuer: 'https://localhost:44301', issuer: 'https://localhost:44305',
clientId: 'MyProjectName_ConsoleTestApp', clientId: 'MyProjectName_ConsoleTestApp',
dummyClientSecret: '1q2w3e*', dummyClientSecret: '1q2w3e*',
scope: 'MyProjectName', scope: 'MyProjectName',
@ -12,7 +12,7 @@ export const environment = {
}, },
apis: { apis: {
default: { default: {
url: 'https://localhost:44300', url: 'https://localhost:44305',
}, },
}, },
localization: { localization: {

@ -18,6 +18,7 @@ using Volo.Abp.AspNetCore.Mvc;
using Volo.Abp.Autofac; using Volo.Abp.Autofac;
using Volo.Abp.Localization; using Volo.Abp.Localization;
using Volo.Abp.Modularity; using Volo.Abp.Modularity;
using Volo.Abp.UI.Navigation.Urls;
using Volo.Abp.VirtualFileSystem; using Volo.Abp.VirtualFileSystem;
namespace MyCompanyName.MyProjectName namespace MyCompanyName.MyProjectName
@ -41,6 +42,7 @@ namespace MyCompanyName.MyProjectName
var configuration = context.Services.GetConfiguration(); var configuration = context.Services.GetConfiguration();
var hostingEnvironment = context.Services.GetHostingEnvironment(); var hostingEnvironment = context.Services.GetHostingEnvironment();
ConfigureUrls(configuration);
ConfigureConventionalControllers(); ConfigureConventionalControllers();
ConfigureAuthentication(context, configuration); ConfigureAuthentication(context, configuration);
ConfigureSwagger(context); ConfigureSwagger(context);
@ -49,6 +51,14 @@ namespace MyCompanyName.MyProjectName
ConfigureCors(context, configuration); ConfigureCors(context, configuration);
} }
private void ConfigureUrls(IConfigurationRoot configuration)
{
Configure<AppUrlOptions>(options =>
{
options.Applications["MVC"].RootUrl = configuration["App:SelfUrl"];
});
}
private void ConfigureVirtualFileSystem(ServiceConfigurationContext context) private void ConfigureVirtualFileSystem(ServiceConfigurationContext context)
{ {
var hostingEnvironment = context.Services.GetHostingEnvironment(); var hostingEnvironment = context.Services.GetHostingEnvironment();
@ -135,10 +145,13 @@ namespace MyCompanyName.MyProjectName
app.UseVirtualFiles(); app.UseVirtualFiles();
app.UseAuthentication(); app.UseAuthentication();
app.UseJwtTokenMiddleware();
if (MultiTenancyConsts.IsEnabled) if (MultiTenancyConsts.IsEnabled)
{ {
app.UseMultiTenancy(); app.UseMultiTenancy();
} }
app.UseIdentityServer(); app.UseIdentityServer();
app.UseAbpRequestLocalization(); app.UseAbpRequestLocalization();
app.UseSwagger(); app.UseSwagger();

@ -1,5 +1,6 @@
{ {
"App": { "App": {
"SelfUrl": "https://localhost:44305",
"CorsOrigins": "https://*.MyProjectName.com,http://localhost:4200" "CorsOrigins": "https://*.MyProjectName.com,http://localhost:4200"
}, },
"ConnectionStrings": { "ConnectionStrings": {
@ -9,6 +10,6 @@
"Configuration": "127.0.0.1" "Configuration": "127.0.0.1"
}, },
"AuthServer": { "AuthServer": {
"Authority": "https://localhost:44301" "Authority": "https://localhost:44305"
} }
} }

Loading…
Cancel
Save