-
Notifications
You must be signed in to change notification settings - Fork 532
Allow directly specifying access_token to use in credentials #761
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Does the |
I doubt that'll do it. Usercredentials doesn't have a way to directly plugin an access token (its designed for webflows and processing full tokenresponses w/ refresh). |
I don't see what you mean about Assuming that works, we could certainly add a shortcut to create it, but I'd like to know whether it does work first. Are you able to try that out? |
(sorry, didn't intend to close). |
Okay - I'll give it a go myself when I get a chance. Unlikely to be in the next couple of days though. |
got it working (i needed to fully specify the token w/ issue time and duration)
|
Great - although I'd have expected an |
These tokens will expire and are issued with 3600s shelf life by default. Its opaque so we would not know how long its currently valid for unless we query during initialization like the following:
(which we probably shoudn't do; its a round-trip) I tried a couple of things:
We can check the other language implementations but I think its fine with the logic and set it to (3600,Now); if it expires before that, you'll still see error#1. Here's a reference implementation for python (its set to null): |
Closing, as seems to be resolved. |
@chrisdunelm I don't think this FR is implemented yet for ref again, its there in java and heres's the one for node |
@salrashid123 Thanks for the clarification. I'll take a look at this next week. |
@salrashid123 Please can you confirm #1062 implements this feature as required? |
look good; thanks
with a .csproj referencing your current git clone https://github.com/chrisdunelm/google-api-dotnet-client.git) directly
invalid and expired token gives
|
@salrashid123 thanks for the testing and confirmation. I've just added an integration test in #1065. |
why does the GoogleAuthorizationCodeFlow requires ClientSecret ? If I have a token using Android application which doesnt have client secret, how can I provide it and why I cant use my existing Token? var fakeflow = new GoogleAuthorizationCodeFlow(new GoogleAuthorizationCodeFlow.Initializer |
@EmilAlipiev If this isn't what you're looking for, please can you explain in more detail what you're trying to do. Thanks. |
I created a SO question. please see the entire question there |
As already answered in the SO question, we don't support Xamarin. |
Allow specifying an access_token directly into a Credential
for reference, see:
googleapis/google-cloud-node#1346
I didn't see a credential type here that would allow for this:
https://developers.google.com/api-client-library/dotnet/reference/1.10.0/classGoogle_1_1Apis_1_1Auth_1_1OAuth2_1_1GoogleCredential#details
The text was updated successfully, but these errors were encountered: