Files
server/bitwarden_license/test/Sso.IntegrationTest/Endpoints/SsoConfigurationTests.cs
renovate[bot] 783fd5ad9e [deps] Auth: Update Duende.IdentityServer to 7.4.6 (#6323)
* [deps] Auth: Update Duende.IdentityServer to 7.4.6
* fix: address test changes required to complete the update
* feat: move Discovery Generateion to CoreHelpers.cs
* test: add SSO discovery document tests

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Ike Kottlowski <ikottlowski@bitwarden.com>
Co-authored-by: Ike <137194738+ike-kottlowski@users.noreply.github.com>
2026-03-23 10:00:06 -04:00

36 lines
1.3 KiB
C#

using System.Text.Json;
using Bit.IntegrationTestCommon.Factories;
using Bit.Sso.IntegrationTest.Utilities;
using Bit.Test.Common.Helpers;
using Xunit;
namespace Bit.Sso.IntegrationTest.Endpoints;
public class SsoConfigurationTests : IClassFixture<SsoApplicationFactory>
{
private readonly SsoApplicationFactory _factory;
public SsoConfigurationTests(SsoApplicationFactory factory)
{
_factory = factory;
}
[Fact]
public async Task WellKnownEndpoint_Success()
{
var context = await _factory.Server.GetAsync("/.well-known/openid-configuration");
using var body = await AssertHelper.AssertResponseTypeIs<JsonDocument>(context);
var endpointRoot = body.RootElement;
// WARNING: Edits to this file should NOT just be made to "get the test to work" they should be made when intentional
// changes were made to this endpoint and proper testing will take place to ensure clients are backwards compatible
// or loss of functionality is properly noted.
await using var fs = File.OpenRead("openid-configuration.json");
using var knownConfiguration = await JsonSerializer.DeserializeAsync<JsonDocument>(fs);
var knownConfigurationRoot = knownConfiguration!.RootElement;
AssertHelper.AssertEqualJson(endpointRoot, knownConfigurationRoot);
}
}