Skip to content

Add OAuth-based authentication to ServiceNow integration with basic auth fallback  #2447

@qodo-code-review

Description

@qodo-code-review

Description:

  • The ServiceNow integration must support OAuth authentication to align with modern security practices and ServiceNow recommendations.
  • Users should be able to connect using OAuth tokens without storing long-lived passwords, improving security posture.
  • The integration must continue to support existing basic authentication to avoid breaking current setups.
  • Configuration should adapt based on availability of OAuth data, making username/password optional when OAuth is configured.
  • The client should automatically use OAuth Bearer tokens when present, refresh credentials per request, and fall back to basic auth if needed.

Deliverables:

  • OAuth support: Enable OAuth authentication flow for the ServiceNow integration, using access tokens for API requests.
  • Backward compatibility: Maintain basic auth support and make it the fallback when OAuth is not enabled or tokens are unavailable.
  • Config updates: Update integration config so servicenowUsername and servicenowPassword are optional when OAuth is configured, and map OAuth profile data to these fields in saas settings.
  • Auto headers: Ensure request headers automatically include the correct Authorization scheme (Bearer or Basic) and refresh per request when needed.
  • URL override: Populate servicenowUrl from the OAuth instance URL when available, with a safe fallback to the configured value.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions