{"id":30347234,"url":"https://github.com/adiakys/googlelimitedinputauth.net","last_synced_at":"2025-10-25T02:38:14.642Z","repository":{"id":297111920,"uuid":"995694988","full_name":"Adiakys/GoogleLimitedInputAuth.Net","owner":"Adiakys","description":"Google Device Authorization Flow Library for .NET","archived":false,"fork":false,"pushed_at":"2025-06-03T23:28:09.000Z","size":45,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-08-18T16:22:51.084Z","etag":null,"topics":["auth","csharp","device","dotnet","google","limitedinput"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Adiakys.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-06-03T21:55:39.000Z","updated_at":"2025-06-06T13:11:18.000Z","dependencies_parsed_at":"2025-06-04T06:37:09.155Z","dependency_job_id":"0f3ad5fa-52cc-4d1c-bb5b-a99d0c3d590e","html_url":"https://github.com/Adiakys/GoogleLimitedInputAuth.Net","commit_stats":null,"previous_names":["adiakys/googlelimitedinputauth.net"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/Adiakys/GoogleLimitedInputAuth.Net","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Adiakys%2FGoogleLimitedInputAuth.Net","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Adiakys%2FGoogleLimitedInputAuth.Net/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Adiakys%2FGoogleLimitedInputAuth.Net/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Adiakys%2FGoogleLimitedInputAuth.Net/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Adiakys","download_url":"https://codeload.github.com/Adiakys/GoogleLimitedInputAuth.Net/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Adiakys%2FGoogleLimitedInputAuth.Net/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272526778,"owners_count":24949836,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-28T02:00:10.768Z","response_time":74,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["auth","csharp","device","dotnet","google","limitedinput"],"created_at":"2025-08-18T16:14:30.656Z","updated_at":"2025-10-25T02:38:09.594Z","avatar_url":"https://github.com/Adiakys.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Google Device Authorization Flow Library for .NET\n\nThis library provides a clean and extensible way to authenticate with Google APIs using the OAuth 2.0 Device Authorization Grant, ideal for devices and services that lack a browser or have limited input capabilities.\n\n## ✨ Features\n\n- Device Code Flow for OAuth 2.0 with refresh token support\n- Token caching with FileDataStore\n- Automatic access token refresh on expiration\n- Pluggable logging and custom user interaction callbacks\n- Designed for use with Google APIs (e.g., YouTube Data API v3)\n\n## 📦 Installation\n\nCurrently not published on NuGet. You can include this library in your project by copying the source or referencing it as a submodule.\n\n## 🚀 Quick Start\nHere’s how to authenticate with Google using the Device Authorization flow and create a YouTubeService client:\n\n```csharp\nvar credentials = await DeviceCredentials.InitializeAsync(\n    clientSecrets: new ClientSecrets\n    {\n        ClientId = _options.ClientId,\n        ClientSecret = _options.ClientSecret\n    },\n    scope: [YouTubeService.Scope.YoutubeReadonly],\n    store: new FileDataStore(\"gcredentials\", fullPath: false),\n    callback: ShowCodeToUser,\n    logger: _logger,\n    cancellationToken: stoppingToken);\n\nvar youtube = new YouTubeService(new BaseClientService.Initializer\n{\n    HttpClientInitializer = credentials,\n    ApplicationName = _options.ApplicationName\n});\n\nstatic Task ShowCodeToUser(GDeviceCode code)\n{\n    Console.WriteLine($\"Visit {code.verification_url} and enter the code: {code.user_code}\");\n    return Task.CompletedTask;\n}\n```\n\n### 🔍 What this does:\n\n1. Initialize the credentials using your OAuth 2.0 ClientId and ClientSecret.\n\n2. Specify the scope you need access to — in this case, read-only access to YouTube.\n\n3. Use a file-based store to persist tokens locally (so the user doesn't have to re-authenticate each time).\n\n4. Provide a callback function (ShowCodeToUser) to display the verification URL and user code.\n\n5. Once authorized, it automatically refreshes tokens when needed.\n\n6. Finally, it creates an authenticated YouTubeService client you can use to call the YouTube Data API.\n\n## 📄 License\nMIT License. See [LICENSE](./LICENSE) for details.\n\n## 👨‍💻 Dependencies \u0026 References\n - [Google.Apis.Auth](https://github.com/googleapis/google-api-dotnet-client)\n - [Google OAuth 2.0 Device Flow](https://developers.google.com/identity/protocols/oauth2/limited-input-device?hl=it)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadiakys%2Fgooglelimitedinputauth.net","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fadiakys%2Fgooglelimitedinputauth.net","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadiakys%2Fgooglelimitedinputauth.net/lists"}