๐ stack-overflow: Use built in fetch to ensure correct authentication is used
ScottGuymer opened this issue ยท 1 comments
Plugin Name
stack-overflow
๐ Description
We have a private stackoverflow for teams instance.
To enable this plugin to work we configure a proxy config in backstage that injects authentication to the SO API.
The frontend SO plugin then uses this proxy API to speak to SO.
With authentication on proxy APIs now being default it causes errors as this plugin does not inject the authentication and the proxy api returns a 401.
๐ Expected behavior
The plugin should use the built in fetch API that will detect that a proxy request is being made back to backstage itself and inject the correct auth.
The line here -
https://github.com/backstage/community-plugins/blob/main/workspaces/stack-overflow/plugins/stack-overflow/src/api/StackOverflowClient.ts#L51 needs to be updated to use the backstage FetchAPI which should automatically detect that it is calling backstage itself and inject the correct authentication.
In line with https://backstage.io/docs/architecture-decisions/adrs-adr013/
๐ Actual Behavior with Screenshots
Proxy returns 401 and the plugin shows no questions.
๐ Reproduction steps
- Create proxy configuration for SO
- try and retrieve questions from this via the plugin
๐ Provide the context for the Bug.
No response
๐ Have you spent some time to check if this bug has been raised before?
- I checked and didn't find similar issue
๐ข Have you read the Code of Conduct?
- I have read the Code of Conduct
Are you willing to submit PR?
Yes I am willing to submit a PR!