diff --git a/gateway/src/test/java/org/georchestra/gateway/security/ldap/extended/ExtendedLdapAuthenticationIT.java b/gateway/src/test/java/org/georchestra/gateway/security/ldap/extended/ExtendedLdapAuthenticationIT.java index 417c69f0..cdd5615e 100644 --- a/gateway/src/test/java/org/georchestra/gateway/security/ldap/extended/ExtendedLdapAuthenticationIT.java +++ b/gateway/src/test/java/org/georchestra/gateway/security/ldap/extended/ExtendedLdapAuthenticationIT.java @@ -56,6 +56,16 @@ static void registerLdap(DynamicPropertyRegistry registry) { .jsonPath("$.GeorchestraUser.username").isEqualTo("testadmin"); } + public @Test void testWhoamiUsingEmail() { + testClient.get().uri("/whoami")// + .header("Authorization", "Basic cHNjK3Rlc3RhZG1pbkBnZW9yY2hlc3RyYS5vcmc6dGVzdGFkbWlu") // psc+testadmin@georchestra.org:testadmin + .exchange()// + .expectStatus()// + .is2xxSuccessful()// + .expectBody()// + .jsonPath("$.GeorchestraUser.username").isEqualTo("testadmin"); + } + public @Test void testWhoamiNoPasswordRevealed() { testClient.get().uri("/whoami")// .header("Authorization", "Basic dGVzdGFkbWluOnRlc3RhZG1pbg==") // testadmin:testadmin