0

我正在为 OpenAM 编写一个补充服务,用于一些在默认服务器中不能作为 RESTful 服务提供的功能。我正在使用 OpenAM 客户端 SDK(12 或 13)。我收到以下错误:

DebugConfiguration:07/03/2017 04:13:12:530 PM IRDT: 
Thread[main,5,main]
'/debugconfig.properties' isn't valid, the default configuration will be used instead: Can't find the configuration file

'/debugconfig.properties'.
amAuthContext:07/03/2017 04:13:12:564 PM IRDT: Thread[main,5,main]: 
TransactionId[unknown]
 ERROR: Failed to obtain auth service url from server: null://null:null
 amNaming:07/03/2017 04:13:12:573 PM IRDT: Thread[main,5,main]: 
TransactionId[unknown]
ERROR: Failed to initialize naming service
java.lang.Exception: Cannot find Naming Service URL.
at com.iplanet.services.naming.WebtopNaming.getNamingServiceURL(WebtopNaming.java:1254)
at com.iplanet.services.naming.WebtopNaming.initializeNamingService(WebtopNaming.java:272)
at com.iplanet.services.naming.WebtopNaming.updateNamingTable(WebtopNaming.java:1149)
at com.iplanet.services.naming.WebtopNaming.getNamingProfile(WebtopNaming.java:1070)
at com.iplanet.services.naming.WebtopNaming.getServiceAllURLs(WebtopNaming.java:494)
at com.sun.identity.authentication.AuthContext.login(AuthContext.java:654)
at com.sun.identity.authentication.AuthContext.login(AuthContext.java:584)
at com.sun.identity.authentication.AuthContext.login(AuthContext.java:386)
at MainKt.realmLogin(Main.kt:56)
at MainKt.main(Main.kt:144)

IdRepoSampleUtils: Failed to start login for default authmodule
Exception in thread "main" 
com.sun.identity.authentication.spi.AuthLoginException: Failed to create new Authentication Context: null
at com.sun.identity.authentication.AuthContext.login(AuthContext.java:657)
at com.sun.identity.authentication.AuthContext.login(AuthContext.java:584)
at com.sun.identity.authentication.AuthContext.login(AuthContext.java:386)
at MainKt.realmLogin(Main.kt:56)
at MainKt.main(Main.kt:144)

主要错误是 SDk 找不到 STS 服务器 url。我该如何解决?

4

1 回答 1

0

我通过检查示例 SDK 客户端找到了解决方案。解决方案是使用 Java 众所周知的属性文件。那里有一个 AMConfig.properties,SDK jar 会自动尝试从中提取值。对于文件的格式,我们可以参考 Oracle OpenSSO,并使用 OpenAM 示例客户端应用程序中的 AMConfig.properties.template。

于 2017-07-04T19:38:13.697 回答