Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

365
Vistas
Spring Oauth2 SSO - Unable to logout from the Auth server

I am using @EnableOauth2Sso following an architecture similar as the one described in Spring's oauth2 tutorial: an auth server, a zuul proxy that enables the sso, a separated UI application etc.

Auth server   ----  Resource Server (Zuul app) ---- Angular UI App

The problem is that when the UI logs out against the resource server it successfully deletes the resource server JSESSIONID, then the user is redirected to a home page. When the user wants to login again, he's redirected to the auth server but instead of asking for the user+password, it considers he's still logged. The auth server JSESSIONID is still there and wasn't affected by the previous Resource Server lougout.

How could I also logout from the auth server?

over 4 years ago · Santiago Trujillo
2 Respuestas
Responde la pregunta

0

Since there isn't an out of the box Spring OAuth2 Single Logout we had to work around this creating a /revoke endpoint that calls the Auth Server to logout from it:

UI:

    $http({
        method: 'POST',
        url: API + '/logout'
    }).then(function() {
        $http({
            method: 'GET',
            url: API + '/auth/oauth/session/revoke'
        }).then(function() {
            window.location = '/';
        });
    });

Zuul server:

zuul:
  ...
  routes:
      authServer:
        path: /auth/**
        url: ${authServer.url}/auth/
      ...

Auth Server:

@RestController
public class RevokeController {

    @RequestMapping(value = "/oauth/session/revoke", method = RequestMethod.GET)
    public void revoke(HttpServletRequest request) throws InvalidClientException {
        request.getSession().invalidate();
    }
}
over 4 years ago · Santiago Trujillo Denunciar

0

This is correct the behavior, when you logout form Angular app, it will not logout from Auth server.

Example :- Suppose we want to login stackoverflow.com using google or facebook account, we need not to enter password again, ones we are login to Auth service.

If we need to show SSO login again and again , we need to logout Angular UI and OAuth server both.

over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda