Skip to page contentSkip to chat
ServiceNow support
    • Community
      Ask questions, give advice, and connect with fellow ServiceNow professionals.
      Developer
      Build, test, and deploy applications
      Documentation
      Find detailed information about ServiceNow products, apps, features, and releases.
      Impact
      Accelerate ROI and amplify your expertise.
      Learning
      Build skills with instructor-led and online training.
      Partner
      Grow your business with promotions, news, and marketing tools
      ServiceNow
      Learn about ServiceNow products & solutions.
      Store
      Download certified apps and integrations that complement ServiceNow.
      Support
      Manage your instances, access self-help, and get technical support.
When setting OAuth email the job "Refresh Email Access Token" needs the admin user role to execute correctly - Support and Troubleshooting
  • >
  • Knowledge Base
  • >
  • Support and Troubleshooting (Knowledge Base)
  • >
  • When setting OAuth email the job "Refresh Email Access Token" needs the admin user role to execute correctly
KB0859525

When setting OAuth email the job "Refresh Email Access Token" needs the admin user role to execute correctly


4981 Views Last updated : Sep 16, 2023 public Copy Permalink
KB Summary by Now Assist

Issue

When the using OAuth authentication on your instance Email Accounts, the job Refresh Email Access Token is associated to the "admin" user to have the admin role associated to work correctly.  

You will identify this problem because: 

  1. When the OAuth SMTP/IMAP/POP3 connection expires, the mail reader/sender connection is invalid:
    e.g. OAuth access token is not present or has expired. Email account=xxxxxx

  2. Instance node logs might show errors like
    worker.0 worker.0 txid=20038682db9b Name: Refresh Email Access Token
    worker.0 worker.0 txid=20038682db9b 6816f79cc0a8016401c5a33be04be441 can't read table oauth_credential

  3. Renewing the tokens manually with an admin account, it works correctly.
  4. Your "admin" user does not have the admin role
  5. Your Refresh Email Access Token jobs is associated to Run As: System Administrator (admin user)

connection failed

Cause

The scheduled job "Refresh Email Access Token" is configured to run as administrator (admin user).

  • If you have installed the OAuth Email plugin, the job is located here: <instance>/sysauto_script_list.do?sysparm_query=name%3DRefresh%20Email%20Access%20Token%5Eactive%3Dtrue&sysparm_first_row=1&sysparm_view=

The admin user would normally have access to the oauth_credential table via the admin role.
In this instance the admin role has been removed from the admin user

Job that needs admin



Resolution

There are several recommended solutions:

  1. Restore the admin role to the admin user
  2. Customise the Refresh Email Access Token job to run with a user with the admin role
  3. Create relevant ACLs on oauth_credential table specifically granting access to a user, which you can use on the "Refresh Email Access Token" job

The world works with ServiceNow.

Sign in for more! There's more content available only to authenticated users Sign in for more!
Did this KB article help you?
Did this KB article help you?

How would you rate your Now Support digital experience?

*

Very unsatisfied

Unsatisfied

Neutral

Satisfied

Very satisfied

Very unsatisfied

Unsatisfied

Neutral

Satisfied

Very satisfied

What can we improve? Please select all that apply.

What are we doing well? Please select all that apply.

Tell us more

*

Do you expect a response from this feedback?

  • Terms and conditions
  • Privacy statement
  • GDPR
  • Cookie policy
  • © 2025 ServiceNow. All rights reserved.