features.rpInitiatedLogout
This content is for v8.x. Switch to the latest version for up-to-date documentation.
Enables RP-Initiated Logout features
default value:
{ enabled: true, logoutSource: [AsyncFunction: logoutSource], // see expanded details below postLogoutSuccessSource: [AsyncFunction: postLogoutSuccessSource] // see expanded details below}(Click to expand) features.rpInitiatedLogout options details
logoutSource
Section titled “logoutSource”HTML source rendered when RP-Initiated Logout renders a confirmation prompt for the User-Agent.
default value:
async function logoutSource(ctx, form) { // @param ctx - koa request context // @param form - form source (id="op.logoutForm") to be embedded in the page and submitted by // the End-User ctx.body = `<!DOCTYPE html> <html> <head> <title>Logout Request</title> <style>/* css and html classes omitted for brevity, see lib/helpers/defaults.js */</style> </head> <body> <div> <h1>Do you want to sign-out from ${ctx.host}?</h1> ${form} <button autofocus type="submit" form="op.logoutForm" value="yes" name="logout">Yes, sign me out</button> <button type="submit" form="op.logoutForm">No, stay signed in</button> </div> </body> </html>`;}postLogoutSuccessSource
Section titled “postLogoutSuccessSource”HTML source rendered when RP-Initiated Logout concludes a logout but there was no post_logout_redirect_uri provided by the client.
default value:
async function postLogoutSuccessSource(ctx) { // @param ctx - koa request context const { clientId, clientName, clientUri, initiateLoginUri, logoUri, policyUri, tosUri, } = ctx.oidc.client || {}; // client is defined if the user chose to stay logged in with the authorization server const display = clientName || clientId; ctx.body = `<!DOCTYPE html> <html> <head> <title>Sign-out Success</title> <style>/* css and html classes omitted for brevity, see lib/helpers/defaults.js */</style> </head> <body> <div> <h1>Sign-out Success</h1> <p>Your sign-out ${display ? `with ${display}` : ''} was successful.</p> </div> </body> </html>`;}