Cognitoawscredentials js. currentSession() should solve your problem.

creator avatar