@@ -3,19 +3,37 @@ Springboot 2.0.x oauth2 JWT
3
3
4
4
Sample Spring Boot 2.0.x OAuth2 JWT Authorization Server (JPA, Hibernate, PostgreSQL, Dockerize).
5
5
6
- If you feel happy give a star to this repository.
6
+ You can use this project to boostraping Authorization your own Application.
7
+
8
+ If you feel happy ** give a star** to this repository.
7
9
8
10
## Features
9
11
10
12
* OAuth2.0 Authorization Server
11
13
* OAuth2.0 Resource Server
12
- * [ Liquibase] ( https://www.liquibase.org/ )
13
- * [ Gradle 4.10.2] ( https://gradle.org/install/ )
14
- * Docker
15
- * JWT Token RSA
16
- * Sample File Upload (Using Oauth2 Resource Server)
14
+ * We use [ Liquibase] ( https://www.liquibase.org/ )
15
+ * We use [ Gradle 4.10.2] ( https://gradle.org/install/ )
16
+ * We use Docker, to simplify understanding application flow.
17
+ * We use JWT Token RSA, production ready.
18
+ * File upload API (Using Oauth2 Resource Server)
19
+
20
+ ## Oauth2 user credential
21
+
22
+ | User | Password | authorized grant types |
23
+ | -----------------| -----------------| --------------------------------------------------- |
24
+ | server-server | server-server | client_credentials |
25
+ | external-server | external-server | client_credentials |
26
+ | android-client | android-client | password,refresh_token,implicit,authorization_code |
27
+
28
+ ## Customer credential
29
+
30
+ | User | Password |
31
+ | -----------------| -----------------|
32
+ | customer_one | customer_one |
33
+ | customer_two | customer_two |
34
+ | customer_bad | customer_bad |
17
35
18
- ## Running On Docker
36
+ ## How to Running On Docker
19
37
20
38
For running on Docker instance, it's really simple.
21
39
@@ -24,7 +42,7 @@ For running on Docker instance, it's really simple.
24
42
25
43
## Testing Apps
26
44
27
- Login server-server
45
+ ** server-server login **
28
46
29
47
``` bash
30
48
curl --request POST \
@@ -46,7 +64,7 @@ the result will be like
46
64
}
47
65
```
48
66
49
- Login customer (end user for your apps)
67
+ ** Customer Login (end user for your apps)**
50
68
51
69
``` bash
52
70
curl --request POST \
@@ -69,7 +87,7 @@ the result will be like
69
87
}
70
88
```
71
89
72
- Customer Check Oauth2 Token
90
+ ** Customer Check Oauth2 Token**
73
91
74
92
``` bash
75
93
curl --request POST \
@@ -105,7 +123,7 @@ the result will be like
105
123
}
106
124
```
107
125
108
- Customer Refresh Oauth2 Token
126
+ ** Customer Refresh Oauth2 Token**
109
127
110
128
``` bash
111
129
curl --request POST \
@@ -114,7 +132,7 @@ curl --request POST \
114
132
--data ' grant_type=refresh_token&token={{YOUR_ACCESS_TOKEN}}&refresh_token={{YOUR_REFRESH_TOKEN}}'
115
133
```
116
134
117
- Access Customer Profile
135
+ ** Access Customer Profile**
118
136
119
137
``` bash
120
138
curl --request GET \
@@ -130,7 +148,7 @@ the result will be like
130
148
}
131
149
```
132
150
133
- File Upload
151
+ ** File Upload**
134
152
135
153
``` bash
136
154
curl --request POST \
@@ -147,37 +165,37 @@ First clone this repo. To build the sources you need to have [Gradle 4x](https:/
147
165
148
166
After the clone, create database
149
167
150
- - For Authorization Server
168
+ - For ** Authorization Server**
151
169
152
170
``` bash
153
171
su - postgres
154
172
createdb auth_server
155
173
```
156
174
157
- - For Resource Server
175
+ - For ** Resource Server**
158
176
159
177
``` bash
160
178
su - postgres
161
179
createdb file_server
162
180
```
163
181
164
- After create database, build the entire project.
182
+ After ** create database** , build the entire project.
165
183
166
- For Authorization Server
184
+ For ** Authorization Server**
167
185
168
186
``` bash
169
187
cd authorization_server
170
188
gradle build
171
189
```
172
190
173
- For Resource Server
191
+ For ** Resource Server**
174
192
175
193
``` bash
176
194
cd resource_server
177
195
gradle build
178
196
```
179
197
180
- Generate RSA KeyStore
198
+ ** Generate RSA KeyStore**
181
199
182
200
``` bash
183
201
keytool -genkey -alias jwt -storetype PKCS12 -keyalg RSA -keysize 2048 -keystore jwt.p12 -keypass odenktools123 -validity 3650
@@ -187,30 +205,13 @@ keytool -genkey -alias jwt -storetype PKCS12 -keyalg RSA -keysize 2048 -keystore
187
205
keytool -list -rfc --keystore jwt.p12 | openssl x509 -inform pem -pubkey
188
206
```
189
207
190
- ## Oauth2 user credential
191
-
192
- User : server-server
193
-
194
- Password : server-server
195
-
196
- User : android-client
197
-
198
- Password : android-client
199
-
200
- User : external-server
201
-
202
- Password : external-server
203
-
204
-
205
- ## Customer credential
206
-
207
- User : customer_one
208
-
209
- Password : customer_one
210
-
211
- ## Todos
208
+ ## Todo List
212
209
213
- - [ ] Admin UI for manage users and customers credentials
210
+ - [x] Oauth2.0 JWT Token
211
+ - [x] Remote Token
212
+ - [ ] Client Registration API
213
+ - [ ] Admin UI for manage ** Oauth2 user credential** and ** customers**
214
+ - [ ] Custom authorization scope
214
215
215
216
## References
216
217
0 commit comments