@@ -17,9 +17,9 @@ clients, as well as various other management functions.
17
17
* Tokens: [ A note on tokens, scopes and authorities] ( https://github.com/cloudfoundry/uaa/tree/master/docs/UAA-Tokens.md )
18
18
* Technical forum: [ vcap-dev google group] ( https://groups.google.com/a/cloudfoundry.org/forum/?fromgroups#!forum/vcap-dev )
19
19
* Docs: [ docs/] ( https://github.com/cloudfoundry/uaa/tree/master/docs )
20
- * API Documentation: [ UAA-API .rst] ( https://github.com/cloudfoundry/uaa/tree/master/doc /UAA-API .rst )
20
+ * API Documentation: [ UAA-APIs .rst] ( https://github.com/cloudfoundry/uaa/tree/master/docs /UAA-APIs .rst )
21
21
* Specification: [ The Oauth 2 Authorization Framework] ( http://tools.ietf.org/html/rfc6749 )
22
- * LDAP: [ UAA LDAP Integration] ( https://github.com/cloudfoundry/uaa/tree/master/doc /UAA-LDAP.md )
22
+ * LDAP: [ UAA LDAP Integration] ( https://github.com/cloudfoundry/uaa/tree/master/docs /UAA-LDAP.md )
23
23
24
24
## Quick Start
25
25
@@ -128,26 +128,14 @@ grant, the same as used by a client like CF.
128
128
You can run the integration tests with
129
129
130
130
$ ./gradlew integrationTest
131
-
132
- To make the tests work in various environments you can modify the
133
- configuration of the server and the tests (e.g. the admin client)
134
- using a variety of mechanisms. The simplest is to provide additional
135
- Maven profiles on the command line, e.g.
136
-
137
- $ (cd uaa; mvn test -P vcap)
138
-
131
+
139
132
will run the integration tests against a uaa server running in a local
140
- vcap, so for example the service URL is set to ` uaa.vcap.me ` (by
141
- default). There are several Maven profiles to play with, and they can
142
- be used to run the server, or the tests or both:
143
-
144
- * ` local ` : runs the server on the ROOT context ` http://localhost:8080/ `
145
-
146
- * ` vcap ` : also runs the server on the ROOT context and points the
147
- tests at ` uaa.vcap.me ` .
133
+ Apache Tomcat instance, so for example the service URL is set to ` http://localhost:8080/uaa ` (by
134
+ default).
148
135
149
- These profiles set the ` CLOUD_FOUNDRY_CONFIG_PATH ` to pick up a
150
- ` uaa.yml ` and (if appropriate) set the context root for running the
136
+ You can point the ` CLOUD_FOUNDRY_CONFIG_PATH ` to pick up a
137
+ ` uaa.yml ` where URLs can be changed
138
+ and (if appropriate) set the context root for running the
151
139
server (see below for more detail on that).
152
140
153
141
### Custom YAML Configuration
@@ -164,7 +152,7 @@ To modify the runtime parameters you can provide a `uaa.yml`, e.g.
164
152
165
153
then from ` uaa/uaa `
166
154
167
- $ CLOUD_FOUNDRY_CONFIG_PATH=/tmp mvn test
155
+ $ CLOUD_FOUNDRY_CONFIG_PATH=/tmp ./gradlew test
168
156
169
157
The webapp looks for a Yaml file in the following locations
170
158
(later entries override earlier ones) when it starts up.
@@ -174,69 +162,23 @@ The webapp looks for a Yaml file in the following locations
174
162
file:${UAA_CONFIG_FILE}
175
163
${UAA_CONFIG_URL}
176
164
177
- ### Using Maven with Cloud Foundry
178
-
179
- To test against a Cloud Foundry instance use the Maven profile ` vcap ` (it
180
- switches off some of the tests that create random client and user
181
- accounts):
165
+ ### Using Gradle to test with postgresql or mysql
182
166
183
- $ (cd uaa; mvn test -P vcap)
184
-
185
- To change the target server it should suffice to set
186
- ` VCAP_BVT_TARGET ` (the tests prefix it with ` uaa. ` to form the
187
- server url), e.g.
188
-
189
- $ VCAP_BVT_TARGET=appcloud21.dev.mozycloud mvn test -P vcap
190
-
191
- You can also override some of the other most important default
192
- settings using environment variables. The defaults as usual come from
193
- ` uaa.yml ` but tests will search first in an environment variable:
194
-
195
- * ` UAA_ADMIN_CLIENT_ID ` the client id for bootstrapping client
196
- registrations needed for the rest of the tests.
197
-
198
- * ` UAA_ADMIN_CLIENT_SECRET ` the client secret for bootstrapping client
199
- registrations
200
-
201
- All other settings from ` uaa.yml ` can be overridden individually as
202
- system properties. Running in an IDE this is easy just using whatever
203
- features allow you to modify the JVM in test runs, but using Maven you
204
- have to use the ` argLine ` property to get settings passed onto the
205
- test JVM, e.g.
206
-
207
- $ mvn -DargLine=-Duaa.test.username=foo test
208
-
209
- will create an account with ` userName=foo ` for testing (instead using
210
- the default setting from ` uaa.yml ` ).
211
-
212
- If you prefer environment variables to system properties you can use a
213
- custom ` uaa.yml ` with placeholders for your environment variables,
214
- e.g.
215
-
216
- uaa:
217
- test:
218
- username: ${UAA_TEST_USERNAME:marissa}
219
-
220
- will look for an environment variable (or system property)
221
- ` UAA_TEST_USERNAME ` before defaulting to ` marissa ` . This is the trick
222
- used to expose ` UAA_ADMIN_CLIENT_SECRET ` etc. in the standard
223
- configuration.
224
-
225
- ### Using Maven to test with postgresql or mysql
226
-
227
- The default uaa unit tests (mvn test) use hsqldb.
167
+ The default uaa unit tests (./gradlew test) use hsqldb.
228
168
229
169
To run the unit tests using postgresql:
230
170
231
- $ SPRING_PROFILES_ACTIVE=test,postgresql CLOUD_FOUNDRY_CONFIG_PATH=src/test/resources/test/profiles/postgresql mvn test
171
+ $ echo "spring_profiles: default,postgresql" > src/main/resources/uaa.yml
172
+ $ ./gradlew test integrationTest
232
173
233
174
To run the unit tests using mysql:
234
175
235
- $ SPRING_PROFILES_ACTIVE=test,mysql CLOUD_FOUNDRY_CONFIG_PATH=src/test/resources/test/profiles/mysql mvn test
176
+ $ echo "spring_profiles: default,mysql" > src/main/resources/uaa.yml
177
+ $ ./gradlew test integrationTest
178
+
236
179
237
- The database configuration for the common and scim modules is located at:
238
- common/src/test/resources/(mysql|postgresql).properties
239
- scim/src/test/resources/(mysql|postgresql).properties
180
+ The database configuration for the common and scim modules is defaulted in
181
+ the Spring XML configuration files. You can change them by configuring them in ` uaa.yml `
240
182
241
183
## Inventory
242
184
@@ -268,10 +210,9 @@ In CloudFoundry terms
268
210
269
211
The authentication service is ` uaa ` . It's a plain Spring MVC webapp.
270
212
Deploy as normal in Tomcat or your container of choice, or execute
271
- ` mvn tomcat7:run ` to run it directly from ` uaa ` directory in the source
272
- tree (make sure the common jar is installed first using ` mvn install `
273
- from the common subdirectory or from the top level directory). When
274
- running with maven it listens on port 8080.
213
+ ` ./gradlew run ` to run it directly from ` uaa ` directory in the source
214
+ tree. When running with gradle it listens on port 8080 and the URL is
215
+ ` http://localhost:8080/uaa `
275
216
276
217
The UAA Server supports the APIs defined in the UAA-APIs document. To summarise:
277
218
@@ -339,63 +280,36 @@ To use Postgresql for user data, activate one of the Spring profiles
339
280
340
281
The active profiles can be configured in ` uaa.yml ` using
341
282
342
- spring_profiles: postgresql
283
+ spring_profiles: postgresql,default
343
284
344
- or by passing the ` spring.profiles.active ` parameter to the JVM. For,
345
- example to run with an embedded HSQL database:
346
-
347
- mvn -Dspring.profiles.active=hsqldb tomcat7:run
348
-
349
- Or to use PostgreSQL instead of HSQL:
350
-
351
- mvn -Dspring.profiles.active=postgresql tomcat7:run
352
-
353
- To bootstrap a microcloud type environment you need an admin client.
354
- For this there is a database initializer component that inserts an
355
- admin client. If the default profile is active (i.e. not
356
- ` postgresql ` ) there is also a ` cf ` client so that the gem login works
357
- out of the box. You can override the default settings and add
358
- additional clients in ` uaa.yml ` :
285
+ To use PostgreSQL instead of HSQL:
359
286
360
- oauth:
361
- clients:
362
- admin:
363
- authorized-grant-types: client_credentials
364
- scope: read,write,password
365
- authorities: ROLE_CLIENT,ROLE_ADIN
366
- id: admin
367
- secret: adminclientsecret
368
- resource-ids: clients
287
+ $ echo "spring_profiles: default,postgresql" > src/main/resources/uaa.yml
288
+ $ ./gradlew run
369
289
370
- The admin client can be used to create additional clients (but not to
371
- do anything much else). A client with read/write access to the ` scim `
372
- resource will be needed to create user accounts. The integration
373
- tests take care of this automatically, inserting client and user
374
- accounts as necessary to make the tests work.
375
290
376
- ## The API Application
291
+ ## The API Sample Application
377
292
378
- An example resource server. It hosts a service which returns
379
- a list of mock applications under ` /apps ` .
293
+ Two sample applications are included with the UAA. The ` /api ` and ` /app `
380
294
381
- Run it using ` mvn tomcat7: run` from the ` api ` directory (once all other
382
- tomcat processes have been shutdown). This will deploy the app to a
383
- Tomcat manager on port 8080 .
295
+ Run it using ` ./gradlew run` from the ` uaa ` root directory
296
+ All three apps, ` /uaa ` , ` /api ` and ` / app` get deployed
297
+ simultaneously .
384
298
385
- ## The App Application
299
+ ## The App Sample Application
386
300
387
301
This is a user interface app (primarily aimed at browsers) that uses
388
302
OpenId Connect for authentication (i.e. SSO) and OAuth2 for access
389
303
grants. It authenticates with the Auth service, and then accesses
390
- resources in the API service. Run it with ` mvn tomcat7: run` from the
391
- ` app ` directory (once all other tomcat processes have been shutdown) .
304
+ resources in the API service. Run it with ` ./gradlew run` from the
305
+ ` uaa ` root directory .
392
306
393
307
The application can operate in multiple different profiles according
394
308
to the location (and presence) of the UAA server and the Login
395
309
application. By default it will look for a UAA on
396
310
` localhost:8080/uaa ` , but you can change this by setting an
397
311
environment variable (or System property) called ` UAA_PROFILE ` . In
398
- the application source code (` src/main/resources ` ) you will find
312
+ the application source code (` samples/app/ src/main/resources` ) you will find
399
313
multiple properties files pre-configured with different likely
400
314
locations for those servers. They are all in the form
401
315
` application-<UAA_PROFILE>.properties ` and the naming convention
0 commit comments