From e77685f605452245b6ea8c2b565e7b2a06886a61 Mon Sep 17 00:00:00 2001 From: Juan Carlos Luciani Date: Thu, 7 Sep 2006 23:34:21 +0000 Subject: [PATCH] Changes to support Authentication Token Validation Service. --- .../com/novell/casa/authtoksvc/AuthToken.java | 30 +++++++++++++++++-- .../novell/casa/authtoksvc/SessionToken.java | 2 -- 2 files changed, 28 insertions(+), 4 deletions(-) diff --git a/CASA-auth-token/java/server/Svc/src/com/novell/casa/authtoksvc/AuthToken.java b/CASA-auth-token/java/server/Svc/src/com/novell/casa/authtoksvc/AuthToken.java index b95abdb2..b2633f43 100644 --- a/CASA-auth-token/java/server/Svc/src/com/novell/casa/authtoksvc/AuthToken.java +++ b/CASA-auth-token/java/server/Svc/src/com/novell/casa/authtoksvc/AuthToken.java @@ -47,8 +47,6 @@ import java.io.*; * and with a timestamp. The body of the SOAP message is as follows: * * - * signature value - * lifetime value * Identity Token typeidentity token data * * @@ -281,4 +279,32 @@ public class AuthToken { return m_identityTokenType; } + + /* + * Validates an authentication token. If successful it + * returns a string containing the identity token associated + * with the authentication token; otherwise it returns NULL; + */ + public static String validate(String authTokenString) + { + String idenTokenString = NULL; + + // Instantiate the AuthToken, this validates the token itself. + try + { + AuthToken authToken = new AuthToken(authTokenString); + + // If we are here is because the token validation succeeded, + // obtain the identity token string. + idenTokenString = authToken.getIdentityToken(); + } + catch (Exception e) + { + // The validation of one of the tokens failed + // tbd - Log + System.err.println("AuthToken.validate()- Exception caught during token processing, msg: " + e.getMessage()); + } + + return idenTokenString; + } } diff --git a/CASA-auth-token/java/server/Svc/src/com/novell/casa/authtoksvc/SessionToken.java b/CASA-auth-token/java/server/Svc/src/com/novell/casa/authtoksvc/SessionToken.java index 3067e5d9..bcbbdf5e 100644 --- a/CASA-auth-token/java/server/Svc/src/com/novell/casa/authtoksvc/SessionToken.java +++ b/CASA-auth-token/java/server/Svc/src/com/novell/casa/authtoksvc/SessionToken.java @@ -47,8 +47,6 @@ import java.io.*; * the SOAP message is as follows: * * -* signature value -* lifetime value * realm value * identity id value *