Refresh non-expired access tokens
Hello, I have a question about refreshing access tokens.
Scenario: Let's say you want to authorize your app to connect to Blackbaud's sky api one time and endlessly refresh the bearer token securely in the background to call the payments api checkout endpoint.
1) After making a request to the token endpoint with the code and the grant type set to ‘authorization code’, you store the refresh token returned. 2) Then, because you don't know whether or not your access token has expired, you want to go ahead and get a fresh bearer token by calling the token endpoint again with the grant type set to “refresh_token”, “perservere_fresh_token” set to true. Is this a valid approach?
Additionally, I've noticed that it ignores the preserve_refresh_token flag. Is this because the token hasn't expired yet?
Comments
-
Hi Lauren,
When you set preserve_refresh_token to true the refresh token will only be valid for one year. Once that refresh token expires you would need to reauthorize the application.
If you want to have the solution work in perpetuity, you should not use preserve_refresh_token. Instead you would want to store the new refresh token each time you get a new access token.
You should be careful when your service runs on multiple instances that each instance is using its own refresh token or that they properly share the new refresh token value once a refresh token is exchanged. If the value is not isolated/shared properly one instance may invalidate the refresh token being used on another instance during an exchange.
1
Categories
- All Categories
- 6 Blackbaud Community Help
- 211 bbcon®
- 1.4K Blackbaud Altru®
- 402 Blackbaud Award Management™ and Blackbaud Stewardship Management™
- 1.1K Blackbaud CRM™ and Blackbaud Internet Solutions™
- 15 donorCentrics®
- 360 Blackbaud eTapestry®
- 2.6K Blackbaud Financial Edge NXT®
- 655 Blackbaud Grantmaking™
- 576 Blackbaud Education Management Solutions for Higher Education
- 3.2K Blackbaud Education Management Solutions for K-12 Schools
- 940 Blackbaud Luminate Online® and Blackbaud TeamRaiser®
- 84 JustGiving® from Blackbaud®
- 6.7K Blackbaud Raiser's Edge NXT®
- 3.7K SKY Developer
- 248 ResearchPoint™
- 120 Blackbaud Tuition Management™
- 165 Organizational Best Practices
- 240 Member Lounge (Just for Fun)
- 34 Blackbaud Community Challenges
- 37 PowerUp Challenges
- 3 (Open) PowerUp Challenge: Grid View Batch
- 3 (Closed) PowerUp Challenge: Chat for Blackbaud AI
- 3 (Closed) PowerUp Challenge: Data Health
- 3 (Closed) Raiser's Edge NXT PowerUp Challenge: Product Update Briefing
- 3 (Closed) Raiser's Edge NXT PowerUp Challenge: Standard Reports+
- 3 (Closed) Raiser's Edge NXT PowerUp Challenge: Email Marketing
- 3 (Closed) Raiser's Edge NXT PowerUp Challenge: Gift Management
- 4 (Closed) Raiser's Edge NXT PowerUp Challenge: Event Management
- 3 (Closed) Raiser's Edge NXT PowerUp Challenge: Home Page
- 4 (Closed) Raiser's Edge NXT PowerUp Challenge: Standard Reports
- 4 (Closed) Raiser's Edge NXT PowerUp Challenge: Query
- 796 Community News
- 3K Jobs Board
- 54 Blackbaud SKY® Reporting Announcements
- 47 Blackbaud CRM Higher Ed Product Advisory Group (HE PAG)
- 19 Blackbaud CRM Product Advisory Group (BBCRM PAG)
