+ Start a Discussion
sh-at-youseesh-at-yousee 

Question about Site.login method

Hi all,

 

I have posted this in the VisualForce section as well but maybe this part of it can be answered from someone in here. To see my follow-up comments please take a look at my VisualForce Board Message

 

I have a VF Page called SiteLogin which includes a component called SiteLogin.

The component is tied to a controller named SiteLoginController.

Now, when I type in my username and password in the form (component) and hit the login button all is well and I'm logged in.

I've tried to build a bit further on this controller so that in the constructor of the controller checks the URL parameters. If a username and password is found the login method is called. This also works as intended but I get the following error message back:

Error:This form must be secure. Use the 'forceSSL' attribute and set it to 'true.'

 

In the form-tag of the SiteLogin Component forceSSL is set to true. As a bit of additional info I can mention that Setup --> Develop --> Site --> Login Settings --> Require Non-Secure Connections (HTTP) is unchecked.

The same goes for Setup --> Security Controls --> Seesion Settings --> Require secure connections (HTTPS). So, this is also unchecked.

Checking either one of them didn't solve the problem for me.

If someone can tell me why (and how to go around this error) I would really appreciate it. Basically, what I'm looking for is a way to automatically log in the user if the credentials are provided in the URL.

Thanks.

/Søren Nødskov Hansen

 

sh-at-youseesh-at-yousee

Is there no one who can help me with this?

 

Basically, I guess you could boil my question down to if it is possible to set forceSSL=true within the controller using Apex instead of in the form in the VisualForce Page?

 

Thanks.

 

/Søren Nødskov Hansen