Skip to content

Commit 5500e7e

Browse files
authored
Update how-to-configure-enterprise-spring-cloud-gateway.md
1 parent 7b6ddc6 commit 5500e7e

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

articles/spring-apps/how-to-configure-enterprise-spring-cloud-gateway.md

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -123,16 +123,22 @@ You can also view or edit those properties in the Azure portal, as shown in the
123123
> After configuring SSO, remember to set `ssoEnabled: true` for the Spring Cloud Gateway routes.
124124
125125
## Configure single sign-on (SSO) logout
126-
VMware Spring Cloud Gateway service instances provide a default API endpoint to logout of the current SSO session. The path to this endpoint is `/scg-logout`. There are two different outcomes that can be accomplished depending on how the logout endpoint is called: logout of session and redirect to UAA logout or only logout the service instance session.
126+
VMware Spring Cloud Gateway service instances provide a default API endpoint to logout of the current SSO session. The path to this endpoint is `/scg-logout`. There are two different outcomes that can be accomplished depending on how the logout endpoint is called: logout of session and redirect to IdP logout or only logout the service instance session.
127127

128-
### Logout of UAA and SSO Session
129-
Sending a GET request to the `/scg-logout` endpoint then it will send a 302 redirect response to the UAA logout URL. In order for user to be returned back to a path on the Gateway service instance, you can add a redirect parameter to the GET `/scg-logout` request. For example, if a user goes to `${serverUrl}/scg-logout?redirect=/home` in their browser they will be redirected back to `${serverUrl}/home` after logging out of UAA.
128+
### Logout of IdP and SSO Session
129+
Sending a GET request to the `/scg-logout` endpoint then it will send a 302 redirect response to the IdP logout URL. In order for user to be returned back to a path on the Gateway service instance, you can add a redirect parameter to the GET `/scg-logout` request. For example, if you have a website with the logout function and you want the users will be redirected back to `${serverUrl}/home` after logging out of IdP in their browser, you need to link the logout buttion to the url `${serverUrl}/scg-logout?redirect=/home` in your frontend app code.
130130

131131
> [!NOTE]
132132
> The value of the redirect parameter is a valid path on the Gateway service instance. You cannot redirect to an external URL.
133133
134134
### Only Logout SSO Session
135-
If the GET request to the `/scg-logout` is sent using a XMLHttpRequest (XHR), then the 302 redirect could be swallowed and not handled in the response handler. In this case, the user would only be logged out of the SSO session on the Gateway service instance and would still have a valid UAA session. The behavior typically seen in this case is that if the user attempts to login again they are automatically sent back to gateway as authenticated from UAA.
135+
If the GET request to the `/scg-logout` is sent using a XMLHttpRequest (XHR), then the 302 redirect could be swallowed and not handled in the response handler. In this case, the user would only be logged out of the SSO session on the Gateway service instance and would still have a valid IdP session. The behavior typically seen in this case is that if the user attempts to login again they are automatically sent back to gateway as authenticated from IdP.
136+
A piece of code example is as below.
137+
```
138+
const req = new XMLHttpRequest();
139+
req.open("GET", "/scg-logout);
140+
req.send();
141+
```
136142

137143
## Configure cross-origin resource sharing (CORS)
138144

0 commit comments

Comments
 (0)