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
RakeebRakeeb 

how can i pass uername and pwd of salesforce in url ?

HI, i want pass uername and password of salesforce and along with details list page of custom object so i can i do that ,here i have example .

PageReference obj1 = new PageReference('https://www.salesforce.com/login.jsp?pw=test&un=test@gmail.com');

return obj1;

But i want to pass  along with this https://ap1.salesforce.com/a00/o so how can i do that kindly let me know asap.

Ankit AroraAnkit Arora

This is strange, just wondering why you want to pass the Username and Password when you are already logged in the organization. Is there any specification?

 

Thanks

Ankit Arora

Blog | Facebook | Blog Page

RakeebRakeeb

HI, actually i have created site using site url  when i have given username and password in site page , the user has to be access the data if  the username and password is correct ,so kindly let me know asap.

Ankit AroraAnkit Arora

Site User have different profile and have different access permissions. So there is no use of sending the UN and PW within the URL. If you want to restrict or provide more access of data to Site User, then you can provide this in Guest User Profile.

 

Thanks

Ankit Arora

Blog | Facebook | Blog Page

RakeebRakeeb

hi,i have created site ,when we provide username and password in site,  if it is correct then it will redirect to Custom object page i.e detail list view page for a perticular custom object thats what i need so that end user can view the custom object details list page.here i am giving the apex code.

 

public with sharing class Samplesite1 {
public String password { get; set; }
public String username { get; set; }

    public PageReference registerUser() {
        List<Login__c> obj = new List<Login__c>();
if(username != null && username != '')
{
obj = [Select Username__c,Password__c from Login__c where Username__c =:username Limit 1];
if(obj.size()>0)
{
for(Login__c log : obj){
if(password == log.Password__c)
{
    PageReference obj1 = new PageReference('https://ap1.salesforce.com/a00/o');
    return obj1;
}
else
{
    ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.FATAL, 'Invalid Password' );
    ApexPages.addMessage(myMsg);
    system.debug('MyMsg:'+myMsg);
}
}
}
else
{
ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.FATAL, 'Username does not exist' );
ApexPages.addMessage(myMsg);
system.debug('MyMsg:'+myMsg);
}
}
return null;
       

    }

}

 

 

<apex:page controller="Samplesite1" showHeader="true" sidebar="true" standardStylesheets="true" tabStyle="Login__c">
   
        <apex:pageBlock >
            <apex:messages />
        <apex:form >
            <h1 style="text-align:centre;color:blue;"> Test </h1>

            <apex:panelGrid columns="2" style="margin-top:1em;">

                <p><b>UserName</b><br />

                <apex:inputText required="true" id="username" value="{!username}"/>
                </p>

                <p><b>Password</b><br />
                <apex:inputSecret id="password" value="{!password}"/>
                </p>
                <apex:commandButton action="{!registerUser}" value="Submit" id="submit"/>

            </apex:panelGrid>

        </apex:form>
        </apex:pageBlock>
       

</apex:page>

 

when i am giving username and password for site  but  its redireted  to 'http:// www.salesforce .com' page ,its asking credential of salesforce so i dont want lke this ,but i want to redirect a perticular Login__c custom object detail list view page ('https://ap1.salesforce.com/a00/o')  so that end user can view the detials of custom object.so kindly let me know the solution asap.

Dev Anand 8Dev Anand 8
can we include that password after hashing
Praveen SirisillaPraveen Sirisilla
FINALLY MADE IT :).......................YES U CAN MR.RAKEEB