Changes to support Authentication Token Validation Service.
This commit is contained in:
		| @@ -47,8 +47,6 @@ import java.io.*; | |||||||
|  * and with a timestamp. The body of the SOAP message is as follows: |  * and with a timestamp. The body of the SOAP message is as follows: | ||||||
|  * |  * | ||||||
|  * <auth_token> |  * <auth_token> | ||||||
|  * <signature>signature value</signature> |  | ||||||
|  * <lifetime>lifetime value</lifetime> |  | ||||||
|  * <ident_token><type>Identity Token type</type>identity token data</ident_token> |  * <ident_token><type>Identity Token type</type>identity token data</ident_token> | ||||||
|  * </auth_token> |  * </auth_token> | ||||||
|  * |  * | ||||||
| @@ -281,4 +279,32 @@ public class AuthToken | |||||||
|    { |    { | ||||||
|       return m_identityTokenType; |       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; | ||||||
|  |    } | ||||||
| } | } | ||||||
|   | |||||||
| @@ -47,8 +47,6 @@ import java.io.*; | |||||||
| * the SOAP message is as follows: | * the SOAP message is as follows: | ||||||
| * | * | ||||||
| * <session_token> | * <session_token> | ||||||
| * <signature>signature value</signature> |  | ||||||
| * <lifetime>lifetime value</lifetime> |  | ||||||
| * <realm>realm value</realm> | * <realm>realm value</realm> | ||||||
| * <ident_id>identity id value</ident_id> | * <ident_id>identity id value</ident_id> | ||||||
| * </session_token> | * </session_token> | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user