Java 连接的应用程序不适用于少数Salesforce组织-Oauth登录
我已经创建了一个应用程序,可以使用oAuth Rest api JAVA登录任何salesforce帐户。 这对很少的组织很好,但不允许所有的组织。 以下是此过程中使用的两个端点: 第1步:Java 连接的应用程序不适用于少数Salesforce组织-Oauth登录,java,oauth,salesforce,Java,Oauth,Salesforce,我已经创建了一个应用程序,可以使用oAuth Rest api JAVA登录任何salesforce帐户。 这对很少的组织很好,但不允许所有的组织。 以下是此过程中使用的两个端点: 第1步: String url = "https://login.salesforce.com/services/oauth2/authorize"; String body = "response_type=code&client_id="+customerKey+"&redirect_uri="+
String url = "https://login.salesforce.com/services/oauth2/authorize";
String body = "response_type=code&client_id="+customerKey+"&redirect_uri="+URLEncoder.encode("url", "UTF-8")";
第二步:
String url2 = "https://login.salesforce.com/services/oauth2/token";
String body2 = "response_type=code&grant_type=authorization_code&code="+code+"&client_id="+customerKey+"&client_secret="+secret+"&redirect_uri="+URLEncoder.encode("url", "UTF-8");
我有开发者版组织。以上代码适用于2个不同的组织。但并非在所有情况下都有效。
我遗漏了什么吗?不工作的组织有没有可能启用了“我的域名”或在政府云中(该组织位于NA21上)。@RobDavis没有,这些组织没有启用MyDomain。我如何检查它是否在政府云中?