All Projects → tinmegali → Oauth2-Stateless-Authentication-with-Spring-and-JWT-Token

tinmegali / Oauth2-Stateless-Authentication-with-Spring-and-JWT-Token

Licence: MIT license
Oauth2 Stateless Authentication with Spring and JWT Token

Programming Languages

java
68154 projects - #9 most used programming language
shell
77523 projects
Batchfile
5799 projects

Projects that are alternatives of or similar to Oauth2-Stateless-Authentication-with-Spring-and-JWT-Token

Cloud-Native-App-Spring-Boot
A Cloud Native App with Spring Coud Security with KeyCloak Auth Server, API Gateway Server, Naming Server, Config Server and Distributed Tracing and ELK Stack hosted in K8s
Stars: ✭ 19 (-82.41%)
Mutual labels:  spring-security, spring-security-oauth2
springboot-vue.js-bbs
Spring Boot, Vue.js
Stars: ✭ 43 (-60.19%)
Mutual labels:  spring-security, spring-security-oauth2
Diber-backend
Delivery Service - Spring Boot / Spring Data Jpa / Hibernate / PostgreSQL / OAuth2 Application
Stars: ✭ 22 (-79.63%)
Mutual labels:  spring-security, spring-security-oauth2
okta-jhipster-microservices-oauth-example
A microservices architecture built with JHipster, OAuth 2.0, and Okta
Stars: ✭ 29 (-73.15%)
Mutual labels:  spring-security, spring-security-oauth2
oauth-boot
spring-boot and spring oauth2
Stars: ✭ 111 (+2.78%)
Mutual labels:  spring-security, spring-security-oauth2
MyNewProject
Legacy Spring MVC
Stars: ✭ 19 (-82.41%)
Mutual labels:  spring-security, spring-security-oauth2
okta-spring-boot-authz-server-example
Spring Security OAuth 2.0 Guide
Stars: ✭ 60 (-44.44%)
Mutual labels:  spring-security, spring-security-oauth2
spring-boot-elk
An sample todo app demonstrating centralised logging using ELK stack
Stars: ✭ 20 (-81.48%)
Mutual labels:  spring-security, h2-database
spring-security-oauth2-client-example
Minimal configuration required for a Spring Boot project using Spring Security with OAuth2 client
Stars: ✭ 20 (-81.48%)
Mutual labels:  spring-security, spring-security-oauth2
Castle Platform
Castle-Platform是一个以高性能、高扩展性为目标的java开发平台。它是spring-mvc, spring-data, spring-security, Querydsl, JPA, Redis, Mongodb, Neo4j, groovy-template, Thymeleaf, ExtJS6, dubbo, thrift的最佳实践。
Stars: ✭ 197 (+82.41%)
Mutual labels:  spring-security
Tutorial
Spring Boot的例子,包含RESTful API, MVC, JMS, Cache, Mybatis, Cache, Websocket...
Stars: ✭ 215 (+99.07%)
Mutual labels:  spring-security
Oauth2 Family Barrel
OAuth2全家桶项目。本项目演示了如何使用spring-boot、spring-security以及spring-security-oauth快速构建OAuth2服务框架体系。
Stars: ✭ 188 (+74.07%)
Mutual labels:  spring-security
Springcloud Shop
基于Spring Boot、Spring Cloud的微服务商城demo
Stars: ✭ 198 (+83.33%)
Mutual labels:  spring-security
Gs Securing Web
Securing a Web Application :: Learn how to protect your web application with Spring Security.
Stars: ✭ 218 (+101.85%)
Mutual labels:  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 (+75.93%)
Mutual labels:  spring-security
Eladmin
项目基于 Spring Boot 2.1.0 、 Jpa、 Spring Security、redis、Vue的前后端分离的后台管理系统,项目采用分模块开发方式, 权限控制采用 RBAC,支持数据字典与数据权限管理,支持一键生成前后端代码,支持动态路由
Stars: ✭ 16,943 (+15587.96%)
Mutual labels:  spring-security
Awesome Spring
A curated list of awesome books, tutorials, courses, and resources for the Spring framework ecosystem.
Stars: ✭ 186 (+72.22%)
Mutual labels:  spring-security
Mcloud
基于Spring Cloud,实现微服务中常用的基础模块,包括 OAuth2 认证服务,统一注册中心,系统监控中心, 统一配置中心,API网关以及熔断器
Stars: ✭ 185 (+71.3%)
Mutual labels:  spring-security
SpringBoot-JSP-CRUD-Application
No description or website provided.
Stars: ✭ 14 (-87.04%)
Mutual labels:  h2-database
Sureness
A simple and efficient open-source security framework that focus on protection of restful api.
Stars: ✭ 254 (+135.19%)
Mutual labels:  spring-security

Oauth2 Stateless Authentication with Spring and JWT Token

This project uses Spring Security to authenticate and protect some Rest resources. It uses withAuthorizationServerConfigurerAdapter, ResourceServerConfigurerAdapter and WebSecurityConfigurerAdapter combined with @PreAuthorize to configure the security. It also uses an H2 embeded database to authenticate the users.

Article on the project

USING SPRING OAUTH2 TO SECURE REST

External references

This project was inspired by all these references.
  • Using JWT with Spring Security OAuth
  • JWT authentication with Spring Web
  • JWT Authentication Tutorial: An example using Spring Boot
  • Spring Oauth2 with JWT Sample
  • OAuth2 in depth: A step-by-step introduction for enterprises
  • spring-auth-example

    To Build and Run

    Go to the cloned directory and run mvn spring-boot:run or build with your chosen IDE.

    Curl Commands

    You should install ./JQ before running these Curl commands.
    To get a new token
    curl trusted-app:secret@localhost:8080/oauth/token -d "grant_type=password&username=user&password=password" | jq
    To get a refresh token
    curl trusted-app:secret@localhost:8080/oauth/token -d "grant_type=access_token&access_tokem=[ACCESS_TOKEN]" | jq
    To access a protected resource
    curl -H "Authorization: Bearer [ACCESS_TOKEN]" localhost:8080/api/hello

    Register new Account
    curl -H "Authorization: Bearer $(curl register-app:secret@localhost:8080/oauth/token -d "grant_type=client_credentials&client_id=register-app" | jq --raw-output ."access_token")" localhost:8080/api/register -H "Content-Type: application/json" -d '{"username":"new-user","password":"password","firstName":"First","lastName":"Last","email":"[email protected]"}' | jq

    Curl sample commands api/me curl -H "Authorization: Bearer $(curl trusted-app:secret@localhost:8080/oauth/token -d "grant_type=password&username=user&password=password" | jq --raw-output ."access_token")" localhost:8080/api/me | jq

  • 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].