setting accesstoken using credential object