Reworked code around signing keys have key details much more isolated from the other parts of the program.
This commit is contained in:
parent
eb872a4f44
commit
0c6f227049
40 changed files with 474 additions and 281 deletions
|
|
@ -44,7 +44,9 @@ public class RealmApisTests : IClassFixture<ApplicationFactory>
|
|||
var client = _factory.CreateClient();
|
||||
|
||||
Guid? inputId = id is null ? (Guid?)null : new Guid(id);
|
||||
var response = await client.PostAsync("/realms", JsonContent.Create(new
|
||||
|
||||
// act
|
||||
var response = await client.PostAsync("/api/v1/realms", JsonContent.Create(new
|
||||
{
|
||||
Id = inputId,
|
||||
Slug = slug,
|
||||
|
|
@ -88,16 +90,21 @@ public class RealmApisTests : IClassFixture<ApplicationFactory>
|
|||
|
||||
// act
|
||||
var client = _factory.CreateClient();
|
||||
var response = await client.GetAsync("/realms/foo/.well-known/openid-configuration",
|
||||
var response = await client.GetAsync("auth/realms/foo/.well-known/openid-configuration",
|
||||
TestContext.Current.CancellationToken);
|
||||
|
||||
// verify
|
||||
#if DEBUG
|
||||
string contents = await response.Content.ReadAsStringAsync(TestContext.Current.CancellationToken);
|
||||
#endif
|
||||
Assert.Equal(HttpStatusCode.OK, response.StatusCode);
|
||||
|
||||
var result = await response.Content.ReadFromJsonAsync<JsonObject>(TestContext.Current.CancellationToken);
|
||||
Assert.NotNull(result);
|
||||
JsonObjectAssert.Equal("http://localhost/realms/foo/openid-connect/auth", result, "authorization_endpoint");
|
||||
JsonObjectAssert.Equal("http://localhost/realms/foo", result, "issuer");
|
||||
JsonObjectAssert.Equal("http://localhost/realms/foo/openid-connect/token", result, "token_endpoint");
|
||||
JsonObjectAssert.Equal("http://localhost/realms/foo/openid-connect/jwks", result, "jwks_uri");
|
||||
JsonObjectAssert.Equal("http://localhost/auth/realms/foo/openid-connect/auth", result, "authorization_endpoint");
|
||||
JsonObjectAssert.Equal("http://localhost/auth/realms/foo", result, "issuer");
|
||||
JsonObjectAssert.Equal("http://localhost/auth/realms/foo/openid-connect/token", result, "token_endpoint");
|
||||
JsonObjectAssert.Equal("http://localhost/auth/realms/foo/openid-connect/jwks", result, "jwks_uri");
|
||||
}
|
||||
|
||||
[Theory]
|
||||
|
|
@ -137,7 +144,7 @@ public class RealmApisTests : IClassFixture<ApplicationFactory>
|
|||
|
||||
// act
|
||||
var client = _factory.CreateClient();
|
||||
var response = await client.GetAsync("/realms/foo/openid-connect/jwks",
|
||||
var response = await client.GetAsync("/auth/realms/foo/openid-connect/jwks",
|
||||
TestContext.Current.CancellationToken);
|
||||
|
||||
Assert.Equal(HttpStatusCode.OK, response.StatusCode);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue