- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-07-2018 08:39 AM
Hello all,
I am trying to investigate a production support issue where I need to know the Access Tokens that were generated a week ago, for this I navigated to Manage Tokens Module. I see some Access token in this modules, but I am unable to see the access tokens that were created a week back, they dont exist at all.
Any body knows why this is happening ?
Solved! Go to Solution.
- Labels:
-
Integrations
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-07-2018 08:41 AM
Dustin,
Expired Tokens get cleaned up by a scheduled job.
OOB scheduled Job named Clean Expired OAuth Credentials
deletes expired Tokens of OAuth
//Delete both refresh token and authorization code that expired more than specified (default is 4) hours ago
if (gs.getProperty("com.snc.platform.security.oauth.is.active", 0)) {
gs.print('Executing Clean Expired OAuth Credentials job');
var gr = new GlideRecord('oauth_credential');
gr.addQuery('expires', '<', gs.hoursAgo(gs.getProperty("com.snc.platform.security.oauth.hours.expired.credential.is.kept", 4)));
gr.deleteMultiple();
}
Thank you,
Aman Gurram
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-07-2018 08:41 AM
Dustin,
Expired Tokens get cleaned up by a scheduled job.
OOB scheduled Job named Clean Expired OAuth Credentials
deletes expired Tokens of OAuth
//Delete both refresh token and authorization code that expired more than specified (default is 4) hours ago
if (gs.getProperty("com.snc.platform.security.oauth.is.active", 0)) {
gs.print('Executing Clean Expired OAuth Credentials job');
var gr = new GlideRecord('oauth_credential');
gr.addQuery('expires', '<', gs.hoursAgo(gs.getProperty("com.snc.platform.security.oauth.hours.expired.credential.is.kept", 4)));
gr.deleteMultiple();
}
Thank you,
Aman Gurram
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-07-2018 08:44 AM
I see. Thank you, now its straight forward to understand why they dont exist.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-28-2020 08:30 AM
Hello Amen,
Kindly could you help me with code to get OAuth token/refresh token manually. I found that answer in one of your reply, unfortunately I didn't find that.
Thx