diff --git a/TokenGenerator/Services/AuthorizationBearer.cs b/TokenGenerator/Services/AuthorizationBearer.cs index 59931b1..ca06a4b 100644 --- a/TokenGenerator/Services/AuthorizationBearer.cs +++ b/TokenGenerator/Services/AuthorizationBearer.cs @@ -22,9 +22,7 @@ public class AuthorizationBearer : IAuthorizationBearer { private readonly Settings settings; private readonly object cmLockMaskinporten = new object(); - private readonly object cmLockMaskinportenAux = new object(); private ConfigurationManager configurationManager; - private ConfigurationManager configurationManagerAux; private readonly HttpContext httpContext; private ConfigurationManager ConfigurationManager @@ -44,23 +42,6 @@ private ConfigurationManager ConfigurationManager } } - private ConfigurationManager ConfigurationManagerAux - { - get - { - if (configurationManagerAux != null) return configurationManagerAux; - lock (cmLockMaskinportenAux) - { - configurationManagerAux ??= new ConfigurationManager( - settings.TokenAuxiliaryAuthorizationWellKnownEndpoint, - new OpenIdConnectConfigurationRetriever(), - new HttpClient {Timeout = TimeSpan.FromMilliseconds(10000)}); - } - - return configurationManagerAux; - } - } - public AuthorizationBearer(IOptions settings, IHttpContextAccessor contextAccessor) { this.settings = settings.Value; @@ -83,11 +64,6 @@ public async Task IsAuthorized(string authorizationString, string OpenIdConnectConfiguration configuration = await ConfigurationManager.GetConfigurationAsync(); var signingKeys = new List(); signingKeys.AddRange(configuration.SigningKeys); - if (settings.TokenAuxiliaryAuthorizationWellKnownEndpoint != null) - { - OpenIdConnectConfiguration configurationAux = await ConfigurationManagerAux.GetConfigurationAsync(); - signingKeys.AddRange(configurationAux.SigningKeys); - } TokenValidationParameters parameters = new TokenValidationParameters() { diff --git a/TokenGenerator/Settings.cs b/TokenGenerator/Settings.cs index 817023d..0ed9d74 100644 --- a/TokenGenerator/Settings.cs +++ b/TokenGenerator/Settings.cs @@ -21,8 +21,6 @@ public class Settings public string AuthorizedScopePersonal { get; set; } public string AuthorizedScopePlatform { get; set; } public string TokenAuthorizationWellKnownEndpoint { get; set; } - - public string TokenAuxiliaryAuthorizationWellKnownEndpoint { get; set; } public string EnvironmentsApiToken { get; set; } public string EnvironmentsConsentToken { get; set; } public Dictionary EnvironmentsApiTokenDict => GetKeyValuePairs(EnvironmentsApiToken); diff --git a/TokenGenerator/local.settings.json.COPYME b/TokenGenerator/local.settings.json.COPYME index fbd5d85..a664b4f 100644 --- a/TokenGenerator/local.settings.json.COPYME +++ b/TokenGenerator/local.settings.json.COPYME @@ -17,7 +17,6 @@ "ConsentTokenSigningCertNames": "dev:altinn-testtools-consent-token-signing-cert", "EnvironmentsApiToken": "dev:altinn-testtools-kv", "EnvironmentsConsentToken": "dev:altinn-testtools-kv", - "TokenAuthorizationWellKnownEndpoint": "https://test.maskinporten.no/.well-known/oauth-authorization-server", - "TokenAuxiliaryAuthorizationWellKnownEndpoint": "https://ver2.maskinporten.no/.well-known/oauth-authorization-server" + "TokenAuthorizationWellKnownEndpoint": "https://test.maskinporten.no/.well-known/oauth-authorization-server" } }