WASdev/sample.ejb.secure

Name: sample.ejb.secure

Owner: WASdev

Description: A sample that demonstrates how to secure the sample.ejb application.

Created: 2017-08-31 15:59:19.0

Updated: 2017-08-31 16:28:41.0

Pushed: 2017-09-06 14:55:25.0

Homepage: null

Size: 13

Language: Java

GitHub Committers

UserMost Recent Commit# Commits

Other Committers

UserEmailMost Recent Commit# Commits

README

Secure Enterprise Java Beans (EJB) Sample Build Status

This sample demonstrates injection of an EJB into a servlet. The application consists of a servlet and stateless session bean. The servlet uses annotations to inject the stateless session bean, and then performs a call on the hello method of the bean. This sample also has an additional security layer added which will prompt the user for a username and password before granting access to the servlet.

This sample can be installed onto runtime versions 8.5.5.0 and later.

Running in Eclipse with Maven
  1. Clone this project and import into Eclipse as an 'Existing Maven Project'.
  2. Right-click the project and select Run As > Maven Clean.
  3. Right-click the project and select Run As > Maven Install.
  4. Right-click the project and select Run As -> Run on Server.
  5. You should see the following in the console: Application SecureEJBSample started in XX.XX seconds.
Running with Maven

This project can be built with Apache Maven. The project uses Liberty Maven Plug-in to automatically download and install Liberty with Java EE7 Web Profile runtime from Maven Central. Liberty Maven Plug-in is also used to create, configure, and run the application on the Liberty server.

Use the following steps to run the application with Maven:

  1. Execute full Maven build. This will cause Liberty Maven Plug-in to download and install Liberty profile server.

    n clean install
    
  2. To run the server with the Servlet sample execute:

    n liberty:run-server
    

In your browser, enter the URL for the application: http://localhost:9080/secureejb-war/ (where port 9080 assumes the httpEndpoint provided in the sample server.xml has not been modified). In your browser, you should see the message “Hello secure EJB World”.

Notice

© Copyright IBM Corporation 2017.

License

nsed under the Apache License, Version 2.0 (the "License");
may not use this file except in compliance with the License.
may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

ss required by applicable law or agreed to in writing, software
ributed under the License is distributed on an "AS IS" BASIS,
OUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
the License for the specific language governing permissions and
tations under the License.

This work is supported by the National Institutes of Health's National Center for Advancing Translational Sciences, Grant Number U24TR002306. This work is solely the responsibility of the creators and does not necessarily represent the official views of the National Institutes of Health.