public static String generateAuthorizationCode ( ) { StringBuilder buf = new StringBuilder ( AUTHORIZATION_CODE_LENGTH ) ; SecureRandom rand = new SecureRandom ( ) ; for ( int i = 0 ; i < AUTHORIZATION_CODE_LENGTH ; i ++ ) { buf . append ( allowedCharacters [ rand . nextInt ( allowedCharacters . length ) ] ) ; } return buf . toString ( ) ; }
Generated Unique Authorization Code