All Projects → keets2012 → Auth Service

keets2012 / Auth Service

Licence: mit
spring security + oauth2.0 + jwt

Programming Languages

java
68154 projects - #9 most used programming language

Projects that are alternatives of or similar to Auth Service

Mcloud
基于Spring Cloud,实现微服务中常用的基础模块,包括 OAuth2 认证服务,统一注册中心,系统监控中心, 统一配置中心,API网关以及熔断器
Stars: ✭ 185 (-70.26%)
Mutual labels:  spring-cloud, oauth2, spring-security
Sample Spring Oauth2 Microservices
some examples that show basic and more advanced implementations of oauth2 authorization mechanism in spring-cloud microservices environment
Stars: ✭ 109 (-82.48%)
Mutual labels:  spring-cloud, oauth2, spring-security
Spring Boot Demo
spring boot demo 是一个Spring Boot、Spring Cloud的项目示例,根据市场主流的后端技术,共集成了30+个demo,未来将持续更新。该项目包含helloworld(快速入门)、web(ssh项目快速搭建)、aop(切面编程)、data-redis(redis缓存)、quartz(集群任务实现)、shiro(权限管理)、oauth2(四种认证模式)、shign(接口参数防篡改重放)、encoder(用户密码设计)、actuator(服务监控)、cloud-config(配置中心)、cloud-gateway(服务网关)等模块
Stars: ✭ 323 (-48.07%)
Mutual labels:  spring-cloud, oauth2, spring-security
Spring Cloud Security
Security concerns for distributed applications implemented in Spring
Stars: ✭ 488 (-21.54%)
Mutual labels:  microservices, spring-cloud, oauth2
Java Microservices Examples
Java Microservices: Spring Boot, Spring Cloud, JHipster, Spring Cloud Config, and Spring Cloud Gateway
Stars: ✭ 194 (-68.81%)
Mutual labels:  microservices, spring-cloud, oauth2
Okta Blog Archive
Okta Developer Blog
Stars: ✭ 74 (-88.1%)
Mutual labels:  microservices, spring-cloud, oauth2
Api Boot
“ ApiBoot”是为接口服务而生的,基于“ SpringBoot”完成扩展和自动配置,内部封装了一系列的开箱即用Starters。
Stars: ✭ 460 (-26.05%)
Mutual labels:  spring-cloud, oauth2, spring-security
Learning Path Spring Boot Microservices
Curated path for learning Spring Boot & Microservices based on published videos in TechPrimers
Stars: ✭ 116 (-81.35%)
Mutual labels:  microservices, spring-cloud, spring-security
Microservices Platform
基于SpringBoot2.x、SpringCloud和SpringCloudAlibaba并采用前后端分离的企业级微服务多租户系统架构。并引入组件化的思想实现高内聚低耦合,项目代码简洁注释丰富上手容易,适合学习和企业中使用。真正实现了基于RBAC、jwt和oauth2的无状态统一权限认证的解决方案,面向互联网设计同时适合B端和C端用户,支持CI/CD多环境部署,并提供应用管理方便第三方系统接入;同时还集合各种微服务治理功能和监控功能。模块包括:企业级的认证系统、开发平台、应用监控、慢sql监控、统一日志、单点登录、Redis分布式高速缓存、配置中心、分布式任务调度、接口文档、代码生成等等。
Stars: ✭ 3,274 (+426.37%)
Mutual labels:  microservices, spring-cloud, oauth2
Taroco
整合Nacos、Spring Cloud Alibaba,提供了一系列starter组件, 同时提供服务治理、服务监控、OAuth2权限认证,支持服务降级/熔断、服务权重,前端采用vue+elementUI+webpack,可以很好的解决转向Spring Cloud的一系列问题。
Stars: ✭ 545 (-12.38%)
Mutual labels:  spring-cloud, oauth2, spring-security
Spring Cloud Bus
Spring Cloud event bus
Stars: ✭ 342 (-45.02%)
Mutual labels:  microservices, spring-cloud
Youlai Mall
youlai-mall 是基于Spring Boot 2.4、Spring Cloud 2020 & Alibaba、Vue、element-ui、uni-app快速构建的一套全栈开源商城平台,包括系统权限管理、微服务应用、微信小程序及APP应用
Stars: ✭ 331 (-46.78%)
Mutual labels:  spring-cloud, oauth2
His
HIS英文全称 hospital information system(医院信息系统http://59.110.234.89:9999/swagger-ui.html ),医疗信息就诊系统,系统主要功能按照数据流量、流向及处理过程分为临床诊疗、药品管理、财务管理、患者管理。诊疗活动由各工作站配合完成,并将临床信息进行整理、处理、汇总、统计、分析等。本系统包括以下工作站:门诊医生工作站、药房医生工作站、医技医生工作站、收费员工作站、对帐员工作站、管理员工作站。需求为东软提供的云医院。
Stars: ✭ 359 (-42.28%)
Mutual labels:  spring-cloud, spring-security
Go Api Boilerplate
Go Server/API boilerplate using best practices DDD CQRS ES gRPC
Stars: ✭ 373 (-40.03%)
Mutual labels:  microservices, oauth2
Sample Spring Microservices
Many samples in different branches that shows how to create microservices with Spring Boot, Spring Cloud, Zipkin, Zuul, Eureka, Hystrix, Kubernetes, Elastic Stack and many more tools
Stars: ✭ 368 (-40.84%)
Mutual labels:  microservices, spring-cloud
Spring Cloud Alibaba
Spring Cloud Alibaba provides a one-stop solution for application development for the distributed solutions of Alibaba middleware.
Stars: ✭ 20,934 (+3265.59%)
Mutual labels:  microservices, spring-cloud
Spring Cloud Netflix
Integration with Netflix OSS components
Stars: ✭ 4,498 (+623.15%)
Mutual labels:  microservices, spring-cloud
Nacos
an easy-to-use dynamic service discovery, configuration and service management platform for building cloud native applications.
Stars: ✭ 20,691 (+3226.53%)
Mutual labels:  microservices, spring-cloud
Springall
循序渐进,学习Spring Boot、Spring Boot & Shiro、Spring Batch、Spring Cloud、Spring Cloud Alibaba、Spring Security & Spring Security OAuth2,博客Spring系列源码:https://mrbird.cc
Stars: ✭ 22,375 (+3497.27%)
Mutual labels:  spring-cloud, spring-security
Spring Cloud Zookeeper
Spring Cloud Zookeeper
Stars: ✭ 481 (-22.67%)
Mutual labels:  microservices, spring-cloud

Build Status codebeat badge

change logs

  • 2018.9.1

    版本升到2.0-SNAPSHOT,欲使用sb1.5.x版本,请切换到TAG 1.0-RELEASE。by CANGWU

    Spring Cloud Security 升级到Finchley.RELEASE,Spring Boot由1.5.X升级到2.0.X。

        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-dependencies</artifactId>
            <version>Finchley.RELEASE</version>
       </dependency>
    
    <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>2.0.0.RELEASE</version>
    </parent>
    

quick start

本次对项目结构进行了更新,token的存储机制基于redis,当然存储方式可以自由切换,Spring Security提供了SPI的多种实现。

客户端的信息还是基于jdbc实现,所以需要导入项目中提供的表oauth_client_details

推荐首先阅读专栏文章:认证鉴权与API权限控制在微服务架构中的设计与实现

单独的整合项目地址为:
GitHub:https://github.com/keets2012/microservice-integration
或者 码云:https://gitee.com/keets/microservice-integration

maintainer

  • keets2012
  • CANGWU

password模式

项目克隆之后:

  1. 安装一下,mvn clean install
  2. 修改Auth项目中的配置文件,写了XXXX的地方,替换成自己的实际地址(redis和mysql)
  3. 数据库导入,sql脚本在项目中。创建auth数据库,运行auth.sql
  4. mvn clean spring-boot:run
  5. 其他细节参考博客
  6. 你的star是对我最好的鼓励^_^

进行请求获取Token授权: head form

笔者自己运行了结果如下:

{
    "access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJleHAiOjE1MDkwNzMzMjcsIlgtQU9ITy1Vc2VySWQiOiIxNGY1MmE0OS0yYTgxLTRhMmYtOGI5Mi01ZmU0NzUzZGRmZGEiLCJ1c2VyX25hbWUiOiIxODM2MjkxNjcyNiIsImp0aSI6IjM5NDEzN2I5LTNjZGItNGUyNy04NGRjLWM5YjEyYzk3ZTA4YyIsImNsaWVudF9pZCI6ImZyb250ZW5kIiwic2NvcGUiOlsiYWxsIl19.pGZhGNVECg0b4LB_pYXTTVKjNn8FA5biM04Bhcd-MEE",
    "token_type": "bearer",
    "refresh_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1c2VyX25hbWUiOiIxODM2MjkxNjcyNiIsInNjb3BlIjpbImFsbCJdLCJhdGkiOiIzOTQxMzdiOS0zY2RiLTRlMjctODRkYy1jOWIxMmM5N2UwOGMiLCJleHAiOjE1MTE2MjIxMjcsIlgtQU9ITy1Vc2VySWQiOiIxNGY1MmE0OS0yYTgxLTRhMmYtOGI5Mi01ZmU0NzUzZGRmZGEiLCJqdGkiOiJkYTBmOTMxMS1lZjc0LTRiMjQtODViZi04ZTNjNDVhNGEyNzkiLCJjbGllbnRfaWQiOiJmcm9udGVuZCJ9.2MRdqEogAwbesRfj2TKoWhMazItBlpjbQx7dlgfFpHE",
    "expires_in": 43199,
    "scope": "all",
    "X-AOHO-UserId": "14f52a49-2a81-4a2f-8b92-5fe4753ddfda",
    "jti": "394137b9-3cdb-4e27-84dc-c9b12c97e08c",
    "X-AOHO-ClientId": "frontend"
}

ps: 登录的用户名密码要在表单里面写,内容随意,因为在代码中已经去掉了对user服务的校验。

授权码模式

本次更新添加了对授权码模式的使用

授权码模式需要用户登录,所以借助浏览器

首先给数据库表中的oauth_client_details表中client_idfrontend的行authorized_grant_types添加authorization_codeweb_server_redirect_uri设置为http://localhost:8080。表示该客户端允许授权码模式以及授权码回调地址为http://localhost:8080

浏览器访问地址

http://localhost:9000/oauth/authorize?response_type=code&client_id=frontend&
scope=all&redirect_uri=http://localhost:8080

进入登录授权页面并同意授权,从回调地址中获取授权码

http://localhost:8080/?code=xGjrTm

通过授权码获取access_token

method: post
url: http://localhost:9000/oauth/token?grant_type=authorization_code
header:
{
  Authorization: Basic ZnJvbnRlbmQ6ZnJvbnRlbmQ=,
  Content-Type: application/x-www-form-urlencoded
}
body:
{
  code: xGjrTm,
  redirect_uri: http://localhost:8080
}

写在最后

项目整合如果遇到问题,可以加入qq群(649932629)交流。

ps: qq交流群已设置付费,可以过滤很多广告,营造高质量的技术交流群。

有问题联系 aoho002#gmail.com

MIT License

Copyright (c) 2018 aoho

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