Skip to content

TheBlubb14/GoogleLibrary

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GoogleLibrary

Some random methods for the Google APIs Client Library

Example UserManager

var clientSecrets = new ClientSecrets()
{
    ClientId = "yourclientid",
    ClientSecret = "yourclientsecret"
};

var scope = new List<string>()
{
    // example scopes for the google assistant
    "openid",
    "https://www.googleapis.com/auth/assistant-sdk-prototype"
};

// example endpoint for the google assistant
string endpoint = "embeddedassistant.googleapis.com";
await UserManager.Initialize(clientSecrets, "GoogleLibrary", endpoint, scope, "GoogleLibraryFolder");

// here you have your AccessToken
// with this Token you can authenticate with the google services
var accessToken = UserManager.Instance.UserToken.AccessToken;

// i implemented for example a method to get your google user data with the AccessToken
var userData = await UserManager.Instance.GetUserData(accessToken);

You can create your own ClientSecrets here

Troubleshooting

If there is a System.Reflection.TargetInvocationException try to update all NuGet Packages

Thanks to this project for the example to get started with google apis

About

Some random methods for the Google APIs Client Library

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Languages