Written by

Question Permo Jacobs · Mar 18, 2019

How to create a CSP Login Page and control user sessions

How to create a CSP Login Page and control user sessions?

Comments

Evgeny Shvarov · Mar 18, 2019

Hi Permo!

Could you please provide more details?

0
Robert Cemper  Mar 21, 2019 to Robert Cemper

adapt :== create your own class and inherit %CSP.Login

0
Shahama Hilmy · Mar 21, 2019
 If (%session.NewSession = 1) {
    // this is a new session
 }
Set %session.Data("MyData") = 22 Write $Get(%session.Data("MyData")) // this should print 22 
0
Hansel Rudy Stange Gaete  Apr 1, 2019 to Robert Cemper

Works, but customize ?

change Look & feel ?

i try override any method and gets 404

0
Robert Cemper  Apr 1, 2019 to Hansel Rudy Stange Gaete

you better not change   %CSP.Login but make a personal copy and change this

404 = HTTP page not found. Most likely you put your copy to the wrong directory or namespace   

And then you have to put the reference in MgmtPortal Security-> WebApplications as Login page:
Again with the correct namespace and the correct directory.

0
Hansel Rudy Stange Gaete  Aug 29, 2019 to Hansel Rudy Stange Gaete

i so sad, this history never end ...

this solution have no interaction with login failure, some ideas ??

0
Alexander Koblov  Aug 30, 2019 to Hansel Rudy Stange Gaete

Name the file login.csp

And inside it check for Error:ErrorCode request parameter:

<html><head><title>Login</title></head>
<body>
My login page:</br>
<form method='post'>
Name: <input name="CacheUserName"/><br/>
Password: <input type='password' name="CachePassword"/><br/>
<input type='submit'/>
</form>

<server>
Set tMsg = $Get(%request.Data("Error:ErrorCode",1))
    If ((tMsg'="")&&($SYSTEM.Status.GetErrorCodes(tMsg)'[$$$ERRORCODE($$$RequireAuthentication))) {
        &html<<center>>
        write "Auth failed!"
        &html<</center>>
    }
</server>
</body>
</html>
0
Hansel Rudy Stange Gaete  Aug 31, 2019 to Alexander Koblov

i forget something ...

file exist, but :

Not Found

The requested URL /csp/user/index.csp was not found on this server.

0
Alexander Koblov  Sep 2, 2019 to Hansel Rudy Stange Gaete

If you have index.csp and it is specified as login page and you are seeing 404 error, try following:

a) Enable Audit b) Enable Protect event in Audit c) Reproduce the problem. e) Check Audit records if any Protect errors were logged

0
Timothy Leavitt  Apr 1, 2019 to Hansel Rudy Stange Gaete

A few weird things with custom login pages:

CSPSystem needs read permission on the DB containing them. (You'll need to close CSPGateway connections after making this change so that it can reconnect with the right privileges.)

It's specified with the ".cls" extension in the web application configuration, not just the classname.

0
Hansel Rudy Stange Gaete  Jun 3, 2019 to Hansel Rudy Stange Gaete

best solution to my problem look like stupid solution :

In my case : i need a custom home page, look no cache system (Custom Logo, Custom Form)

my solution :

1.- create a simple index.html with a login form (Action page is my App Home)
2.- put this file in web app folder

3.- Set "Login Page" to my index.html

Bingo !

0
Robert Cemper · Mar 21, 2019

to create your own Login Page you best start with Class  %CSP.Login and adapt it to your specific needs.

defaulting to

and then you add the new Login Page to Security-> WebApplications

0
Yuri Marx  Mar 18, 2023 to Robert Cemper

What is the value to Login Page field for this class: Class dc.login.GoogleLogin Extends %CSP.Login { ... }

0