Added method to get credentials from connection