Version User Scope of changes
Dec 21 2008, 9:20 PM EST (current) abhi.garg 76 words deleted
Dec 21 2008, 7:34 PM EST Khushroo 75 words added

Changes

Key:  Additions   Deletions
We have used the below code to access an external provider. The below code creates a user record in the "User" table programatically after authenticating the user against the external database. Currently the olny column in the table being populated is "DUSER" which is the username. We wish to also add other attributes such as DEMAIL, DFULLNAME. We would also like to add a role to the user programatically.Any help will be appreciated.Khush FAQQ: I have a custom security user provider. I've created the class:
public class CustomAuthProvider implements ProviderInterface, UserProvider
I've overridden the checkCredentials() method.
public void checkCredentials(UserData userData, DataBinder inBinder, boolean isLoadAttributes) throws ServiceException
I now want to add a role to the user and I want to add additional attributes. The additional attributes are out of the box user metadata fields like email and custom user metadata fields, like department.

A:


This page attempts to document doing a security integration with UCM.

If you want to use a different source for user information (username, password, information(email,etc), and security info (roles, accounts)), then you can create a user provider.

User Provider Notes:

1.
Create a user provider component.

2.
public class YourClassName implements ProviderInterface, UserProvider {
private Provider m_provider = null;

3.
public void init(Provider provider) throws DataException {
m_provider = provider;
}

public void checkCredentials(UserData userData, DataBinder inBinder,
boolean isLoadAttributes) throws ServiceException {
// DataBinder pdatabinder = m_provider.getProviderData();
boolean authenticateUser = StringUtils.convertToBool(inBinder
.getLocal("authenticateUser"), false);

if ( ! authenticateUser ) {
return;
}
String uid = userData.m_name;
String password = password = inBinder.getActiveValue("userPassword");
boolean userHasAuthenticated = StringUtils.convertToBool(inBinder
.getLocal("hasAuthenticatedUser"), false);

if (!userHasAuthenticated) {
boolean userauthorized = // CODE HERE TO VALIDATE USER.

inBinder.putLocal("hasAuthenticatedUser", (userauthorized) ? "true"
: "false");
inBinder.putLocal("SourcePath", "");
userData.setProperty("lastLoadedTs", String.valueOf(System
.currentTimeMillis()));
}

Environment:
Oracle Enterprise Linux 5U2. UCM 10gR3. Oracle 10g Database. Apache.

first off get a gcc compiler for you linux distro. Maybe add the follow lines to /etc/yum.conf:

[EL5.2 DVD]
name = Enterprise Linux 5.2 DVD
baseurl=http://10.187.68.68/~fentontravers/el5dvd/Server/
gpgcheck=1
enabled=1

this assumes you've got the linux os extracted to the URL above.

then do a :

yum install gcc

This will install the gcc compiler.