ASAP Auth mechanism returns an error: secretOrPrivateKey must be an asymmetric key when using RS256
- Dominant language
- TypeScript
- Stars
- 40k
- Forks
- 2.4k
- Avg merge
- 2d 13h
- Merged PRs (30d)
- 61
Description
### Expected Behavior
Should be able to authenticate with ASAP enabled end-point and get the response.
### Actual Behavior
I get the following error message
Application Error
Failed to render
```
Error: secretOrPrivateKey must be an asymmetric key when using RS256 at Object.My [as sign]
(file:///Applications/Insomnia.app/Contents/Resources/app.asar/index-535d27ae.js:29:14099) at E
(file:///Applications/Insomnia.app/Contents/Resources/app.asar/index-535d27ae.js:30:471) at Module.Ky
(file:///Applications/Insomnia.app/Contents/Resources/app.asar/index-535d27ae.js:30:496) at kR
(file:///Applications/Insomnia.app/Contents/Resources/app.asar/index-f89f6e08.js:88:5066) at async xR
(file:///Applications/Insomnia.app/Contents/Resources/app.asar/index-f89f6e08.js:84:31972) at async Module.ge
(file:///Applications/Insomnia.app/Contents/Resources/app.asar/request-f947c2e3.js:1:7493) at async Xl
(file:///Applications/Insomnia.app/Contents/Resources/app.asar/index-f89f6e08.js:31:3691) at async je
(file:///Applications/Insomnia.app/Contents/Resources/app.asar/index-f89f6e08.js:30:18468)
```

### Reproduction Steps
1. Set Auth mechanism to ASAP
2. Generate private key as a data-uri
3. Enter ISS, AUD, KID and Private Key
4. Invoke the rest endpoint enabled with ASAP authentication.
### Is there an existing issue for this?
- [X] I have searched the [issue tracker](https://www.github.com/Kong/insomnia/issues) for this problem.
### Additional Information
_No response_
### Insomnia Version
2023.5.8
### What operating system are you using?
macOS
### Operating System Version
13.5.2
### Installation method
download from insomnia.rest
### Last Known Working Insomnia version
2023.2.2
Contributor guide
Research direction
Reproduce the failure with ASAP authentication using the listed steps, then trace the signing path through the bundled entry points index-535d27ae.js and index-f89f6e08.js. Confirm that an endpoint using RS256 and a private-key data URI authenticates successfully without the asymmetric-key error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- api, authentication
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100