Toggle menu

createLogoutSession

Given the name of a provider the user was authenticated with, checks to see if a provider specific logout process is defined and if so creates an AuthSession and returns performAuthLogout:true along with the as (authSessionId) and asn (authSessionNonce) of the newly created AuthSession.

A return value of performAuthLogout: true indicates that the user's browser should be forwarded over to the http/logout method with the as (authSessionId) and asn (authSessionNonce) in the URL to complete the logout process.

A return value of performAuthLogout:false indicates that no further action is required for this provider.

Parameters

NameTypeDescription
providerNameString, requiredNames of the provider to log the user out of.

Typically this should be set to the name of the provider the user logged in with, as returned by getAuthStatus when the user successfully authenticated.

The name of the provider the user logged in with should be stored in the user's session to be supplied to this method at a later date.
returnUrlString (URL), requiredURL to return the user's browser to after passing through the logout system without an error.
errorReturnUrlString (URL), requiredURL to return the user's browser to after an error within the authentication worker occurs.
baseAuthWorkerUrlString (URL), requiredPublicly accessible path to the Auth worker, eg http://mysite/apiserver/auth

Used internally to build URLs to other endpoints, eg baseAuthWorkerUrl + "/http/logoff"
namedTemplateOverridesArray<String>, optionalAffects handlebars template resolution.
arbitraryReturnDataMap<String, Object>, optionalReturned by getAuthStatus after authenticating, this should be stored in the user's session to be supplied to this method upon logout.  

Contains arbitrary data returned by actions involved in authenticating a user. May contain OAuth tokens and similar data required by certain providers to be supplied or used during the logout process.

Response Fields

NameTypeDescription
performAuthLogoutBoolean, requiredTrue if the user's browser should be forwarded over to the http/logout method with the as (authSessionId) and asn (authSessionNonce) in the URL to complete the logout process.
asString (UUID), requiredThe authSessionId of the newly created AuthSession. Null if performAuthLogout is false.
asnString (UUID), requiredThe authSessionNonce of the newly created AuthSession. Null if performAuthLogout is false.

Example Request

{
    "id": "635998609805441605",
    "jsonrpc": "2.0",
    "method": "createLogoutSession",
    "params": {
        "returnUrl": "http://demodev1.gossinteractive.com/toptasks",
        "errorReturnUrl": "http://demodev1.gossinteractive.com/toptasks",
        "baseAuthWorkerUrl": "http://demodev1/apiserver/auth",
        "providerName": "mygovscot",
        "namedTemplateOverrides": [
            "toptasks"
        ],
        "arbitraryReturnData": {
            "a": "b"
        }
    }
}

Example Response

{
    "id": "635998609805441605",
    "jsonrpc": "2.0",
    "result": {
        "result": {
            "performAuthLogout": true,
            "as": "8e39c3e6-f2d3-4d06-a7b8-5dd85f460cce",
            "asn": "1c25ee14-2755-4440-bbca-d9e5d470f366"
        }
    }
}

Last modified on June 27, 2023

Share this page

Facebook icon Twitter icon email icon

Print

print icon