Product
Introducing SSO
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
jwt-mock-server
Advanced tools
Readme
npm install
npm run start
## OR
npm run start -- --claims '{"username": "test@test.com", "userId": 1, "authorities": ["AUTH_1"]}'
default port 9000
npx --package jwt-mock-server start
to run in a different port 3000
PORT=3000 npx --package jwt-mock-server start
curl --location --request GET 'localhost:9000/jwt/.well-known/jwks.json'
get a jwt token and pass claims in post body
curl --location --request POST 'localhost:9000/jwt/token' \
--header 'Content-Type: application/json' \
--data-raw '{"username": "user1@test.com"}'
get a jwt using get and pass claims in query params:
curl --location --request GET 'localhost:9000/jwt/token?username=abc@test.com.au&authorities=AUTH_WP&authorities=AUTH_WP2' \
--header 'Content-Type: application/json'
or you can get the default claims, the default claims needs to be passed when you start the server
npx --package github:ruiyang/jwt-mock-server start --claims '{"username": "test-user@test.com"}'
curl --location --request GET 'localhost:9000/jwt/token' \
--header 'Content-Type: application/json'
shutdown the server gracefully
curl --location --request GET 'localhost:9000/shutdown'
FAQs
Start a mock jwt authentication server for local development
The npm package jwt-mock-server receives a total of 23 weekly downloads. As such, jwt-mock-server popularity was classified as not popular.
We found that jwt-mock-server demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Product
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.