Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Feature Request Adding Google Service Account option in to the SheetsServiceProvider

Discussion in 'Localization Tools' started by Lukas-Labaj, Sep 30, 2021.

  1. Lukas-Labaj

    Lukas-Labaj

    Joined:
    Nov 22, 2012
    Posts:
    36
    Hello @karl_jones,

    it would be really great to add ServiceAccount type of Authentication to the SheetServiceProvider. We already did it ourself simply like this :

    Code (CSharp):
    1.  
    2. SheetsService ConnectWithServiceAccount()
    3. {
    4.     GoogleCredential userCredentials;
    5.     var jsonFile = Environment.GetEnvironmentVariable("LOCALIZATION_GOOGLE_SERVICE_ACCOUNT");
    6.     userCredentials = GoogleCredential.FromFile(jsonFile).CreateScoped(k_Scopes);
    7.  
    8.     SheetsService sheetsService = new SheetsService(new BaseClientService.Initializer
    9.     {
    10.         HttpClientInitializer = userCredentials,
    11.         ApplicationName = ApplicationName,
    12.     });
    13.     return sheetsService;
    14. }
    Thank you
     
    kdserra, trdillon and karl_jones like this.
  2. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    7,845
    Thanks. I'm not familiar with service accounts but ill look into it.
     
    Lukas-Labaj likes this.
  3. MaksChojniak

    MaksChojniak

    Joined:
    Feb 3, 2022
    Posts:
    2
    how can i add it myself? It is in packages folder an i ont have acces to change it
     
  4. karl_jones

    karl_jones

    Unity Technologies

    Joined:
    May 5, 2015
    Posts:
    7,845
    You can move the folder out of the Package cache folder and into your projects Packages folder, then you can make changes.