{"record":{"id":"b8df98a0b9debd9b","repo":"FlowiseAI/Flowise","slug":"invalid-credentials-provide-either-bearer-token-o","errorCode":null,"errorMessage":"Invalid credentials: provide either Bearer Token or Username + Access Token","messagePattern":"Invalid credentials: provide either Bearer Token or Username \\+ Access Token","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/components/nodes/tools/Jira/Jira.ts","lineNumber":411,"sourceCode":"    async init(nodeData: INodeData, _: string, options: ICommonObject): Promise<any> {\n        let credentialData = await getCredentialData(nodeData.credential ?? '', options)\n        const jiraHost = nodeData.inputs?.jiraHost as string\n\n        if (!jiraHost) {\n            throw new Error('No Jira host provided')\n        }\n\n        const bearerToken = getCredentialParam('bearerToken', credentialData, nodeData)\n        const username = getCredentialParam('username', credentialData, nodeData)\n        const accessToken = getCredentialParam('accessToken', credentialData, nodeData)\n\n        let authType: 'basic' | 'bearer'\n        if (bearerToken) {\n            authType = 'bearer'\n        } else if (username && accessToken) {\n            authType = 'basic'\n        } else {\n            throw new Error('Invalid credentials: provide either Bearer Token or Username + Access Token')\n        }\n\n        // Read SSL certificate from tool inputs if provided\n        let sslCertificate: string | undefined\n        const caFileBase64 = nodeData.inputs?.caFile as string\n        if (caFileBase64) {\n            if (caFileBase64.startsWith('FILE-STORAGE::')) {\n                let file = caFileBase64.replace('FILE-STORAGE::', '')\n                file = file.replace('[', '').replace(']', '')\n                const orgId = options.orgId\n                const chatflowid = options.chatflowid\n                const fileData = await getFileFromStorage(file, orgId, chatflowid)\n                sslCertificate = fileData.toString()\n            } else {\n                const splitDataURI = caFileBase64.split(',')\n                splitDataURI.pop()\n                const bf = Buffer.from(splitDataURI.pop() || '', 'base64')\n                sslCertificate = bf.toString('utf-8')","sourceCodeStart":393,"sourceCodeEnd":429,"githubUrl":"https://github.com/FlowiseAI/Flowise/blob/abe4a8601a058047b350c260676826e21dd14101/packages/components/nodes/tools/Jira/Jira.ts#L393-L429","documentation":"Thrown by Jira.init when neither a bearerToken nor the (username + accessToken) pair is present in the credential. Jira supports two auth schemes: Bearer (PAT, used for Server/DC, API v2) and Basic (email + API token, used for Cloud, API v3). The init logic checks bearerToken first, then username&&accessToken; if both branches fail, it cannot pick an authType or an API version, so it throws.","triggerScenarios":"The credential was created but all three fields (bearerToken, username, accessToken) are empty; only username was supplied without an accessToken; the credential selected in the node is the wrong one (e.g. a generic HTTP credential without Jira fields); the credential fields were renamed in a migration.","commonSituations":"Mixing Jira Cloud (needs email + API token) with a PAT-only credential, or vice versa; selecting an empty credential record; token rotated in Jira but not updated in Flowise credential manager.","solutions":["For Jira Cloud: set username (account email) and accessToken (API token from atlassian.com) in the credential.","For Jira Server/DC: set bearerToken (a Personal Access Token created in Jira profile).","Verify the credential selected on the node is the Jira credential type, not a generic one.","Re-enter tokens after rotation; an empty/whitespace-only token fails the truthy check."],"exampleFix":"// before — credential has only username\ngetCredentialParam('username') === 'me@acme.com', others empty\n// after — Cloud credential\nusername: 'me@acme.com', accessToken: '<api-token-from-atlassian>'","handlingStrategy":"validation","validationCode":"function assertJiraCredentials(cred: { bearerToken?: string; username?: string; accessToken?: string }) {\n  const hasBearer = !!cred.bearerToken?.trim()\n  const hasBasic = !!cred.username?.trim() && !!cred.accessToken?.trim()\n  if (!hasBearer && !hasBasic) {\n    throw new Error('Provide Bearer Token (Server/DC) OR username + accessToken (Cloud)')\n  }\n}","typeGuard":"type JiraCred = { bearerToken?: string; username?: string; accessToken?: string }\nfunction isUsableJiraCred(c: JiraCred): c is JiraCred & { bearerToken: string } | JiraCred & { username: string; accessToken: string } {\n  return !!c.bearerToken?.trim() || (!!c.username?.trim() && !!c.accessToken?.trim())\n}","tryCatchPattern":null,"preventionTips":["Match credential type to product: Cloud → email + API token; Server/DC → PAT.","Re-enter tokens after rotation; whitespace-only values fail the truthy check.","Select a Jira credential type, not a generic HTTP credential.","Verify all three fields aren't empty before saving the credential."],"tags":["jira","auth","credentials","validation","init"],"backgroundTag":null,"analyzedSha":"abe4a8601a058047b350c260676826e21dd14101","analyzedAt":"2026-08-12T16:04:40.823Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}