ibm-information-center/dist/eclipse/plugins/i5OS.ic.rzaha_5.4.0.1/jaashllo.htm

111 lines
6.0 KiB
HTML
Raw Normal View History

2024-04-02 14:02:31 +00:00
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="en-us" xml:lang="en-us">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="security" content="public" />
<meta name="Robots" content="index,follow" />
<meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' />
<meta name="DC.Type" content="task" />
<meta name="DC.Title" content="Compile and run HelloWorld with Java Authentication and Authorization Service on an iSeries server" />
<meta name="abstract" content="This information looks at how HelloWorld for Java Authentication and Authorization Service (JAAS) is compiled and run on an iSeries server." />
<meta name="description" content="This information looks at how HelloWorld for Java Authentication and Authorization Service (JAAS) is compiled and run on an iSeries server." />
<meta name="DC.Relation" scheme="URI" content="jaassamp.htm" />
<meta name="DC.Relation" scheme="URI" content="jaaswork.htm" />
<meta name="copyright" content="(C) Copyright IBM Corporation 2006" />
<meta name="DC.Rights.Owner" content="(C) Copyright IBM Corporation 2006" />
<meta name="DC.Format" content="XHTML" />
<meta name="DC.Identifier" content="jaashllo" />
<meta name="DC.Language" content="en-us" />
<!-- All rights reserved. Licensed Materials Property of IBM -->
<!-- US Government Users Restricted Rights -->
<!-- Use, duplication or disclosure restricted by -->
<!-- GSA ADP Schedule Contract with IBM Corp. -->
<link rel="stylesheet" type="text/css" href="./ibmdita.css" />
<link rel="stylesheet" type="text/css" href="./ic.css" />
<title>Compile and run HelloWorld with Java Authentication and Authorization Service
on an iSeries server</title>
</head>
<body id="jaashllo"><a name="jaashllo"><!-- --></a>
<!-- Java sync-link --><script language="Javascript" src="../rzahg/synch.js" type="text/javascript"></script>
<h1 class="topictitle1">Compile and run HelloWorld with Java Authentication and Authorization Service
on an iSeries server</h1>
<div><p>This information looks at how <strong>HelloWorld</strong> for Java™ Authentication
and Authorization Service (JAAS) is compiled and run on an iSeries™ server. </p>
<div class="section"><p>This information should be considered a replacement for the <strong>HelloWorld</strong> section
of the <a href="api.htm">API Developers Guide</a>. The source code,
policy, and configuration files are the same as those in the API Developers
Guide. There are, however, some aspects that are unique to the iSeries server.</p>
</div>
<ol><li class="stepexpand"><span> </span> <p>You should put the following source files in your
own test directory:</p>
<ul><li><a href="HWLoginModule.java">HWLoginModule.java</a></li>
<li><a href="HWPrincipal.java">HWPrincipal.java</a></li>
<li><a href="HelloWorld.java">HelloWorld.java</a></li>
</ul>
<p>These source files need to be compiled into your ./classes directory.</p>
<p>To
look at the source code for these files formatted for your HTML browser, see <a href="jaaswrld.htm">HelloWorld in HTML</a>.</p>
</li>
<li class="stepexpand"><span> </span> <p>The three source files, HWLoginModule.java, HWPrincipal.java
and HelloWorld.java, need to be compiled. Run the following commands (each
on one line) on an iSeries command line:</p>
<ol type="a"><li class="substepexpand"><span></span> <p>strqsh</p>
</li>
<li class="substepexpand"><span></span> <p>cd <em>yourTestDir</em></p>
</li>
<li class="substepexpand"><span></span> <pre>javac -J-Djava.version=1.3
-classpath /qibm/proddata/os400/java400/ext/jaas13.jar:.
-d ./classes *.java</pre>
</li>
</ol>
Where <em>yourTestDir</em> is directory you created to hold the sample
files. The classpath needs the classes directory (.\classes) added to it to
compile the classes. <p><strong>Note:</strong> HWLoginModule and HWPrincipal are in
the com.ibm.security package and are created in the appropriate directory
during compilation (\classes\com\ibm\security).</p>
</li>
<li class="stepexpand"><span></span> <p>Run the following commands (each on one line) on
the iSeries command
line:</p>
<ol type="a"><li class="substepexpand"><span></span> <p>strqsh</p>
</li>
<li class="substepexpand"><span>cd <em>yourTestDir</em> </span> <p>Where <em>yourTestDir</em> is
the directory that you created to hold the sample files. The classpath needs
the classes directory (.\classes) added to it to compile the classes.</p>
</li>
<li class="substepexpand"><span>You should put the following source files in your own test directory:
</span> <ul><li><a href="jaas.config">jaas.config</a></li>
<li><a href="java2.policy">java2.policy</a></li>
<li><a href="jaas.policy">jaas.policy</a></li>
</ul>
</li>
<li class="substepexpand"><span> </span> <pre>java -Djava.security.manager=
-Djava.security.auth.login.config=./jaas.config
-Djava.security.policy=./java2.policy
-Djava.security.auth.policy=./jaas.policy
-Djava.version=1.3
-classpath ./classes
HelloWorld</pre>
</li>
<li class="substepexpand"><span>When prompted for the user name, enter <strong>bob</strong>. If running
with a security manager, user <strong>bob</strong> must be entered for all of the access
permissions to succeed. When prompted for a password, enter <strong>Go JAAS</strong>,
case sensitive with a space.</span></li>
</ol>
</li>
</ol>
</div>
<div>
<ul class="ullinks">
<li class="ulchildlink"><strong><a href="jaaswork.htm">Details: How HelloWorld for Java Authentication and Authorization Service works</a></strong><br />
</li>
</ul>
<div class="familylinks">
<div class="parentlink"><strong>Parent topic:</strong> <a href="jaassamp.htm" title="This topic contains samples of Java Authentication and Authorization Service (JAAS) on an iSeries server.">Java Authentication and Authorization Service samples</a></div>
</div>
</div>
</body>
</html>