stutzlab / userme

Userme gives you a bunch of API services for basic account creation, token validation, user authentication, password reset, mail validation etc
MIT License
1 stars 1 forks source link

userme

Userme gives you a bunch of API services for basic account creation, token validation, user authentication, password reset, mail validation etc

See a full usage example at http://github.com/stutzlab/userme-demo-ui.

New Account with local password

Facebook signin support

Google signin support

Basics

Usage

version: '3.6'

services:

  userme:
    image: stutzlab/userme
    ports:
      - "7000:7000"
    restart: always
    environment:
      - LOG_LEVEL=debug
      - DB_DIALECT=sqlite3
      - MAIL_SMTP_HOST=mailslurper
      - MAIL_SMTP_PORT=2500
      - MAIL_SMTP_USER=test
      - MAIL_SMTP_PASS=test
      - MAIL_FROM_NAME=Berimbal
      - MAIL_FROM_ADDRESS=test@test.com
      - MAIL_ACTIVATION_SUBJECT=Activate your account at Berimbau.com!
      - MAIL_ACTIVATION_HTML=<b>Hi DISPLAY_NAME</b>, <p> <a href=https://test.com/activate?t=ACTIVATION_TOKEN>Click here to complete your registration</a><br>Be welcome!</p> <p>-Test Team.</p>
      - MAIL_PASSWORD_RESET_SUBJECT=Password reset requested at Berimbau.com
      - MAIL_PASSWORD_RESET_HTML=<b>Hi DISPLAY_NAME</b>, <p> <a href=https://test.com/reset-password?t=PASSWORD_RESET_TOKEN>Click here to reset your password</a></p><p>-Test Team.</p>
      - MAIL_TOKENS_FOR_TESTS=true
      - ACCOUNT_ACTIVATION_METHOD=mail
      - JWT_SIGNING_METHOD=ES256
    secrets:
      - jwt-signing-key

  mailslurper:
    image: marcopas/docker-mailslurper
    ports:
      - "8080:8080"
      - "8085:8085"
      - "2500:2500"
    restart: always

secrets:
  jwt-signing-key:
    file: ./tests/test-key.pem
curl -v --location --request PUT 'http://localhost:7000/user/test1@test.com' \
--header 'Content-Type: application/json' \
--data-raw '{
    "password": "testtest",
    "name": "test1@test.com"
}'
curl -v --location --request POST 'http://localhost:7000/user/test1@test.com/activate' \
--header 'Authorization: Bearer <TOKEN FROM MAIL LINK>'
curl -v --location --request POST 'http://localhost:7000/token' \
--header 'Content-Type: application/json' \
--data-raw '{
    "email": "test1@test.com",
    "password": "testtest"
}'
curl --location --request GET 'http://localhost:7000/token' \
--header 'Authorization: Bearer <TOKEN FROM POST /token>'

Rest API

ENVs

Volume

Development Tips

JWT Keys

TBD

Postman files

Social logins