Weblogic Portal Authorization – Get and Check User’s Roles

| Posted by watashii | Filed under Java, Programming, Web

The Authorization class provides runtime methods for security policies and roles checks.  The following code fragment obtains the set of roles the logged-in user belongs to.  Note the user must be authenticated first, see Authentication class.

String entAppName = ApplicationHelper.getNonVersionedAppName();
String webAppName = ApplicationHelper.getWebAppName(request);
EnterpriseRoleResource resource = new EnterpriseRoleResource(entAppName,webAppName,EntitlementConstants.P13N_ROLE_POLICY_POOL,"");
Map userRoles = Authorization.getRoles((P13nResource) resource);
if (Authorization.isUserInRole("Admin", userRoles)) {
	return true;
}

Global and Enterprise Application roles are obtained using EnterpriseRoleResource.  For Global, Enterprise, and Web Application roles, use WebappRoleResource.

com.bea.p13n.security.Authentication

Tags: , , , ,

BusinessObjects InfoView LDAP Authentication Error

| Posted by watashii | Filed under BusinessObjects, Software

Suddenly one day I got the following error when logging into InfoView via LDAP (with SSL):

Account Information  Not Recognized: The secLdap plugin failed to connect to the specified hosts.

However when logging into CMC via LDAP there were no problems.

The solution is to do with the cacerts file (and .keystore, if using mutual authentication).  Usually this is caused by an expired certificate.   Server authentication (or mutual authentication) does not verify the certificates when LDAP authentication is via CMC.

To fix the problem, obtain the valid certificates then recreate the necessary cacerts and .db files.  Go through the CMC LDAP configuration wizard to validate it, then restart the CMS for settings to take effect.

Tags: , , ,

SSH Passwordless Authentication

| Posted by watashii | Filed under Software, Unix

This post shows how to use PuTTY (Windows) to login to a remote server (UNIX) over SSH without password.

Read the rest of this entry »

Tags: , , , ,