new function to get credentials