I'm using Google Admin SDK Directory API in my project.
I'm using Google sign first and then using access token to access this API, this access token expires after certain time. How I can get refresh token for long time so that I can access this API without having to re-signin?
Edit
first I'm doing google sign in following this npm package google-login through this Im getting token to call users API by following method here is my code to fetch google suite users
const a =localStorage.getItem('token')
fetch(`https://www.googleapis.com/admin/directory/v1/users?
domain=${domain.url}&viewType=domain_public&key=${apiKey.key}`
,{ headers: {
'authorization': 'Bearer '+a
},})
.then(response => response.json())
.then(data => this.setState({ users:data.users }));