i have implemented login discovery page which will ask to enter ferdation id and once fedrationid enters it will redirect to perticular flow.

Question here is when i am entering the fedrationId and its redirecting to single sign on ...again i need to add fedid i need to enter fedid twice i,is there any way where in start page the fedid which will i enter will automatically take in sso page

   private PageReference getSsoRedirect(String DeveloperName,User user, String startUrl, Map<String, String> requestAttributes) {
    // You can look up if the user should log in with SAML or an Auth Provider and return the URL to initialize SSO. For example:
    SamlSsoConfig SSO = [select Id from SamlSsoConfig where developerName=:developerName limit 1];
    String ssoUrl = Auth.AuthConfiguration.getSamlSsoUrl(requestAttributes.get('MyDomainURL'), startUrl, SSO.Id);
    System.debug('ssoUrl >>>>>'+ssoUrl );
    if(ssoUrl!=null || ssoUrl!='') {
        return new PageReference(ssoUrl);
    return null;

enter image description here

enter image description here

once i entered username in first screen ,why there is need to enter it again in second screen (which is redirected SSO)


To bypass the second login prompt, you should craft a URL (and return it as a PageReference) that will do IdP- or SP-initiated SSO. Constructing this URL depends on your identity provider, it is not Salesforce-specific. The bypass will only work if you have previously authenticated with this identity provider.

See my previous answer for more info.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.