Welcome to the SecureTodo OACC example repository. The SecureTodo application serves as an example on how to integrate the open-source OACC security framework into a sample Java application to address several real-world authorization scenarios.
The SecureTodo example application is a RESTful Java implementation of a secured todo list. It uses the Dropwizard framework to stand up a RESTful web service, and the OACC framework to provide application security.
While you could simply browse the source code directly from this repo to see how OACC does its magic, there's a better alternative:
The accompanying code walkthrough document is part of this repo and explains the SecureTodo example application and the relevant OACC features, in detail.
OACC - pronounced [oak] - is a fully featured API to both enforce and manage your application's authentication and authorization needs.
You can find more information about the OACC Java Security Framework, including the latest Javadocs, releases, and tutorials on the project website: oaccframework.org.
The SecureTodo sample application is compatible with Java™ SE 8 (Java™ version 1.8.0), or higher.
- Run
mvn clean packageto package the application - Start the application with
java -jar target/secure-todo-1.0.1-SNAPSHOT.jar server secure-todo.yml
To interact with the SecureTodo API using curl try some of the sample commands below:
-
POST a new user:
curl -i -k --silent -w "\n" \ -H "Content-Type: application/json" \ -X POST -d '{"email":"[email protected]", "password":"secret"}' \ https://localhost:8443/users
-
POST a new todo for the authenticated user:
curl -i -k --silent -w "\n" \ -u [email protected]:secret \ -H "Content-Type: application/json" \ -X POST -d '{"title":"wash car"}' \ https://localhost:8443/todos
-
GET todos for the authenticated user:
curl -i -k -w "\n" \ -u [email protected]:secret \ https://localhost:8443/todos
-
PATCH an existing todo:
curl -i -k --silent -w "\n" \ -u [email protected]:secret \ -H "Content-Type: application/json" \ -X PATCH -d '{"completed":"true"}' \ https://localhost:8443/todos/1
-
PUT a share-request for an existing todo:
curl -i -k --silent -w "\n" \ -u [email protected]:secret \ -H "Content-Type: application/json" \ -X PUT https://localhost:8443/todos/1/?[email protected]
The SecureTodo sample application is open source software released under the commercial friendly Apache License, Version 2.0. The accompanying document - including the illustrations referenced within it - that walks through and explains the SecureTodo code is licensed under a Creative Commons Attribution 4.0 International License (CC BY 4.0).
Acciente, LLC is a software company located in Scottsdale, Arizona specializing in systems architecture and software design for medium to large scale software projects.