hilla react oauth2 logout

how do you logout hilla oauth2 application. i need a logout button in frontend

here is what i did sofar in der server i wrote a logout endpoint function.

public class AuthEndpoint {
    public void logout() {
        System.out.println("server logout ...");

in Frontend 

const logoutAction = () => {
console.log(“react logout …”);

calling this give me 403 FORBIDDEN error in the browser. how will you trigger a logout from react.

The @hilla/frontend package includes a logout method you can call hilla-google-auth/frontend/useAuth.tsx at ff8c201840bcb270c4df68a5677c93f63a78835c · marcushellberg/hilla-google-auth · GitHub

That only closes the session on the server though. If you want to also log out of your SSO provider, you need to configure that in spring security

How do you trigger the SSO Provider logout. this is what i tried so far

                .logout()            .invalidateHttpSession(true)
.deleteCookies("JSESSIONID")              .logoutSuccessUrl("/").permitAll();```