Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeDevelopment and...Development and...Building ExtensionsBuilding ExtensionsProvidersProvidersEnabling Refresh Token for Google authentication ProviderEnabling Refresh Token for Google authentication Provider
Previous
 
Next
New Post
12/6/2017 10:15 AM
 

In a quest to enable authentication token renewal in my Google Drive module I made a few simple modifications to DNN core and Google auth provider to catch and store refresh token inside [GoogleUserToken] cookie. Which I store in a database table when I am able to access a valid UserID.

By definition - refresh token is issued only when the user is prompted to provide consent. As such the refresh token needs to be stored on a permanent basis.

By adding my save logic to [UserLogin] method in [AspNetMembershipProvider] I got this working with one limitation. The refresh token only gets saved if the user logs in for the very first time. Even if I revoke access to the application forcing prompt for consent on next login which generates a new refresh token which I would like to save.

What I failed to find is the logic that initiates saving of auth token to the [UserAuthentication] table. I want to add a call two lines of code to save refresh token (if one is available).

I have found reference to [AddUserAuthentication] method in [AuthenticationController] but from what I could find this method is used for Registration and Association flow. Not entirely sure how this affects Social login providers.

 
New Post
12/8/2017 2:13 PM
 

Update

I have this working properly now. Ended up rethinking my original positioning in AspNetMembershipProvider class and the problem I was having there.

Now the code resides in AuthenticateUser method back in OAuthClientBase class. Just have to make sure I have a valid UserID and Refresh token.

 
Previous
 
Next
HomeHomeDevelopment and...Development and...Building ExtensionsBuilding ExtensionsProvidersProvidersEnabling Refresh Token for Google authentication ProviderEnabling Refresh Token for Google authentication Provider


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out