I assume your rest api uses jwt bearer tokens. You should be able to configure you current google oauth code, but here is a sample using msal (microsoft oauth sdk) for azure ad:
note: you need to create an application in azure ad for your node app. if you want scopes, you define them in api portion of the defining the application