• How to use this control for any database

    By Bryan S Schmiedeler 1 decade ago

    I am struggling with the proper way to use this control.

    I want the control to work when an unauthenticated user tries to access *any* db on the server that requires authentication - like iNotes, etc.

    I have configured DOMCFG to point to a form in DOMCFG that then redirects to the XPage in DOMCFG.

    So I added this to the HTML Head content of the custom form.

    ""

    Then I configured xp_login in DOMCFG as best I could, but I do not understand how to set up a parameter to open the page the user requested that caused the login to fire?

    Any help would be greatly appreciated.

    Bryan

    • That should be possible

      By F. Kranenburg 1 decade ago

      Hi Bryan,

      When a user tries to access a application unauthenticated, the login process is being 'moved' to the default form in the DOMCFG database when there is no rule specified for the application itself.

      At this point the server knows where the user came from and redirects the user to that database after succesfull login.

      Because you use an Xpage to log in, then you also have to use a domino classic form. This is the way DOMCFG is designed, it can not handle Xpages.

      Either way, the login control needs this form because it returns a 'reasonType' field, letting the control know why the user can not log in, when it fails.

      The 'workaround' I describe in the documentation 'redirects' you to a Xpage after the default Form popups up. This is where the server 'forgets' where the user came from.

      But I have an idea for this.

      I have not tested this but in complete theory you should be able to do this:

      - write some classic web code to get the HTTP_Referrer CGI variable using @Formulas

      - @Encode the variable (I'm not sure that is the function you should use, but the referring url must be web save and be escaped)

      - add the variable as a new parameter to the xpage, someting like:


      " url=domcfg.nsf/xp_login.xsp?logmeinplease=true&referringurl=" + reURL + "\">"

      - adjust the xp_Login.xsp xpage and set the property of the login control 'urlafterlogin' to computed, to 'param.get("referringurl")'

       
      Again, at this point I can not test this but I hope you get my point on how to accomplish this.

      Please let me know if this works so I can add this to the documentation.