Logout keycloak in springboot applicaton

Am facing a problem that i don’t know how to end the session for a user I already use this one : https://{server}/auth/realms/{Realm}/protocol/openid-connect/logout?id_token_hint={token}& post_logout_redirect_uri={URI TO REDIRECT }

also am using the RealmResource

        Keycloak keycloak = Keycloak.getInstance(

        RealmResource realmResource = keycloak.realm("realm");
       ---> realmResource.deleteSession(sessionId); i receive here a error that the Methode not allowed