diff --git a/src/Config.cs b/src/Config.cs index 2ff3b56..25e798f 100644 --- a/src/Config.cs +++ b/src/Config.cs @@ -460,8 +460,11 @@ public class Config { EntityId = "https://saml-sp1.example.com", DisplayName = "Simple SAML SP", - AssertionConsumerServiceUrls = [new Uri("https://saml-sp1.example.com/acs")], - AssertionConsumerServiceBinding = SamlBinding.HttpPost, + AssertionConsumerServiceUrls = new List + { + new IndexedEndpoint { Location = "https://saml-sp1.example.com/acs", Binding = SamlBinding.HttpPost, Index = 0, IsDefault = true } + }, + AllowedScopes = { "openid", "profile" }, }, // SP with Single Logout @@ -469,12 +472,14 @@ public class Config { EntityId = "https://saml-sp2.example.com", DisplayName = "SAML SP with SLO", - AssertionConsumerServiceUrls = [new Uri("https://saml-sp2.example.com/acs")], - AssertionConsumerServiceBinding = SamlBinding.HttpPost, - SingleLogoutServiceUrl = new SamlEndpointType + AssertionConsumerServiceUrls = new List + { + new IndexedEndpoint { Location = "https://saml-sp2.example.com/acs", Binding = SamlBinding.HttpPost, Index = 0, IsDefault = true } + }, + AllowedScopes = { "openid", "profile" }, + SingleLogoutServiceUrls = new List { - Location = new Uri("https://saml-sp2.example.com/saml/slo"), - Binding = SamlBinding.HttpPost, + new SamlEndpointType { Location = "https://saml-sp2.example.com/saml/slo", Binding = SamlBinding.HttpPost } }, }, @@ -483,13 +488,15 @@ public class Config { EntityId = "https://saml-sp3.example.com", DisplayName = "SAML SP (IdP-initiated)", - AssertionConsumerServiceUrls = [new Uri("https://saml-sp3.example.com/acs")], - AssertionConsumerServiceBinding = SamlBinding.HttpPost, + AssertionConsumerServiceUrls = new List + { + new IndexedEndpoint { Location = "https://saml-sp3.example.com/acs", Binding = SamlBinding.HttpPost, Index = 0, IsDefault = true } + }, AllowIdpInitiated = true, - SingleLogoutServiceUrl = new SamlEndpointType + AllowedScopes = { "openid", "profile" }, + SingleLogoutServiceUrls = new List { - Location = new Uri("https://saml-sp3.example.com/saml/slo"), - Binding = SamlBinding.HttpPost, + new SamlEndpointType { Location = "https://saml-sp3.example.com/saml/slo", Binding = SamlBinding.HttpPost } }, }, }; diff --git a/src/Duende.IdentityServer.Demo.csproj b/src/Duende.IdentityServer.Demo.csproj index fca703d..018b9f0 100644 --- a/src/Duende.IdentityServer.Demo.csproj +++ b/src/Duende.IdentityServer.Demo.csproj @@ -8,10 +8,10 @@ - - - - + + + + diff --git a/src/HostingExtensions.cs b/src/HostingExtensions.cs index b6465f7..adaced7 100644 --- a/src/HostingExtensions.cs +++ b/src/HostingExtensions.cs @@ -53,8 +53,6 @@ public static WebApplication ConfigureServices(this WebApplicationBuilder builde UseX509Certificate = true }); options.KeyManagement.KeyPath = "/tmp/keys"; - - options.Endpoints.EnableSamlIdpInitiatedEndpoint = true; }) .AddInMemoryApiScopes(Config.ApiScopes) .AddInMemoryIdentityResources(Config.IdentityResources) diff --git a/src/Pages/Account/Create/Index.cshtml.cs b/src/Pages/Account/Create/Index.cshtml.cs index f37cd4c..663ee9d 100644 --- a/src/Pages/Account/Create/Index.cshtml.cs +++ b/src/Pages/Account/Create/Index.cshtml.cs @@ -51,7 +51,7 @@ public async Task OnPost() // if the user cancels, send a result back into IdentityServer as if they // denied the consent (even if this client does not require consent). // this will send back an access denied OIDC error response to the client. - await _interaction.DenyAuthorizationAsync(context, AuthorizationError.AccessDenied, HttpContext.RequestAborted); + await _interaction.DenyAuthorizationAsync(context, InteractionError.AccessDenied, HttpContext.RequestAborted); // we can trust model.ReturnUrl since GetAuthorizationContextAsync returned non-null if (context.IsNativeClient()) diff --git a/src/Pages/Account/Login/Index.cshtml.cs b/src/Pages/Account/Login/Index.cshtml.cs index 60c918f..9cd413b 100644 --- a/src/Pages/Account/Login/Index.cshtml.cs +++ b/src/Pages/Account/Login/Index.cshtml.cs @@ -74,7 +74,7 @@ public async Task OnPost() // if the user cancels, send a result back into IdentityServer as if they // denied the consent (even if this client does not require consent). // this will send back an access denied OIDC error response to the client. - await _interaction.DenyAuthorizationAsync(context, AuthorizationError.AccessDenied, HttpContext.RequestAborted); + await _interaction.DenyAuthorizationAsync(context, InteractionError.AccessDenied, HttpContext.RequestAborted); // we can trust model.ReturnUrl since GetAuthorizationContextAsync returned non-null if (context.IsNativeClient()) diff --git a/src/Pages/Consent/Index.cshtml.cs b/src/Pages/Consent/Index.cshtml.cs index 53efebf..6785816 100644 --- a/src/Pages/Consent/Index.cshtml.cs +++ b/src/Pages/Consent/Index.cshtml.cs @@ -62,7 +62,7 @@ public async Task OnPost() // user clicked 'no' - send back the standard 'access_denied' response if (Input.Button == "no") { - grantedConsent = new ConsentResponse { Error = AuthorizationError.AccessDenied }; + grantedConsent = new ConsentResponse { Error = InteractionError.AccessDenied }; // emit event await _events.RaiseAsync(new ConsentDeniedEvent(User.GetSubjectId(), request.Client.ClientId, request.ValidatedResources.RawScopeValues), HttpContext.RequestAborted); diff --git a/src/Pages/Device/Index.cshtml.cs b/src/Pages/Device/Index.cshtml.cs index e869cf1..f5deab2 100644 --- a/src/Pages/Device/Index.cshtml.cs +++ b/src/Pages/Device/Index.cshtml.cs @@ -73,7 +73,7 @@ public async Task OnPost() { grantedConsent = new ConsentResponse { - Error = AuthorizationError.AccessDenied + Error = InteractionError.AccessDenied }; // emit event diff --git a/src/Pages/Index.cshtml b/src/Pages/Index.cshtml index 206474c..23a4af7 100644 --- a/src/Pages/Index.cshtml +++ b/src/Pages/Index.cshtml @@ -15,7 +15,6 @@
- Duende Software Logo

Welcome to Duende IdentityServer

@@ -72,7 +71,7 @@