Saturday, November 24, 2018

Generate the Single Sign-on Redirect URL using the ssov3.jar as a library in Java with the required parameters

 

Generating the Single Sign-on Redirect URL for mapping and to access the NetSuite Application:

import com.netledger.forpartners.sso.SSOUrl;

public class Start {

    public static void main(String[] args) throws Exception {

    SSOUrl ssoUrl = new SSOUrl();

    ssoUrl.setEncryptionKeyFileName("C:\\privKey.der");
    ssoUrl.setNetSuitePartnerId("123456");
    ssoUrl.setTarget(SSOUrl.Target.APP);
   
    String URL = ssoUrl.getURL("companyID", "userID");

    System.out.println("URL: " + URL);

    }
}

The equivalent batch file command for this is:

java -cp ssov3.jar com.netledger.forpartners.sso.SSOUrl -rc companyID -k privKey.der -ru userID -p 123456 -t "app" >out.txt
pause

Generating the Single Sign-on Redirect URL to access the Web Store:

import com.netledger.forpartners.sso.SSOUrl;

public class Start {

    public static void main(String[] args) throws Exception {

    SSOUrl ssoUrl = new SSOUrl();

    ssoUrl.setEncryptionKeyFileName("C:\\privKey.der");
    ssoUrl.setNetSuitePartnerId("123456");
    ssoUrl.setTarget(SSOUrl.Target.SITE);
    ssoUrl.setHideloginpage(true);
    ssoUrl.setReturnUrl("http://www.yahoo.com");
    ssoUrl.setLandingUrl("http://shopping.netsuite.com/mysite");
    ssoUrl.setSiteId("1");
    ssoUrl.setNsCompanyId("123456");
   
    String URL = ssoUrl.getURL("companyID", "userID");

    System.out.println("URL: " + URL);

    }
}

The equivalent batch file command for this is:

java -cp ssov3.jar com.netledger.forpartners.sso.SSOUrl -rc companyID -k privKey.der -ru userID -p 123456 -t "site" -r "http://www.yahoo.com" -l "http://shopping.netsuite.com/mysite" -c 123456 -s 1 -h>out.txt
pause

No comments:

Post a Comment