![]() Now, if we navigate to the administrator’s page: To test that our scenario works as intended we head to the landing page first (the browser will ask for credentials so we will input cbeta/ cbeta): Now that we have configured our application, we can just simply build our WAR file and deploy it to Payara Server (I recommend using Maven for this step). With this configuration, whenever Payara Server checks the authorization access permissions of a user against the LDAP server, it will use the mappings defined to check the correct group based on its roles. ldap -test Admins ADMIN Common COMMON_USER Keep in mind that these 2 roles MUST be mapped to the corresponding groups that are registered in the LDAP server.įinally, we configure the role mappings in the glassfish-web.xml file: In the security-constraint section we are distributing the access to the 3 pages we created to the 2 roles ADMIN and COMMON_USER.In a production environment, you may choose a more robust auth-method configuration since BASIC is an insecure option. In the login-config session we are configuring how our application will be authenticating users: using BASIC authentication against the LDAP realm we created.xhtml General Security All /* ADMIN COMMON_USER Only for administrators Admin /admin /* ADMIN BASIC userDirectoryRealm 5 FacesServlet 1 Faces Servlet *.xhtml index. PROJECT_STAGE Development Faces Servlet javax. For this application, we will create 3 sample JSF pages:ġ - Our first page will be an index.xhtml landing page that will simply print out the UID/Username of the authenticated user: Next, we proceed to create a sample web application to test out our LDAP configuration. For example: ou=People, uid=%s would limit the search to all users under the People organization unit object. ![]() ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |