當前位置:
首頁 >
前端技术
> javascript
>内容正文
javascript
SpringSecurity案例之认证服务搭建
生活随笔
收集整理的這篇文章主要介紹了
SpringSecurity案例之认证服务搭建
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
創建授權模塊
創建工程導入jar包
<?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"><parent><artifactId>springboot_security_oauth</artifactId><groupId>com.leon</groupId><version>1.0-SNAPSHOT</version></parent><modelVersion>4.0.0</modelVersion><artifactId>leon_oauth_server</artifactId><dependencies><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-web</artifactId></dependency><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-security</artifactId></dependency><dependency><groupId>org.springframework.cloud</groupId><artifactId>spring-cloud-starter-oauth2</artifactId><version>2.1.0.RELEASE</version></dependency><dependency><groupId>mysql</groupId><artifactId>mysql-connector-java</artifactId><version>5.1.47</version></dependency><dependency><groupId>org.mybatis.spring.boot</groupId><artifactId>mybatis-spring-boot-starter</artifactId><version>2.1.0</version></dependency></dependencies> </project>編寫配置文件
server:port: 9001 spring:datasource:driver-class-name: com.mysql.jdbc.Driverurl: jdbc:mysql:///security_authorityusername: rootpassword: rootmain:allow-bean-definition-overriding: true mybatis:type-aliases-package: com.leon.domainconfiguration:map-underscore-to-camel-case: true logging:level:com.leon: debug提供啟動類
@SpringBootApplication @MapperScan("com.leon.mapper") public class OauthServerApplication {public static void main(String[] args) {SpringApplication.run(OauthServerApplication.class, args);} }總結
以上是生活随笔為你收集整理的SpringSecurity案例之认证服务搭建的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: SpringSecurity案例之把资源
- 下一篇: gradle idea java ssm