1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Anuncie Aqui
    Anuncie aqui você Também: fdantas@4each.com.br

Microsoft OAuth: How to do silent logout in Springboot?

Discussão em 'Angular' iniciado por avishekdr, Julho 22, 2025.

  1. avishekdr

    avishekdr Guest

    I'm trying to develop a Microsoft authentication mechanism to let user login & logout. So far the login works smooth and same the logout also. But when I do logout a page appears of Microsoft showing its logging me out. My requirement is this should be done in behind the scene.

    Dependencies:

    <parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>3.4.4</version>
    <relativePath />
    </parent>
    <dependency>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-oauth2-client</artifactId>
    </dependency>


    In Angular code:

    logout() {
    sessionStorage.clear();
    localStorage.clear();
    const logoutUrl = `https://login.microsoftonline.com/common/oauth2/logout?post_logout_redirect_uri=${encodeURIComponent(window.location.origin)}`;
    window.location.href = logoutUrl;
    }


    Currently the logout is handled in frontend. I want this to happen from the JAVA side through an API call.

    Is there any package or way around to do this silent logout?

    Continue reading...

Compartilhe esta Página