You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
LOGIN_TOKEN: sign a JWT for the login request (noon Partner API) #1235
Some APIs log in with a JWT the client signs itself, instead of a password. noon's Partner API (the marketplace seller API of noon.com, UAE/KSA/Egypt) works this way (Authenticating requests, APILogin):
The seller downloads a service account key (key_id, private_key, project_code).
The client signs an RS256 JWT with sub = key_id, iat = now in whole seconds and a fresh jti, one per login.
POST https://noon-api-gateway.noon.partners/identity/public/v1/api/login with {"token": "<jwt>", "default_project_code": "..."}.
The session comes back as cookies; every later call sends them, plus a User-Agent.
LOGIN_TOKEN already covers steps 3 and 4 (tokenSource: "cookie", cookieMode: "all", re-login on 401). The engine can already sign JWTs (client-assertion.util.ts, RS256/RS384/RS512/PS256/ES256/ES384), but only as an OAuth2 private_key_jwt client assertion. So a noon adapter is not possible today without an external proxy that signs for us.
Proposal
An optional signedJwt block in a LOGIN_TOKEN authConfig:
A fresh JWT is signed for every login (iat = now in seconds, random jti, the configured claims; exp only when ttlSeconds is set) and is available to loginBody as ${signedJwt}.
The key is parsed like the client assertion key (PEM PKCS#1/PKCS#8/SEC1, single-line pastes, clear errors that never contain key material); the signer is shared with client-assertion.util.ts.
username / password are not required when signedJwt is set.
Nothing changes for existing LOGIN_TOKEN connectors.
Cloud and self-hosted behave the same: the signing happens in the backend that runs the connector; the key is stored encrypted like any other credential.
First user
A noon-marketplace catalog adapter (catalog, content, offers, pricing, stock, warehouses, FBPI orders and shipments, exports), writes installed switched off where they change prices, stock or orders.
Activity
Let LOGIN_TOKEN sign a JWT for the login request (#1235)
Add the noon Marketplace adapter (#1235)