On this page

Create a sign-out UI element

The first step is to create an element that allows the user to sign out of the app.

Remove the tokens from the local session

Remove the tokens stored in session during a sign-in flow from session state.

session, err := sessionStore.Get(r, "okta-custom-login-session-store")
if err != nil {
  http.Error(w, err.Error(), http.StatusInternalServerError)
  }

  delete(session.Values, "id_token")
  delete(session.Values, "access_token")

Remove the tokens from the server

The next step is to revoke the tokens on the server. Use the token revocation endpoint to remove the tokens from the server and clear it from use in any location.

4: Redirect the user to the default signed-out page

After the user is signed out, send them to the default page after a sign-out.

See also

Validate SSO federation