I want to update Refresh Token automatically.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-12-2023 12:53 AM
I am using Graph Spoke to handle sending notifications from Flow Designer to Teams.
There is one problem as I do this.
As I do this, there is one problem: when the Refresh Token expires, it is no longer available.
So I am wondering if I can use Scheduled Jobs to get the Refresh Token automatically.
If anyone has any knowledge on how to do this, I would appreciate it.
By the way, I have setup the following link and am using OAuth 2.0.
Best regards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-12-2023 02:17 AM
If you have the correct source, it should be possible via the GlideOAuthClient().
Regards,
Hayo
Please mark as correct answer if this solves your issue.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-12-2023 03:28 AM
Thank you for your reply.
I was able to get the Token value using GlideOAuthClient(), but when I check the 'oauth_credential' table, it is not updated.
How should I set the value?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-13-2023 05:21 AM
I have the name of the oauth_entity as first parameter when doing a requestToken().
Where grOEP is a oAuth entity profile (oauth_entity_profile) and profileId the sysId.
The requestor_context is in my case a rest message (value : "sys_rest_message")
And the oauth_requestor the sysId of the rest message. In your case you need to find your definition / link to the oAuth token which is generated.
And the jsonParams a json encoded list of parameters. In case of a refreshToken:
var params = {
grant_type: "refresh_token",
refresh_token: new global.AzureDecodeVariables().getDecryptedValue(grOC.token_received),
oauth_requestor_context: requestor_context,
oauth_requestor: requestor_id,
oauth_provider_profile: profileId
};
var tokenResponse = oAuthClient.requestToken(grOEP.oauth_entity.name, jsonParams);
Regards,
Hayo
Please mark as correct answer if this solves your issue.