A client library which aimed to make Whydah integration more easy and more resilient
- XML and JSON parsing of Whydah datastructures sent over the wire. (Whydah Typelib)
- Util library for all the frequent used standard API calls
- SessionHandler for ApplicationSessions and User Sessions
- Client logic for using Whydah Web SSO - SSOLoginWebapp (SSOLWA) and STS (SecurityTokenService).
The 3rd party Admin SDK is found at https://github.com/Cantara/Whydah-Admin-SDK
For code and examples for other languages, see https://github.com/cantara/Whydah-TestWebApp
// Log on application and user
String userToken = WhydahUtil.logOnApplicationAndUser("https://whydahdev.cantara.no/tokenservice/",\\
new ApplicationCredential("applicationID","applicationname","applicationSecret"),\\
new UserCredential( "username", "password");
// Get the user sessionId (userTokenId)
String userTokenId = UserXpathHelper.getUserTokenId(userToken);
WhydahApplicationSession wasSession = new WhydahApplicationSession(uTokenSUri, \\
new ApplicationCredential(appId, appName, appSecret));
WhydahUserSession wusSession = new WhydahUserSession(wasSession,userCredential);
if (wusSession.hasRole("WhydahAdmin"){
// do admin privilege operation
}
Binaries and dependency information for Maven, Ivy, Gradle and others can be found at http://mvnrepo.cantara.no.
Example for Maven:
<dependency>
<groupId>net.whydah.sso</groupId>
<artifactId>Whydah-Java-SDK</artifactId>
<version>x.y.z</version>
</dependency>