Azure / Azure/api-management-developer-portal
'uid'-type SharedAccessSignature won't parse
- Dominant language
- TypeScript
- Stars
- 545
- Forks
- 360
- PR merge metrics
- No merged PRs in 30d
Description
## Bug description
Generating a SAS token like here https://docs.microsoft.com/en-us/rest/api/apimanagement/apimanagementrest/azure-api-management-rest-api-authentication#ProgrammaticallyCreateToken, with this format will not pass:
`SharedAccessSignature uid=53dd860e1b72ff0467030003&ex=2014-08-04T22:03:00.0000000Z&sn=ItH6scUyCazNKHULKA0Yv6T+Skk4bdVmLqcPPPdWoxl2n1+rVbhKlplFrqjkoUFRr0og4wjeDz4yfThC82OjfQ==`
It doesn't validate over: https://github.com/Azure/api-management-developer-portal/blob/51ec561561a7acbb43d6595e16c40f8118162618/src/authentication/accessToken.ts#L40
SAS token does work for other API calls as it's correctly formatted for the Management API.
Returns `Error: SharedAccessSignature token format is not valid.`
Related to https://github.com/Azure/api-management-developer-portal/issues/689 but never solved.
Using commit: https://github.com/Azure/api-management-developer-portal/releases/tag/2.19.0
Contributor guide
No contributing guide indexed for this repository
Research direction
Reproduce the failure with the documented SharedAccessSignature value, then inspect src/authentication/accessToken.ts at the validation logic around line 40. Confirm the parser accepts the uid-type token while retaining validation for the other token fields, and verify the affected API call no longer reports an invalid token format.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- azure, typescript
- Domain
- api, authentication
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100