> For the complete documentation index, see [llms.txt](https://dwp-sso.gitbook.io/developers/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://dwp-sso.gitbook.io/developers/development/java/sso-1.md).

# SSO 로그오프 방법 제공하기

인증서버의 로그오프 페이지를 호출할 수 있는 url을 설정해서 사용자가 필요에 따라 실행할 수 있도록 합니다.

**샘플코드**

{% code title="default.jsp 일부" %}

```javascript
// 인증 객체 선언(Request와 Response 인계)
AuthCheck auth = new AuthCheck(request, response);

// 로그오프 URL 설정
logoffUrl = auth.getSsoSite().getLogoffUrl(request) + "?" +
        AuthUtil.ParamInfo.SITE_ID + "=" +
        auth.getSsoSite().getId() + "&" +
        auth.getSsoProvider().getParamName(AuthUtil.ParamInfo.RETURN_URL) + "=" +
        Utility.encodeUrl(auth.getThisUrl(), LiteralConst.UTF_8);       // ThisURL은 사용자가 현재 호출한 페이지의 URL
```

{% endcode %}

```javascript
<a href="<%=logoffUrl%>">Logoff</a>
```

auth.getThisUrl()는 현재 Url을 자동으로 생성합니다.&#x20;

{% hint style="warning" %}
만약 현재 Url이 맞지 않다면, **직접 문자열로 설정**하여야 합니다.
{% endhint %}
