function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Venkatramanan LakshmananVenkatramanan Lakshmanan 

Getting the values in apex class

hi, 

I have a HTML file with a hyper link in the page. On clicking this link, i need to pass the username and password to the community site login page's apex class. How to pass these parameters

In that apex class, how to get these passed values? coz, if i get these values, i can do the site login with these parameters and redirect the user to the community home page.

Please advise

Thanks

Ramu_SFDCRamu_SFDC
The below post has the discussion on the same topic. Might be helpful

https://developer.salesforce.com/forums/ForumsMain?id=906F00000008m1tIAA
Venkatramanan LakshmananVenkatramanan Lakshmanan
hi,

Thanks for the reply. 

above link contains of a different approach, after logging into salesforce, he need to check for the site user valid or not and if valid, then redirection will take place.

In my scenario, i want to pass valid username and password from a html page (by clicking a simple hyperlink) and it should be received by the community landing page controller or vf page and do the Site.Login(Username, Password, RedirectURL) to redirect the user to the community home page.

Please advise on how to pass the username, password and redirect URL from a html form to salesforce community login page.

Thanks

AshwaniAshwani
Build following URL from you HTML form:

http://login.salesforce.com/?un=user1@demo.com&pw=my_password

or you can use input element where name attribute wil be "un" and "pw".
Venkatramanan LakshmananVenkatramanan Lakshmanan
Thanks for the reply.

URL passing is not safe, so i cannot do that.

in the second option, assign new input elements and set the username and password and what is the method to send across to salesforce apex class?
and also how should i receive this on apex class?

Please advise