<!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;">&#160;</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;">&#160;</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;">&#224;</span><span style="font-size: 12.0pt; color: #31859c;"> Standalone </span><span style="font-size: 12.0pt; font-family: Wingdings; color: #31859c;">&#224;</span><span style="font-size: 12.0pt; color: #31859c;"> Configuration )&#160; &#8230;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;">&#224;</span><span style="font-size: 12.0pt; color: #31859c;"> Domain </span><span style="font-size: 12.0pt; font-family: Wingdings; color: #31859c;">&#224;</span><span style="font-size: 12.0pt; color: #31859c;"> Configuration)&#160; &#8230;production</span></strong></li></ol><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</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 &#8230;&#8230;</p><p style="margin-left: 0.5in;">&lt;subsystem xmlns="urn:jboss:domain:security:1.1"&gt;</p><p style="margin-left: 0.5in;"> &lt;security-domains&gt;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</p><p style="margin-left: 0.25in;"> This was added.</p><p style="margin-left: 0.5in;"> &lt;security-domain name="configAppSecurityDomain" cache-type="default"&gt;</p><p style="margin-left: 0.5in;"> &lt;authentication&gt;</p><p style="margin-left: 0.5in;"> &lt;login-module code="RealmUsersRoles" flag="required"&gt;</p><p style="margin-left: 1.5in;">&lt;module-option name="usersProperties" value="${<span style="color: gray;">jboss.server.config.dir</span>}/mgmt-users.properties"/&gt;</p><p style="margin-left: 105.75pt;">&lt;module-option name="rolesProperties" value="${<span style="color: gray;">jboss.server.config.dir</span>}/mgmt-roles.properties"/&gt;</p><p style="margin-left: 0.5in;"> &lt;module-option name="realm" value="ManagementRealm"/&gt;</p><p style="margin-left: 1.5in;">&lt;module-option name="unauthenticatedIdentity" value="nobody" /&gt; </p><p style="margin-left: 0.5in;"> &lt;module-option name="password-stacking" value="useFirstPass" /&gt;</p><p style="margin-left: 0.5in;"> &lt;/login-module&gt;</p><p style="margin-left: 0.5in;"> &lt;/authentication&gt;</p><p style="margin-left: 0.5in;"> &lt;/security-domain&gt;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</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;">&#160;</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;">&#160;</p><p>&lt;security-constraint&gt;</p><p> &lt;web-resource-collection&gt;</p><p> &lt;web-resource-name&gt;ConfigWebApp&lt;/web-resource-name&gt;</p><p> &lt;description&gt;Configuration Application&lt;/description&gt;</p><p> &lt;url-pattern&gt;/*&lt;/url-pattern&gt;</p><p> &lt;http-method&gt;GET&lt;/http-method&gt;</p><p> &lt;http-method&gt;POST&lt;/http-method&gt;</p><p> &lt;/web-resource-collection&gt;</p><p> &lt;auth-constraint&gt;</p><p> &lt;role-name&gt;<strong style="color: #e46c0a;">configAppUserRole</strong>&lt;/role-name&gt;</p><p> &lt;/auth-constraint&gt;</p><p>&#160;&#160;&#160; &lt;/security-constraint&gt;</p><p>&#160;&#160;&#160; &lt;login-config&gt;</p><p> &lt;auth-method&gt;BASIC&lt;/auth-method&gt;</p><p style="margin-left: 1in;">&lt;realm-name&gt;ManagementRealm&lt;/realm-name&gt;</p><p>&#160;&#160;&#160; &lt;/login-config&gt;</p><p>&#160;&#160;&#160; &lt;security-role&gt;</p><p> &lt;role-name&gt;<strong> <span style="color: #e46c0a;">configAppUserRole</span></strong> &lt;/role-name&gt;</p><p>&#160;&#160;&#160; &lt;/security-role&gt;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</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;">&#160;</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;">&#160;</p><p style="margin-left: 0.5in;">&lt;?xml version='1.0' encoding='UTF-8' ?&gt;</p><p style="margin-left: 0.5in;">&lt;jboss-web&gt;</p><p style="margin-left: 0.5in;"> &lt;security-domain&gt;java:/jaas/configAppSecurityDomain&lt;/security-domain&gt;</p><p style="margin-left: 0.5in;">&lt;/jboss-web&gt;</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</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;">&#160;</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;">&#224;</span> bin). Make sure the realm is ManagementRealm.</p><p style="min-height: 8pt; height: 8pt; padding: 0px;">&#160;</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;">&#160;</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;">&#160;</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;">&#224;</span><span style="font-size: 12.0pt; color: #31859c;"> Standalone </span><span style="font-size: 12.0pt; font-family: Wingdings; color: #31859c;">&#224;</span><span style="font-size: 12.0pt; color: #31859c;"> Configuration)&#160; 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;">&#224;</span><span style="font-size: 12.0pt; color: #31859c;"> Domain </span><span style="font-size: 12.0pt; font-family: Wingdings; color: #31859c;">&#224;</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>