<h2>Manage OAuth tokens</h2><br/><div style="overflow-x:auto"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"><head><meta content="text/html; charset=UTF-8" /><meta name="copyright" content="(C) Copyright 2025" /><meta name="DC.rights.owner" content="(C) Copyright 2025" /><meta name="generator" content="DITA-OT" /><meta name="DC.type" content="task" /><meta name="DC.title" content="Manage OAuth tokens" /><meta name="abstract" content="Open OAuth tokens to provide access to restricted resources." /><meta name="description" content="Open OAuth tokens to provide access to restricted resources." /><meta name="DC.subject" content="OAuth, manage OAuth tokens" /><meta name="keywords" content="OAuth, manage OAuth tokens" /><meta name="DC.creator" content="ServiceNow" /><meta name="DC.date.created" content="2023-08-03" /><meta name="DC.date.modified" content="2024-02-01" /><meta name="DC.format" content="XHTML" /><meta name="DC.identifier" content="t_ManageTokens" /><link rel="stylesheet" type="text/css" href="../../../CSS/commonltr.css" /><title>Manage OAuth tokens</title></head><body id="t_ManageTokens"> <h1 class="title topictitle1" id="ariaid-title1">Manage OAuth tokens</h1> <div class="body taskbody"><p class="shortdesc">Open OAuth tokens to provide access to restricted resources.</p> <div class="section prereq p">Role required: any user or admin</div> <div class="section context" id="t_ManageTokens__context_xfr_mp5_ntb"> <p class="p">OAuth tokens issued by the instance and third party OAuth provider are stored in oauth_credential table.</p> <p class="p">Some of the important columns in this table:</p> <ul class="ul" id="t_ManageTokens__ul_ild_fp5_ntb"><li class="li">Token: Value of the token issued by <span class="ph">ServiceNow</span> instance.</li><li class="li">Type: Determines if the token is Access Token or Refresh Token.</li><li class="li">Expires: Data/Time when the Access or Refresh Token expire.</li><li class="li">Token Received: Value of the token issued by a 3rd party OAuth Provider. This value is in encrypted format.</li></ul> <p class="p">Token Expiration and Validity is as follows:</p> <ul class="ul" id="t_ManageTokens__ul_nfv_4p5_ntb"><li class="li">Access Token: By default, an instance issues access tokens with a 30-minute lifespan in the scenario where the instance is the OAuth provider.</li><li class="li">Refresh Token: By default, an instance issues refresh tokens with a 100-day lifespan in the scenario where the instance is the OAuth provider.</li></ul> </div> <ol class="ol steps"><li class="li step stepexpand"> <span class="ph cmd">Navigate to one of the following menu options:</span> <div class="itemgroup info"> <ul class="ul" id="t_ManageTokens__ul_adf_tvm_jw"><li class="li"><span class="ph menucascade"><span class="ph uicontrol">Self-Service</span> > <span class="ph uicontrol">My Connected Apps</span></span> to see the tokens that the instance created when you granted access to a resource on the instance.</li><li class="li"><span class="ph menucascade"><span class="ph uicontrol">System OAuth</span> > <span class="ph uicontrol">Manage Tokens</span></span> to see all tokens. Only administrators can access this module.</li></ul> </div> </li><li class="li step stepexpand"> <span class="ph cmd">Click the <span class="ph uicontrol">Name</span> to open the token.</span> </li><li class="li step stepexpand"> <span class="ph cmd">Click <span class="ph uicontrol">Revoke Access</span> to prevent access to the restricted resource.</span> <div class="itemgroup info"> <p class="p">You can also view other information about the token, including the scope it allows access to and the expiration date.</p> <p class="p">You can select the <span class="ph uicontrol">Clean Expired OAuth Credentials</span> record from the Schedule page (sys.trigger.list) and configure the following:</p> <ul class="ul" id="t_ManageTokens__ul_df3_4hs_xbc"><li class="li"><span class="ph uicontrol">com.snc.platform.security.oauth.is.active</span>: By default, the value is set true.</li><li class="li"><span class="ph uicontrol">com.snc.platform.security.oauth.hours.expired.credential.is.kept</span>: Set the value based on your requirement to determine the number of hours you want the keep the expired oauth credential in the system.</li><li class="li"><span class="ph uicontrol">com.snc.platform.security.oauth.day.old.credential.is.kept</span>: Set the value based on your requirement to determine the number of days you want the keep the expired oatuh credential in the system.</li></ul> </div> </li></ol> </div> </body></html></div>