Home > Enterprise >  How do I use PKCE to login with Google.Apis.Drive.v3 for .NET?
How do I use PKCE to login with Google.Apis.Drive.v3 for .NET?

Time:10-01

I am using the Google.Apis.Drive.v3 Nuget package on a desktop app. Because the client secret cannot be stored securely since the app can be decompiled, I should use PKCE to login. But I can't find a way to login with PKCE with the Nuget package, despite the fact Google claims to support PKCE. How can I login with PKCE?

CodePudding user response:

The .net client library does not support PKCE at this time. You need to store the client secret in your application. There is no other option available for installed applications.

A few options have been proposed over the years. One would be to encrypt or has the secrete and then have your application decrypt it making in this manner it wouldn't strictly be available when the application is decompiled.

Another option would be to store it on a server and have your application request it when it needs it and again encrypt it for the trip from the server.

Neither of these options are ideal but they are the best we have at this time.

  • Related