kakawait / uaa-behind-zuul-sample

Spring AuthorizationServer load balanced behind Zuul
320 stars 156 forks source link

Logout doesn't work #34

Open Pryanic opened 6 years ago

Pryanic commented 6 years ago

I tried to use your project. I run this application. After that I move to localhost:8765/dummy authorized and got hello world but after I logout and went to localhost:8765/dummy and I got hello world page. Is it expect?

tndsuperch commented 6 years ago

Hi,Pryanic

To make logout work, you need to make some minor changes to the project.

  1. Add the following code to SecurityConfiguration in api-gateway

    .logout().logoutRequestMatcher(new AntPathRequestMatcher("/logout"))
    .logoutSuccessUrl("/uaa/logout")
  2. Add the following code to LoginConfiguration in uaa-service

    .logout().logoutRequestMatcher(new AntPathRequestMatcher("/logout"))
    .logoutSuccessUrl("/login")

It has been tested and can work normally.