Kong / Kong/insomnia

ASAP Auth mechanism returns an error: secretOrPrivateKey must be an asymmetric key when using RS256

Open
#6,506 0 comments 0 reactions 0 assignees View on GitHub
B-bug N-investigation S-unverified
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)
```

![image](https://github.com/Kong/insomnia/assets/21019116/33b91bfe-81ee-4694-9c85-301f9ae60969)

### 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

Open the contributing 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.