Forum Discussion

james_scee's avatar
11 years ago

Accessing SSO referrer via http.request.referrer

Hi

 

I'm trying to get the SSO referrer to record a signed in event, but "http.request.referrer" seems to return a blank when I do. Navigating between pages on the forum is fine. I'm not sure how to get the SSO referrer other than attempt it via "http.request.referrer". If anyone could shed any light on this it would be greatly appreciated.

 

cheers

 

James

3 Replies

  • NicoB's avatar
    NicoB
    Lithium Alumni (Retired)
    11 years ago

    Hi james_scee 

    If you're trying to read the referrer from a freemarker component I think you should use

    http.request.parameters.name.referrer

     I hope I didn't misundertand your question.

     

    Thanks,

     

    Nico

  • Hi

     

    Thanks for your reply, that seems to give errors, I get

     

    FreeMarker template error
    The following has evaluated to null or missing: ==> http.request.parameters.name.referrer....

     

    When I use

    http.request.referrer!

     

    and 

     

    http.request.parameters.name.referrer!

     

    http.request.referrer! works, but doesn't get me the SSO referrer. When someone signs in the get sent to another site eg

     

    Lithium->SSO Page->(sign in)->back to Lithium

     

    I don't get the sign in ref, just a blank

     

    http.request.parameters.name.referrer! is always blank

  • NicoB's avatar
    NicoB
    Lithium Alumni (Retired)
    11 years ago

    Hi James,

    maybe these questions are obvious but I want to make sure we are not missing anything

    1. Is the parameter definitely there after the SSO login redirects back to Lithium?
    2. Is the parameter named "referrer"?

    I've checked the documentation and actually you were right in that http.request.referrer should return the referrer parameter so my approach should have the same final result as http.request.referrer but this last one is more flexible (if you change the parameter name in the SSO admin configuration you don't have to change the code).

     

    Thanks,

     

    Nico