Sign inSign up

nvcnvn/fake_token

By nvcnvn

•Updated over 7 years ago

Image
0

2.4K

nvcnvn/fake_token repository overview

This docker image use for testing application using JWT and x509 certs endpoint, something like Google Firebase authentication.
Github repo: https://github.com/nvcnvn/fake_token⁠

⁠Usage

docker pull nvcnvn/fake_token:1.0.0
docker run --name test_name -it -p 8080:8080 nvcnvn/fake_token:1.0.0
  • Certs endpoint: http://localhost:8080/robot/v1/metadata/x509/[email protected]⁠
  • Token generate endpoint: http://localhost:8080/token⁠ with parameters:
    • kid: specific the key (returned from certs endpoint) for signing, if not set then use a random key to sign
    • IssuerPrefix: usage in token template
    • Audience: usage in token template
    • AuthTime: if not set UnixSecond(now - 1 min)
    • UserID: if not set UnixNano(now)
    • IssueAt: if not set UnixSecond(now)
    • Expiration: if not set UnixSecond(now + 1 hour)
    • PhoneNumber: if not set "+84"+UnixSecond(now)

⁠Config

ENV PORT=":8080"
ENV KEYS_PATTERN="./private_pems/*.pem"
ENV TOKEN_TEMPLATE="./token.template"

Tag summary

Content type

Image

Digest

Size

7.9 MB

Last updated

over 7 years ago

docker pull nvcnvn/fake_token:1.0.0