Add UseJwtTokenMiddleware

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

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

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

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

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

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

Loading…
Cancel
Save