This example shows how to use Okta's Authentication API with a Java Servlet based application.
Please read Servlet Authentication with Java for a tutorial that shows you how to build this application.
Prerequisites: Java 8
Okta has Authentication and User Management APIs that reduce development time with instant-on, scalable user infrastructure. Okta's intuitive API and expert support make it easy for developers to authenticate, manage and secure users and roles in any application.
To install this example application, run the following commands:
git clone https://github.com/oktadeveloper/servlet-authn-example.git
cd servlet-authn-example
This will get a copy of the project installed locally.
The primary example (without authentication) is in the StarterBranch
branch. The complete application using Okta's Authentcation API is on the master
branch.
If you don't have one, create an Okta Developer account. After you've completed the setup process, log in to your account and navigate to copy the Org URL
in from the top right corner of the page, it will look something like: https://dev-123456.okta.com
.
Replace {yourOktaDomain}
in src/main/webapp/WEB-INF/web.xml
with this URL.
To start the application you can just run:
mvn
Login with the username password you used while registering.
This example uses the following libraries provided by Okta:
Please post any questions as comments on the following blog posts, or visit our Okta Developer Forums. You can also email developers@okta.com if would like to create a support ticket.
Apache 2.0, see LICENSE.