OAuthAdminServiceを呼び出してWSO2 Identity Serverにアプリケーションを作成するJavaクライアントを開発しています。いくつかの掘り下げの後、私はregisterOAuthApplicationData()メソッドがISでアプリケーションを作成するために使用されるメソッドであることを発見しました。メソッドを呼び出す前に、AuthenticationAdminStub型のlogin()メソッドを使用してadminユーザーを認証しました。このような認証後registerOAuthApplicationData()メソッドWSO2 Identity Serverがプログラムでアプリケーションを作成して「不正アクセス試行」の警告を表示する
を印刷するコンソールを作る {org.wso2.carbon.server.admin.module.handlerに警告[2016年4月26日13:52577:08]。 IPアドレス 127.0.0.1からのサービスOAuthAdminService
へのアクセスを認証しようとすると、アプリケーションが作成取得されていない状態で[52,0577:08 2016年4月26日13] - AuthenticationHandler}で 不正アクセスの試みISデータベースに保存します。
import org.apache.axis2.context.ConfigurationContext;
import org.apache.axis2.context.ConfigurationContextFactory;
import org.apache.axis2.transport.http.HTTPConstants;
import org.wso2.carbon.authenticator.proxy.AuthenticationAdminStub;
import org.wso2.carbon.identity.oauth.OAuthAdminServicePortTypeProxy;
import org.wso2.carbon.identity.oauth.dto.xsd.OAuthConsumerAppDTO;
public class IdentityClientOne {
private final static String SERVER_URL = "https://localhost:9443/services/";
private final static String APP_ID = "myapp";
/**
* @param args
*/
public static void main(String[] args) {
AuthenticationAdminStub authstub = null;
ConfigurationContext configContext = null;
System.setProperty("javax.net.ssl.trustStore", "wso2carbon.jks");
System.setProperty("javax.net.ssl.trustStorePassword", "wso2carbon");
try {
configContext = ConfigurationContextFactory.createConfigurationContextFromFileSystem(
"repo", "repo/conf/client.axis2.xml");
authstub = new AuthenticationAdminStub(configContext, SERVER_URL
+ "AuthenticationAdmin");
// Authenticates as a user having rights to add users.
if (authstub.login("admin", "admin", APP_ID)) {
System.out.println("admin authenticated");
OAuthConsumerAppDTO consumerApp = new OAuthConsumerAppDTO("Oauth-2.0",
"sample_app",
"",
"authorization_code implicit password client_credentials refresh_token urn:ietf:params:oauth:grant-type:saml2-bearer iwa:ntlm","","","");
OAuthAdminServicePortTypeProxy OAuthAdminProxy = new OAuthAdminServicePortTypeProxy();
OAuthAdminProxy.registerOAuthApplicationData(consumerApp);
}
} catch (Exception e) {
e.printStackTrace();
}
}
}
を次のように私が試してみましたコードが行く右の何をすべきか助けてください?
ありがとうございます.. –