+ Start a Discussion
tarun.khandelwal1.3965028573349685E12tarun.khandelwal1.3965028573349685E12 

How to login to Community through Apex Code and Then Get the landing Page URL

Hello ,

I want to login to community through apex code which will be called from an vf email template. I don't want to redirect the user, i want the next url(Change Password in my case).
Is it possible to login a user as when i am trying to do so using Site.login('username','password',null) i am getting PageReference as null.

PrasanntaPrasannta (Salesforce Developers) 
Hi,

Please refer to the link below to know on how to login to community through apex code-
https://appirio.com/category/tech-blog/2013/10/create-custom-salesforce-communities-login-landing-page/

Hope this information helps.
tarun.khandelwal1.3965028573349685E12tarun.khandelwal1.3965028573349685E12
It seem this is how it works with Developer Console while Testing.
I had some work around and i am closing this Topic Now.