README.adoc 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. = OAuth 2.0 Authorization Server Sample
  2. This sample demonstrates an Authorization Server that supports a simple, static JWK Set.
  3. It's useful for working with the other samples in the library that want to point to an Authorization Server.
  4. == 1. Running the server
  5. To run the server, do:
  6. ```bash
  7. ./gradlew bootRun
  8. ```
  9. Or import the project into your IDE and run `OAuth2AuthorizationServerApplication` from there.
  10. Once it is up, this request asks for a token with the "message:read" scope:
  11. ```bash
  12. curl reader:secret@localhost:8081/oauth/token -d grant_type=password -d username=subject -d password=password
  13. ```
  14. Which will respond with something like:
  15. ```json
  16. {
  17. "access_token":"eyJhbGciOiJSUzI1NiIsI...Fhq4RIVyA4ZAkC7T1aZbKAQ",
  18. "token_type":"bearer",
  19. "expires_in":599999999,
  20. "scope":"message:read",
  21. "jti":"8a425df7-f4c9-4ca4-be12-0136c3015da0"
  22. }
  23. ```
  24. You can also so the same with the `writer` client:
  25. ```bash
  26. curl writer:secret@localhost:8081/oauth/token -d grant_type=password -d username=subject -d password=password
  27. ```