Skip to content
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

Refresh Token is always NULL #331

Closed
jsivelopment opened this issue Nov 29, 2021 · 6 comments
Closed

Refresh Token is always NULL #331

jsivelopment opened this issue Nov 29, 2021 · 6 comments
Labels
bug Something isn't working

Comments

@jsivelopment
Copy link

I have downloaded the code examples and I am running the "AuthenticateInAspNetWebApplication". It is not working.
I debugged the code and the TokenResponse is always getting a RefreshToken = null.
So the page_load: client.Config.OAuth2RefreshToken = loginHelper.Credentials.Token.RefreshToken;
this loginHelper.Credentials.Token.RefreshToken is always NULL.
Instead of this every time the ExchangeCodeForTokenAsync get called, I am getting always an AccessToken with value, but the RefreshToken is always NULL.
So What i should do to get all the time the RefreshToken in order to make this examples work fine.
Screen Shot 2021-11-29 at 10 25 27

@jsivelopment jsivelopment added the bug Something isn't working label Nov 29, 2021
@johnpisg
Copy link
Contributor

johnpisg commented Dec 2, 2021

This is not a bug from the Library. In effect we have to set the Prompt property value to "consent", so Google Server will display the Consent Page and you will get a new Refresh Token.
However you are correct this happens in the Example application, probably the example should come with this property set.
See Screenshot:
Screen Shot 2021-12-02 at 11 38 36

@AnashOommen
Copy link
Member

AnashOommen commented Dec 2, 2021 via email

@johnpisg
Copy link
Contributor

johnpisg commented Dec 2, 2021

Could you kindly send a PR for fixing the code example?

On Thu, Dec 2, 2021, 12:40 PM johnpisg @.***> wrote: This is not a bug from the Library. In effect we have to set the Prompt property value to "consent", so Google Server will display the Consent Page and you will get a new Refresh Token. However you are correct this happens in the Example application, probably the example should come with this property set. See Screenshot: [image: Screen Shot 2021-12-02 at 11 38 36] https://user-images.githubusercontent.com/5359576/144474599-0267100a-92c3-44e6-8728-534125e46ab7.png — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub <#331 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABCOJCAPGY3HWX27FM7CGV3UO6VSJANCNFSM5I7RRSWQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

Yes:
#332

@AnashOommen
Copy link
Member

You also need to accept the CLA, so I can review and merge the PR.

@johnpisg
Copy link
Contributor

johnpisg commented Dec 2, 2021

You also need to accept the CLA, so I can review and merge the PR.

I did that.

@AnashOommen
Copy link
Member

Marking as fixed since PR is merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants