<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<body link="#355491" alink="#4262a1" vlink="#355491" style="background: #e2e2e2; margin: 0; padding: 20px;">
<div>
        <table cellpadding="0" bgcolor="#FFFFFF" border="0" cellspacing="0" style="border: 1px solid #dadada; margin-bottom: 30px; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                <tbody>
                        <tr>
                                <td>
                                        <table border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" style="border: solid 2px #ccc; background: #dadada; width: 100%; -moz-border-radius: 6px; -webkit-border-radius: 6px;">
                                                <tbody>
                                                        <tr>
                                                                <td bgcolor="#000000" valign="middle" height="58px" style="border-bottom: 1px solid #ccc; padding: 20px; -moz-border-radius-topleft: 3px; -moz-border-radius-topright: 3px; -webkit-border-top-right-radius: 5px; -webkit-border-top-left-radius: 5px;">
                                                                        <h1 style="color: #333333; font: bold 22px Arial, Helvetica, sans-serif; margin: 0; display: block !important;">
                                                                        <!-- To have a header image/logo replace the name below with your img tag -->
                                                                        <!-- Email clients will render the images when the message is read so any image -->
                                                                        <!-- must be made available on a public server, so that all recipients can load the image. -->
                                                                        <a href="https://community.jboss.org/index.jspa" style="text-decoration: none; color: #E1E1E1">JBoss Community</a></h1>
                                                                </td>
                                                        </tr>
                                                        <tr>
                                                                <td bgcolor="#FFFFFF" style="font: normal 12px Arial, Helvetica, sans-serif; color:#333333; padding: 20px; -moz-border-radius-bottomleft: 4px; -moz-border-radius-bottomright: 4px; -webkit-border-bottom-right-radius: 5px; -webkit-border-bottom-left-radius: 5px;"><h3 style="margin: 10px 0 5px; font-size: 17px; font-weight: normal;">
Basic Authentication Logout in EAP6
</h3>
<span style="margin-bottom: 10px;">
created by <a href="https://community.jboss.org/people/alokmp">Alok Mishra</a> in <i>Beginner's Corner</i> - <a href="https://community.jboss.org/message/751463#751463">View the full discussion</a>
</span>
<hr style="margin: 20px 0; border: none; background-color: #dadada; height: 1px;">
<div class="jive-rendered-content"><p>I am using EAP 6 to login to web application using the following configuration.</p><p>On accessing the web application jboss automatically gives an inbuilt popup which asks for </p><p>credentials and it allows to login successfully.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p>Now I want to logout of the web application but could not figure out a way to do so.</p><p>Please suggest any hints.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><ol style="list-style-type: decimal;"><li><strong><span style="color: #31859c;">Standalone</span><span style="font-size: 12.0pt; color: #31859c;">.xml (In JBoss </span><span style="font-size: 12.0pt; font-family: Wingdings; color: #31859c;">à</span><span style="font-size: 12.0pt; color: #31859c;"> Standalone </span><span style="font-size: 12.0pt; font-family: Wingdings; color: #31859c;">à</span><span style="font-size: 12.0pt; color: #31859c;"> Configuration )  …dev</span></strong></li><li><strong><span style="color: #31859c;">Domain</span><span style="font-size: 12.0pt; color: #31859c;">.xml (In JBoss </span><span style="font-size: 12.0pt; font-family: Wingdings; color: #31859c;">à</span><span style="font-size: 12.0pt; color: #31859c;"> Domain </span><span style="font-size: 12.0pt; font-family: Wingdings; color: #31859c;">à</span><span style="font-size: 12.0pt; color: #31859c;"> Configuration)  …production</span></strong></li></ol><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="margin-left: 0.5in;">Add a security-domain under below mentioned tag along with already present security domains.</p><p style="margin-left: 0.5in;">Right Below ……</p><p style="margin-left: 0.5in;"><subsystem xmlns="urn:jboss:domain:security:1.1"></p><p style="margin-left: 0.5in;"> <security-domains></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="margin-left: 0.25in;"> This was added.</p><p style="margin-left: 0.5in;"> <security-domain name="configAppSecurityDomain" cache-type="default"></p><p style="margin-left: 0.5in;"> <authentication></p><p style="margin-left: 0.5in;"> <login-module code="RealmUsersRoles" flag="required"></p><p style="margin-left: 1.5in;"><module-option name="usersProperties" value="${<span style="color: gray;">jboss.server.config.dir</span>}/mgmt-users.properties"/></p><p style="margin-left: 105.75pt;"><module-option name="rolesProperties" value="${<span style="color: gray;">jboss.server.config.dir</span>}/mgmt-roles.properties"/></p><p style="margin-left: 0.5in;"> <module-option name="realm" value="ManagementRealm"/></p><p style="margin-left: 1.5in;"><module-option name="unauthenticatedIdentity" value="nobody" /> </p><p style="margin-left: 0.5in;"> <module-option name="password-stacking" value="useFirstPass" /></p><p style="margin-left: 0.5in;"> </login-module></p><p style="margin-left: 0.5in;"> </authentication></p><p style="margin-left: 0.5in;"> </security-domain></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="margin-left: 0.25in;">For domain server (QA and Production) the location would be "${<span style="color: gray;">jboss.domain.config.dir</span>}</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><ol style="list-style-type: decimal;"><li><strong style="color: #31859c; font-size: 12.0pt;">Web.xml (of Sovereign Config Web App)</strong></li></ol><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p><security-constraint></p><p> <web-resource-collection></p><p> <web-resource-name>ConfigWebApp</web-resource-name></p><p> <description>Configuration Application</description></p><p> <url-pattern>/*</url-pattern></p><p> <http-method>GET</http-method></p><p> <http-method>POST</http-method></p><p> </web-resource-collection></p><p> <auth-constraint></p><p> <role-name><strong style="color: #e46c0a;">configAppUserRole</strong></role-name></p><p> </auth-constraint></p><p>    </security-constraint></p><p>    <login-config></p><p> <auth-method>BASIC</auth-method></p><p style="margin-left: 1in;"><realm-name>ManagementRealm</realm-name></p><p>    </login-config></p><p>    <security-role></p><p> <role-name><strong> <span style="color: #e46c0a;">configAppUserRole</span></strong> </role-name></p><p>    </security-role></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><ol style="list-style-type: decimal;"><li><strong style="color: #31859c; font-size: 12.0pt;">jboss-web.xml </strong></li></ol><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="margin-left: 0.5in;">Add this file with the below contents next to web.xml in the Sovereign Config Web App.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="margin-left: 0.5in;"><?xml version='1.0' encoding='UTF-8' ?></p><p style="margin-left: 0.5in;"><jboss-web></p><p style="margin-left: 0.5in;"> <security-domain>java:/jaas/configAppSecurityDomain</security-domain></p><p style="margin-left: 0.5in;"></jboss-web></p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><ol style="list-style-type: decimal;"><li><strong style="color: #31859c; font-size: 12.0pt;">mgmt-users.properties</strong></li></ol><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="margin-left: 0.5in;">Add a user in the mgmt-user.properties file (using the add-user.bat script from jboss <span style="font-family: Wingdings;">à</span> bin). Make sure the realm is ManagementRealm.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><ol style="list-style-type: decimal;"><li><strong style="color: #31859c; font-size: 12.0pt;">mgmt-roles.properties</strong></li></ol><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p style="margin-left: 0.5in;">Add the role <strong style="color: #e46c0a;">configAppUserRole</strong> to above create user.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;"> </p><p><strong><span style="font-size: 12.0pt; color: #31859c;">(In JBoss </span><span style="font-size: 12.0pt; font-family: Wingdings; color: #31859c;">à</span><span style="font-size: 12.0pt; color: #31859c;"> Standalone </span><span style="font-size: 12.0pt; font-family: Wingdings; color: #31859c;">à</span><span style="font-size: 12.0pt; color: #31859c;"> Configuration)  dev environment</span></strong></p><p style="margin-left: 0.5in;"><strong><span style="font-size: 12.0pt; color: #31859c;">(In JBoss </span><span style="font-size: 12.0pt; font-family: Wingdings; color: #31859c;">à</span><span style="font-size: 12.0pt; color: #31859c;"> Domain </span><span style="font-size: 12.0pt; font-family: Wingdings; color: #31859c;">à</span><span style="font-size: 12.0pt; color: #31859c;"> Configuration) production environment</span></strong></p></div>
<div style="background-color: #f4f4f4; padding: 10px; margin-top: 20px;">
<p style="margin: 0;">Reply to this message by <a href="https://community.jboss.org/message/751463#751463">going to Community</a></p>
        <p style="margin: 0;">Start a new discussion in Beginner's Corner at <a href="https://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2075">Community</a></p>
</div></td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
</div>
</body>
</html>