|
1 |
| -# SpringOauth2AuthorizationServer |
2 |
| -Spring Oauth2 AuthorizationServer |
| 1 | +# Oauth2 AuthorizationServer(인증서버) 구축 |
3 | 2 |
|
| 3 | +### 0. 개요 |
| 4 | +- SpringBoot에서 제공하는 Oauth2 인증서버 구축 방법에 대한 실습 |
| 5 | +- daddyprogrammer.org에서 연재 및 소스 Github 등록 |
| 6 | + - https://daddyprogrammer.org/post/series/spring-boot-oauth2/ |
| 7 | + |
| 8 | +### 1. 실습 환경 |
| 9 | +- Java 8~11 |
| 10 | +- SpringBoot 2.x |
| 11 | +- Spring Oauth2 |
| 12 | +- JPA, H2 |
| 13 | +- Intellij Community |
4 | 14 |
|
| 15 | +### 2. 실습 내용 |
| 16 | +- Spring Boot Oauth2 – AuthorizationServer |
| 17 | + - Document |
| 18 | + - https://daddyprogrammer.org/post/1239/spring-oauth-authorizationserver/ |
| 19 | + - Git |
| 20 | + - https://github.com/codej99/SpringOauth2AuthorizationServer |
| 21 | +- Spring Boot Oauth2 – AuthorizationServer : DB처리, JWT 토큰 방식 적용 |
| 22 | + - Document |
| 23 | + - https://daddyprogrammer.org/post/1287/spring-oauth2-authorizationserver-database/ |
| 24 | + - Git |
| 25 | + - https://github.com/codej99/SpringOauth2AuthorizationServer |
5 | 26 |
|
6 |
| -## Oauth2 Authorize |
7 |
| -http://localhost:8081/oauth/authorize?client_id=testClientId&redirect_uri=http://localhost:8081/oauth2/callback&response_type=code&scope=read |
| 27 | +### Oauth2 Authorize Code 실습 |
| 28 | +- http://localhost:8081/oauth/authorize?client_id=testClientId&redirect_uri=http://localhost:8081/oauth2/callback&response_type=code&scope=read |
8 | 29 |
|
9 |
| -## publish token |
10 |
| -curl -X POST \ |
11 |
| -'http://localhost:8080/oauth/token' \ |
12 |
| --H 'Authorization:Basic dGVzdENsaWVudElkOnRlc3RTZWNyZXQ=' \ |
13 |
| --d 'grant_type=authorization_code' \ |
14 |
| --d 'code=9THJxB' \ |
| 30 | +### 토큰 발급 |
| 31 | +curl -X POST |
| 32 | +'http://localhost:8080/oauth/token' |
| 33 | +-H 'Authorization:Basic dGVzdENsaWVudElkOnRlc3RTZWNyZXQ=' |
| 34 | +-d 'grant_type=authorization_code' |
| 35 | +-d 'code=9THJxB' |
15 | 36 | -d 'redirect_uri=http://localhost:8080/oauth2/callback'
|
16 | 37 |
|
17 |
| -## add client |
18 |
| - |
19 |
| -insert into oauth_client_details(client_id, resource_ids,client_secret,scope,authorized_grant_types,web_server_redirect_uri,authorities,access_token_validity,refresh_token_validity,additional_information,autoapprove) |
20 |
| -values('testClientId',null,'{bcrypt}$2a$10$H2oQgFY7qCRHWqkvAV4P6ONy2v74wfr3fQv.xERw3BJYSqh/Gcgrq','read,write','authorization_code,refresh_token','http://localhost:8081/oauth2/callback','ROLE_USER',36000,50000,null,null); |
| 38 | +### 클라이언트 등록 |
| 39 | +insert into oauth_client_details(client_id, resource_ids,client_secret,scope,authorized_grant_types,web_server_redirect_uri,authorities,access_token_validity,refresh_token_validity,additional_information,autoapprove) values('testClientId',null,'{bcrypt}$2a$10$H2oQgFY7qCRHWqkvAV4P6ONy2v74wfr3fQv.xERw3BJYSqh/Gcgrq','read,write','authorization_code,refresh_token','http://localhost:8081/oauth2/callback','ROLE_USER',36000,50000,null,null); |
| 40 | + |
0 commit comments