All Projects → TransEmpiric → Webfluxtemplate

TransEmpiric / Webfluxtemplate

Licence: mit
Spring Webflux template application with working Spring Security, Web-sockets, Rest, Web MVC, and Authentication with JWT.

Programming Languages

68154 projects - #9 most used programming language
65 projects

Projects that are alternatives of or similar to Webfluxtemplate

A demonstration of a completely stateless and RESTful token-based authorization system using JSON Web Tokens (JWT) and Spring Security.
Stars: ✭ 482 (+350.47%)
Mutual labels:  restful-api, spring-boot, spring, spring-security, json-web-token
mall项目是一套电商系统,包括前台商城系统及后台管理系统,基于SpringBoot+MyBatis实现,采用Docker容器化部署。 前台商城系统包含首页门户、商品推荐、商品搜索、商品展示、购物车、订单流程、会员中心、客户服务、帮助中心等模块。 后台管理系统包含商品管理、订单管理、会员管理、促销管理、运营管理、内容管理、统计报表、财务管理、权限管理、设置等模块。
Stars: ✭ 54,797 (+51112.15%)
Mutual labels:  mongodb, spring-boot, spring, spring-security
Spring Boot Webflux Jjwt
Example Spring Boot and WebFlux (Reactive Web) with Spring Security and JWT for token Authentication and Authorization
Stars: ✭ 71 (-33.64%)
Mutual labels:  reactive, spring-boot, spring, spring-security
Spring Boot Demo
Spring Boot & Spring Cloud & Spring Security Demo Case(Spring学习示例实战项目)
Stars: ✭ 255 (+138.32%)
Mutual labels:  mongodb, spring-boot, spring, websocket
Java course materials
Stars: ✭ 293 (+173.83%)
Mutual labels:  gradle, spring-boot, spring, websocket
Springboot Starterkit
Starter Kit for Spring Boot based (REST APIs and WebMVC) micro services.
Stars: ✭ 596 (+457.01%)
Mutual labels:  mongodb, spring-boot, spring, spring-security
Spring Webflux Security Jwt
A JWT authorization and authentication implementation with Spring Reactive Webflux, Spring Boot 2 and Spring Security 5
Stars: ✭ 190 (+77.57%)
Mutual labels:  reactive, spring-boot, spring-security, jwt-authentication
Java Spring Cloud
Distributed tracing for Spring Boot, Cloud and other Spring projects
Stars: ✭ 326 (+204.67%)
Mutual labels:  mongodb, spring-boot, spring, websocket
Stars: ✭ 309 (+188.79%)
Mutual labels:  gradle, spring-boot, spring, websocket
Springboot Jwt Starter
A Spring Boot JWT starter kit for stateless and token-based authentication apps.
Stars: ✭ 538 (+402.8%)
Mutual labels:  spring-boot, spring, spring-security, jwt-authentication
Hex Arch Kotlin Spring Boot
Reference JVM multi module project for a reactive micro service and lambda using a hexagonal architecture, DDD, Kotlin, Spring Boot, Quarkus, Lambda, Gradle.
Stars: ✭ 83 (-22.43%)
Mutual labels:  gradle, reactive, spring-boot, spring
Eshop Soa
Stars: ✭ 65 (-39.25%)
Mutual labels:  spring-boot, spring, spring-security
Microservices Example
Example of a microservices architecture on the modern stack of Java technologies
Stars: ✭ 66 (-38.32%)
Mutual labels:  gradle, spring-boot, microservices-architecture
Sample Boot Hibernate
Spring Boot + JPA ( Hibernate ) + Java8 [ DDD Sample ]
Stars: ✭ 97 (-9.35%)
Mutual labels:  gradle, spring-boot, spring-security
RESTFeel: 一个企业级的API管理&测试平台。RESTFeel帮助你设计、开发、测试您的API。
Stars: ✭ 59 (-44.86%)
Mutual labels:  restful-api, gradle, mongodb
Springboot security restful api
SpringBoot + SpringSecurity + RESTful API --- Maven Project Demo
Stars: ✭ 68 (-36.45%)
Mutual labels:  restful-api, spring-boot, spring-security
Spring Cloud Microservices Development
Spring Cloud Microservices Development.《Spring Cloud 微服务架构开发实战》
Stars: ✭ 106 (-0.93%)
Mutual labels:  gradle, spring-boot, spring
Okta Blog Archive
Okta Developer Blog
Stars: ✭ 74 (-30.84%)
Mutual labels:  gradle, spring-boot, spring
Awbeci Ssb
spring spring-boot spring-security spring-social
Stars: ✭ 102 (-4.67%)
Mutual labels:  spring-boot, spring, spring-security
Spring Boot based production grade starter kit.
Stars: ✭ 59 (-44.86%)
Mutual labels:  spring-boot, spring, spring-security

Spring 5 Webflux Template

This code can be used to build the next generation of applications using micro-services, reactive programing, webs-sockets, rest, mongoDB, JWT (JSON Web Tokens) and Netty.

What is this again?

This is a complete template example for Spring 5 Webflux. The application shows how to use Spring 5 Webflux with Spring Security, web-sockets, @RestContorler, @Controller, Reactive MongoDB, and JWT.

Spring 5 is still new. There are very few examples of how to use Spring Security with the Webflux stack. Reactive Oauth2 support is not ready yet. This application roles it's own Oauth2 like api with JWT tokens. This app has integrated web-sockets and rest services into the Reactive Spring Security implementation.


MongoDB is used for this example, so you'll need this up and running on your local machine, if you are on OSX, you can easily install MongoDB using Homebrew. The MongoDB config is defined in application.yml.

Running locally

	git clone
	cd webFluxTemplate
	./gradlew bootRun

If everything goes well you can go to the Secure Web-socket Example page http://localhost:8443/test/ws

Get a JWT for authentication



Request headers:

content-type: application/json


{"username" : "jdev", "password":"jdev"}


"token": "eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJqZGV2IiwiYXVkIjoidW5rbm93biIsImV4cCI6MjEyMTcwNzgyMiwiaWF0IjoxNTE2OTA3ODIyfQ.TVwbWsz-BDfMQmgUDnB_GloXklEdS_ABMiF9iGzHrBNA1f4yOQb3day7vcFLNxcLefkQjZDlVlpU91AtkzQqLg",
"username": "jdev"

Use JWT on a secure rest endpoint



Request headers:

Content-Type: application/json
Authorization: Bearer eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJqZGV2IiwiYXVkIjoidW5rbm93biIsImV4cCI6MjEyMTcwNzgyMiwiaWF0IjoxNTE2OTA3ODIyfQ.TVwbWsz-BDfMQmgUDnB_GloXklEdS_ABMiF9iGzHrBNA1f4yOQb3day7vcFLNxcLefkQjZDlVlpU91AtkzQqLg


      "email":"[email protected]",

Use JWT on a secure web-socket endpoint

Go to http://localhost:8443/test/ws in a browser. JWT is hard coded in the JS within templates/websocket.ftl You need to replace with a new token if the hard coded token has expired

    <script type="application/javascript">
        // Use wss:// for HTTPS
        var socket = new WebSocket("ws://" + + "/api/ws/echotest?token=eyJhbGciOiJIUzUxMiJ9.eyJzdWIiOiJqZGV2IiwiYXVkIjoidW5rbm93biIsImV4cCI6MjEyMTYwODkyMywiaWF0IjoxNTE2ODA4OTIzfQ.QdSkOuGb8tp1QKjRKzUPlUqobNzF0PuDNk4Y7qAXqrVdbVaKiNJPalxUYapDoeQxE_Dz9WqhdrpdLpGQnlgkkw");

        addEvent("keypress", document.getElementById('input'), function(event) {
        var output = document.getElementById("output");
        socket.onmessage = function(e) {
            output.innerHTML = output.innerHTML +;


Properties are in application.yml
You can set to HTTPS (test cert works) if you want, but make sure to update the call to web-socket endpoints with "wss://"


Verify password at auth end point with CustomPasswordEncoder
Make a UI for example token retrieval and a UI to use it
Finish Refresh Token code
Add React and/or Angular Front-end example to repo
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].