-
Notifications
You must be signed in to change notification settings - Fork 601
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix OAuth2 Logout and Exception Issue
- Loading branch information
1 parent
a666225
commit a7914c0
Showing
3 changed files
with
32 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -109,4 +109,5 @@ Dockerfile.local | |
security.properties | ||
*.crt | ||
*.key | ||
*~ | ||
*~ | ||
*.pem |
21 changes: 21 additions & 0 deletions
21
src/main/java/org/cbioportal/security/config/CustomAuthenticationErrorEntryPoint.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
package org.cbioportal.security.config; | ||
|
||
import java.io.IOException; | ||
|
||
import org.springframework.security.web.AuthenticationEntryPoint; | ||
|
||
import jakarta.servlet.ServletException; | ||
import jakarta.servlet.http.HttpServletRequest; | ||
import jakarta.servlet.http.HttpServletResponse; | ||
|
||
public class CustomAuthenticationErrorEntryPoint implements AuthenticationEntryPoint { | ||
|
||
@Override | ||
public void commence(HttpServletRequest request, HttpServletResponse response, | ||
org.springframework.security.core.AuthenticationException authException) | ||
throws IOException, ServletException { | ||
response.sendRedirect(request.getContextPath() + "/login?error"); | ||
|
||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters