Google-oauth2-jwt implements the creation of the signed JWT for Google Service Accounts, to make authorized calls to Google APIs from server to server. All details here:
Advice: be sure that the machine time is well synchronized to successfully make the access token request and get a Bearer token.