This commit is contained in:
Minecon724 2024-12-08 12:46:31 +01:00
parent 370227497f
commit d08dd3777a
Signed by: Minecon724
GPG key ID: 3CCC4D267742C8E8

View file

@ -27,10 +27,10 @@ public class MyHttpAuthenticationMechanism implements HttpAuthenticationMechanis
@Override @Override
public Uni<SecurityIdentity> authenticate(RoutingContext context, IdentityProviderManager identityProviderManager) { public Uni<SecurityIdentity> authenticate(RoutingContext context, IdentityProviderManager identityProviderManager) {
return Uni.createFrom().item((Supplier<SecurityIdentity>) () -> { return Uni.createFrom().item((Supplier<SecurityIdentity>) () -> {
String serverTokenEncoded = context.request().getHeader("Server-Token"); String serverTokenEncoded = context.request().getHeader("X-Server-Token");
if (serverTokenEncoded != null) { if (serverTokenEncoded != null) {
if (serverTokenEncoded.equals("iAdmin")) { if (serverTokenEncoded.equals("secure admni token")) {
return QuarkusSecurityIdentity.builder() return QuarkusSecurityIdentity.builder()
.setPrincipal(new QuarkusPrincipal("Administrator")) .setPrincipal(new QuarkusPrincipal("Administrator"))
.addRole("admin") .addRole("admin")