Guest User

Untitled

a guest
Jul 17th, 2018
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.04 KB | None | 0 0
  1. private boolean validateToken() throws SSOException
  2. {
  3. System.out.println("Validating token - "+tokenID);
  4. boolean validToken = false;
  5. manager = SSOTokenManager.getInstance();
  6. token = manager.createSSOToken(tokenID); // fails here
  7.  
  8. // isValid method returns true for valid token.
  9. if (manager.isValidToken(token)) {
  10. // let us get all the values from the token
  11. String host = token.getHostName();
  12. java.security.Principal principal = token.getPrincipal();
  13. String authType = token.getAuthType();
  14. InetAddress ipAddress = token.getIPAddress();
  15. System.out.println("SSOToken host name: " + host);
  16. System.out.println("SSOToken Principal name: " +
  17. principal.getName());
  18. System.out.println("Authentication type used: " + authType);
  19. System.out.println("IPAddress of the host: " +
  20. ipAddress.getHostAddress());
  21. validToken = true;
  22. }
  23. System.out.println("Returning "+validToken);
  24. return false;
  25. }
Add Comment
Please, Sign In to add comment