pattern matching on credentials.