GUI: loginCheckUrl
  • 21 Nov 2023
  • 1 Minute to read
  • PDF

GUI: loginCheckUrl

  • PDF

Article Summary

GUI: loginCheckUrl

Check whether a user is already logged in and redirect to either the returnUrl if she is logged in or to the errorUrl if she is not.

This URL be used in many ways:

  • Redirect here before displaying a page to known whether to display on your page that the user is logged on or not.
  • Send an ajax request to let javascript on your page know wheter the user is logged in.
  • Use as the src parameter in a <script> tag to load different script depending on whether the user is logged in, e.g. <script src="https:\/\/connectid.no\/user\/loginCheck\returnUrl=https:\/\/mymagazine.no\/logged_in.js&errorUrl=https:\/\/mymagazine.no/not_logged_in.js"/>

If the user is logged in, you can redirect to the oauthAuthorizationEndpoint to get a token to use with the API calls in order to find out the customer number and other information.

This URL will look for the user’s rememberMeCookie and automatically log in the user if it is valid.

This URL will extend the lifetime of the user’s session, preventing automatic logout in the same way as if the user had visited the GUI.

If the user already is logged in with the specified credential, or the user already is logged in and no credential parameter is specified, then the user’s browser will immediately be redirected back to the returnUrl.

If the user is not logged in but has a valid remember me cookie, then the user will be logged in and the user’s browser will immediately be redirected back to the returnUrl.

If the user is not logged in and does not have a valid remember me cookie, then user’s browser will immediately be redirected back to the errorUrl.

URL parametersDescriptionRequired
clientIdThe unique ID of the client, e.g. no.mediaconnect.test
returnUrlA URL to redirect the user’s browser back to on success (the user will be logged in)
errorUrlA URL to redirect the user’s browser back to if something goes wrong (the user might not be logged in)
credentialIf specified, the “already logged in” check will be done with this credential