In Postman I have an external BearerOauth2-request and a related, authenticated API-request which both run fine!
While transfering these requests to Forge using External OAuth2 with bearerMethod “form-encoded” I experience the following:
$> forge lint: no errors
$> forge deploy: no errors
$> forge tunnel: “invalid manifest”-error in red, invoked function “index.runApp”
Deployed App on Development-Site in Frontend: Function with handler “index.runApp” was not found.
It seems the Forge DX is somekind of ambiguous.
see Cli screenshot running $> forge deploy:
no error about the runApp()-function in src/index.jsx
see App screenshot from development site:
Please find “manifest.yml” and the “index.jsx” below.
- see “manifest.yml”:
app:
id: ari:cloud:ecosystem::app/370fd8cd-3193-45a3-9a05-2a1852bb4b24
modules:
jira:issueGlance:
- key:
function: main
title: Evaluation
description: Evaluation
label: Evaluation
function:
- key: main
handler: index.runApp
providers:
auth:
- external-server
providers:
auth:
- key: external-server
name: “”
type: oauth2
scopes:
- “api”
clientId: “”
bearerMethod:
type: form-encoded
parameter: “token”
actions:
authorization:
remote: api-server
path: /oauth/authorize
exchange:
remote: api-server
path: /oauth/token
resolvers:
accessTokenExpires: expires_in
retrieveProfile:
remote: api-server
path: /api/User/
resolvers:
id: Id
displayName: Shortname
remotes:
- key: api-server
baseUrl: “https://:”
permissions:
scopes:- read:jira-work
external:
fetch:
backend:- https://.atlassian.net/
- https://:/
- read:jira-work
- see “src/index.jsx”:
import api from “@forge/api”;
import {
render,
IssueGlance,
Fragment,
useState,
Code,
} from “@forge/ui”;
const App = () => {
const [data] = useState(async () => {
console.log(data);
const response = await api
.asApp()
.withProvider("external-server", "api-server")
.fetch("/api/User/");
return await response.json();
});
return (
<Code text={JSON.stringify(data, null, 2)} language=“json”>
);
};
export const runApp = render(
);
These are the key articles I used while trying to adapt to my needs, despite the forge developer documentaions:
https://developer.atlassian.com/platform/forge/use-an-external-oauth-2.0-api-with-fetch/
and New: Forge External Authentication Makes Outbound OAuth Easy - Atlassian Developer Blog
What exactly is the problem?
Is it the “manifest.yml”?
Is it the “src/index.jsx”?
Is it the docker container, because “forge tunnel” linting is different from using “forge lint”?
Is it the “forge tunnel” npm package according to the App errorr?
Why is “forge logs” not showing anything at all?
This way I can’t seem to debug and fix this!
Please help, Atlassian and support to make Forge DX a breeze!
Thank you very much!
Cheers, Marco