I am working in the Google Drive API integration to my project during this, I wanted to use Google drive service as a service to my application because I don't want each user to log in via Google account to retrieve and upload any file in the cloud storage.
So I started using different approaches provided for Google API (Web application, Stand alone application and As a service account). All these accounts require authentication Via OATH 2.0.
I did some Goggling for the solution and finally found a solution to use service account, by hoping this may help other writing this.
First login to API Console and create a service account. Once service account is created download private key file and use it for service account authentication.
Constants
Key Validation
Create Google Credential