All Projects → ninrod → exposed-ktor-jwt

ninrod / exposed-ktor-jwt

Licence: other
example of an exposed+ktor+jwt secured kotlin app sporting an angular frontend

Programming Languages

typescript
32286 projects
kotlin
9241 projects
HTML
75241 projects
javascript
184084 projects - #8 most used programming language
CSS
56736 projects
Makefile
30231 projects
shell
77523 projects

Projects that are alternatives of or similar to exposed-ktor-jwt

sails-jwt-login
How to implement login with JWT (JSON Web Tokens) in Sails 1.0
Stars: ✭ 18 (-14.29%)
Mutual labels:  jwt-authentication, jwt-server
kotlin-ktor-realworld-example-app
Real world backend API built in Kotlin with Ktor + Kodein + Exposed
Stars: ✭ 117 (+457.14%)
Mutual labels:  exposed, ktor
ktor-hexagonal-benchmark
a experimental ktor application using hexagonal architecture
Stars: ✭ 32 (+52.38%)
Mutual labels:  exposed, ktor
CleanArchitecture
Kotlin backend based on the Clean Architecture principles. Ktor, JWT, Exposed, Flyway, OpenAPI/REST & KGraphQL/GraphQL generated endpoints, Gradle.
Stars: ✭ 271 (+1190.48%)
Mutual labels:  exposed, ktor
jwt-auth
🔐 JSON Web Token Authentication for Laravel & Lumen
Stars: ✭ 525 (+2400%)
Mutual labels:  jwt-authentication
CUMS DBMS
🏰 A College Management Site (DBMS) using Node and Mysql.
Stars: ✭ 28 (+33.33%)
Mutual labels:  jwt-authentication
Scout
Scout is a kotlin multiplatform application that allows users to search and save games to lists to be browsed later.
Stars: ✭ 28 (+33.33%)
Mutual labels:  ktor
Metis
测试题小程序 包含后端api接口 可能会改成gitbook应用了吧
Stars: ✭ 79 (+276.19%)
Mutual labels:  jwt-authentication
ktfunctional
a functional library for kotlin(android)
Stars: ✭ 19 (-9.52%)
Mutual labels:  ktor
Vapor-JWTAuthorization
Vapor JWT Authorization
Stars: ✭ 45 (+114.29%)
Mutual labels:  jwt-authentication
banking
Course files
Stars: ✭ 80 (+280.95%)
Mutual labels:  jwt-authentication
Lavalink.kt
Coroutine based client for Lavalink (Kotlin and Java)
Stars: ✭ 31 (+47.62%)
Mutual labels:  ktor
obsidian
◼️ A standalone audio sending node for music bots.
Stars: ✭ 22 (+4.76%)
Mutual labels:  ktor
mesan-nodejs-auth-crud-api
NodeJS Authentication and CRUD operations API -: Email Verification, Image Upload, Password Reset
Stars: ✭ 72 (+242.86%)
Mutual labels:  jwt-authentication
spring-boot-refresh-token-jwt
Spring Boot Refresh Token using JWT example - Expire and Renew JWT Token
Stars: ✭ 156 (+642.86%)
Mutual labels:  jwt-authentication
MinimalApi
ASP.NET Core 7.0 - Minimal API Example - Todo API implementation using ASP.NET Core Minimal API, Entity Framework Core, Token authentication, Versioning, Unit Testing, Integration Testing and Open API.
Stars: ✭ 156 (+642.86%)
Mutual labels:  jwt-authentication
ktor-features-zipkin
A Ktor feature that handles Open Zipkin tracing IDs
Stars: ✭ 15 (-28.57%)
Mutual labels:  ktor
gorest
Go RESTful API starter kit with Gin, JWT, GORM (MySQL, PostgreSQL, SQLite), Redis, Mongo, 2FA, email verification, password recovery
Stars: ✭ 135 (+542.86%)
Mutual labels:  jwt-authentication
jwt-auth
WordPress JSON Web Token Authentication
Stars: ✭ 85 (+304.76%)
Mutual labels:  jwt-authentication
ThinkRchive
An app showing all details for various Lenovo Thinkpad models. Made to try out Jepack Compose for Android.
Stars: ✭ 84 (+300%)
Mutual labels:  ktor

exposed-ktor-jwt

  • postgresql database running in docker for the local dev environment with configurable sql schema.
  • kotlin backend using: Jetbrains’ Exposed and Ktor. Kluent and Junit5 for tests.
  • backend secured with jwt tokens. It both creates and validates the tokens on selected routes.
  • frontend: angular 7 + angular material

Build

backend

$ cd backend && gradle build

frontend

$ cd frontend && yarn && yarn build

Execute

when using an IDE for kotlin (e.g. jetbrains’ Intellij)

  • boot the database with make db in the root dir
  • execute the main function (in main.kt)
  • cd frontend && yarn start
  • check localhost:4200

running the whole project in docker

  • build the backend: cd backend && gradle build
  • build the frontend: cd frontend && yarn && yarn build
  • go to the root dir and issue: make
  • note: you must have docker and docker-compose installed
  • check localhost:4200

Test the endpoints

testing the /secret endpoint with postman

  • see this so question
  • basically you have to issue a GET request containing a header row like this:
Key: 'Authorization'
Value: Bearer 'yourjwttokenASDFASDFdsfasdfDSAFasdfADfADfASdafAsdFASDF'

testing the /secret endpoint with curl

step 01: obtain and stash the token throught the /login endpoint

$ TOKEN=$(curl -s -X POST -d '{"name" : "alice", "password": "secret"}' -H "Content-Type: application/json"  localhost:8080/login | jq -r '.token')

step 02 issue a GET /secret with a header containing the token

$ curl -H 'Accept: application/json' -H "Authorization: Bearer ${TOKEN}" https://localhost:8080/secret

LICENSE

GNU General Public License v3
Copyright (c) 2019-2021 Filipe Silva (ninrod)
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].