# spring-security-auth2-demo **Repository Path**: yaozhanwei/spring-security-auth2-demo ## Basic Information - **Project Name**: spring-security-auth2-demo - **Description**: No description available - **Primary Language**: Java - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2018-08-22 - **Last Updated**: 2020-12-19 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README spring-security-auth2-demo 包含(auth2-server)服务端认证授权和(auth2-client-login)客户端发起认证请求 auth2-server(服务端)主要关于token获取几种方式,该用例主要考虑password方式-获取token password方式-获取token http://localhost:8080/oauth/token?grant_type=password&username=user_1&password=123456&scope=all&client_id=apply&client_secret=123456 client方式-获取token http://localhost:8080/oauth/token?grant_type=client_credentials&scope=all&client_id=apply&client_secret=123456 刷新token-password方式-获取token http://localhost:8080/oauth/token?grant_type=refresh_token&client_id=apply&client_secret=123456&refresh_token=2d32c137-7199-43f5-ab82-52adf277f197 授权码-获取authorization_code http://localhost:8080/oauth/authorize?response_type=code&client_id=apply&redirect_uri=http://127.0.0.1:8081/login&access_token=49a8a115-c5de-4e9f-bb52-fd23edc221cd http://localhost:8080/oauth/token?grant_type=authorization_code&client_id=apply&client_secret=123456&code=paCmPG&redirect_uri=http://127.0.0.1:8081/login token访问service http://127.0.0.1:8080/user?access_token=cb92b598-eae5-445f-83ab-abcd65840cb7 auth2-client-login(客户端跳转登陆服务端认证) 通过下面连接进行登陆 http://127.0.0.1:8081/login 输入用户名和密码 用户名:user_1 密码:123456 用户名:user_2 密码:123456 验证是否成功登陆,可以查看用户信息 http://127.0.0.1:8081/user