func validateToken(env azure.Environment, token *azure.ServicePrincipalToken) error {
	c := subscriptionsClient(env.ResourceManagerEndpoint)
	c.Authorizer = token
	_, err := c.List()
	if err != nil {
		return fmt.Errorf("Token validity check failed: %v", err)
	}
	return nil
}
func validateToken(env azure.Environment, token *azure.ServicePrincipalToken) error {
	c := subscriptionsClient(env.ResourceManagerEndpoint)
	c.Authorizer = token
	_, err := c.List()
	if err != nil {
		return fmt.Errorf("Token validity check failed: %v", err)
	}
	return nil
}
func validateToken ( env azure . Environment , token * azure . ServicePrincipalToken ) error { c := subscriptionsClient ( env . ResourceManagerEndpoint ) c . Authorizer = token _ , err := c . List ( ) if err != nil { return fmt . Errorf ( " " , err ) } return nil }
// validateToken makes a call to Azure SDK with given token, essentially making
// sure if the access_token valid, if not it uses SDK’s functionality to
// automatically refresh the token using refresh_token (which might have
// expired). This check is essentially to make sure refresh_token is good.
validateToken makes a call to Azure SDK with given token essentially making sure if the access_token valid if not it uses SDK’s functionality to automatically refresh the token using refresh_token ( which might have expired ) . This check is essentially to make sure refresh_token is good .