Logging in and creating user programmatically

Greetings,
I would like to embed Stardust into my Spring-based web application. I created the tables for Stardust in my database and I'm trying to create a new user through the UserService interface in code.
userService.createUser(request.getUsername(), null, null, null, request.getPassword(), null, null, null);
The above code results in an AccessForbiddenException with the following error code: AUTHx00101 - Not logged in.
The UserService interface doesn't have a login method but I looked up the UserServiceBean class and it has it. I logged into the default domain and partition with the default (motu) user with the code below:
Map<String, String> properties = new HashMap<String, String>();
properties.put(SecurityProperties.PARTITION, "default");
properties.put(SecurityProperties.DOMAIN, "default");
((UserServiceBean) userService).login("motu", "motu", properties);
The login method returns a LoggedInUser object for the motu account. Now if after this I call the UserService.createUser(...) method I get the same error code what I described above. I also tried to call the UserService.startSession(...) method after login but that didn't work either.
What is the proper way to do this? Do I really have to authenticate myself in code to perform a user creation operation? Having to cast the interface to a concrete class doesn't seem right to me, the other option would be to cast it to ManagedService I guess but that doesn't feel right either. What am I missing here?

Is using the ServiceFactoryLocator the proper way for Spring-based applications? I generated a standalone Spring-based Stardust application with the tc7-ipp-portal-war Maven archetype and it defines service beans in the carnot-spring-services-context.xml file this way:
<bean id="carnotWorkflowService"
parent="abstractPublicCarnotService"
class="org.eclipse.stardust.engine.api.spring.WorkflowServiceBean" />
<bean id="carnotUserService"
parent="abstractPublicCarnotService"
class="org.eclipse.stardust.engine.api.spring.UserServiceBean" />
<bean id="carnotQueryService"
parent="abstractPublicCarnotService"
class="org.eclipse.stardust.engine.api.spring.QueryServiceBean" />
<bean id="carnotAdministrationService"
parent="abstractPublicCarnotService"
class="org.eclipse.stardust.engine.api.spring.AdministrationServiceBean" />
<bean id="carnotDocumentManagementService"
parent="abstractPublicCarnotService"
class="org.eclipse.stardust.engine.api.spring.DocumentManagementServiceBean" />
<bean id="carnotReportingService" lazy-init="true"
parent="abstractPublicCarnotService"
class="org.eclipse.stardust.reporting.rt.service.spring.ReportingServiceBean" />
<bean abstract="true" id="abstractCarnotService"
class="org.eclipse.stardust.engine.api.spring.AbstractSpringServiceBean">
<property name="carnotProperties" ref="customCarnotProperties" />
<property name="transactionManager" ref="carnotTxManager" />
<property name="dataSource" ref="xaAuditTrailConnectionFactory" />
<property name="jcaResourceProvider" ref="carnotJcaResourceResolver" />
<property name="jmsResourceProvider" ref="carnotJmsResourceResolver" />
</bean>
<bean abstract="true" name="abstractPublicCarnotService"
parent="abstractCarnotService">
<!--property name="principalProvider" ref="whatever" / -->
</bean>
My problem is that services acquired through the ServiceFactoryLocator won't be part of the ApplicationContext, thus they won't be managed by the Spring IoC-container at all.

Similar Messages

  • Id email address cancelled. how do I log in and create new password?

    id email address cancelled. how do I log in and create new password?

    This link tells you how to change your Adobe ID and password:
    http://helpx.adobe.com/x-productkb/policy-pricing/account-password-sign-faq.html
    And if it doesn't, there's a "Still Need Help?" link which leads you to web chat where you can talk with a person.

  • Question on icloud and creating users

    I have noticed that my Macbook Pro will create its own user.  I immediately deleted this user since I didn't create it and thought it was taken care of.  Well, I turned on my computer again today and the user was created again, without my consent.  My initial reaction is to think that this is a virus but I started using iCloud recently to share photos with my family and thought maybe using iCloud will create a user for some reason.  This hasn't happened before in the 4 years I have owned the Macbook Pro.  I updated to Mavericks so maybe something finally came through in the update.  I really have no idea what is going on.  All I am used to seeing when I turn on my computer is the administrator (me) and another user I created.  Now there is a third user that has been created all by itself.  Has anyone encountered this before?  Any help would be appreciated!!  Basically, I am stressed out because now I think I have a virus. 

    The Guest account is built-in. It has probably been activated again by a recent system update. Updates will sometimes reset the preference settings to default values.   But I would keep the Guest Account active. This account cannot be used by remote users. And it is a nice honey pot, if you ever lose your Mac. If the thief will log in using the guest account, you can detect this with Find My Mac.
    guest user: Guest users can use your computer temporarily without you having to add them as individual users. You can set restrictions guests can access only the items you want to share. Files created by a guest are stored in a temporary folder, but this folder and its contents are deleted when the guest logs out. The guest account works with the Find My Mac feature of iCloud, which can help you find your Mac if you lose it. You can locate your Mac if someone finds it, logs in as a guest, then uses Safari to access the Internet. Guests:
    Don’t need a password to log in
    Can’t change user or computer settings
    Can’t log in remotely when remote login is turned on in Sharing preferences

  • How To create custom login and create user pages

    Where can I find documentation that discusses how I can create a custom login page and create new user page?
    Also, I cannot find how to get away from the default login page.
    I am using 9iAS/Portal R2.
    Bill G...

    Well - I did find some docs;
    Chapter 8 of the Oracle9 iAS Single Sign-On.pdf file titled "Customizing the Single Sign-On Interface" has some good info but I'm wondering about the "create new user part".
    Bill G...

  • Amanda; And creating user accounts BEFORE the build process

    I am trying to make a package for amanda (Advanced Maryland Automatic Network Disk Archiver) http://www.amanda.org.
    I have gotten everything to run fine, but the way the devs have set up their configure file (and the resulting build process),
    I HAVE to specify a user account that the program will run as. If I do not specify (and create an account) the PKGBUILD will not run. Is this normal?
    Is there a way to make the PKGBUILD create an account and a group? This account and group are need both DURING the build and during the install.
    It has to be a pre-existing user account.  Here is my PKGBUILD script:
    pkgname=amanda
    pkgver=2.6.0p1
    pkgrel=1
    pkgdesc="The Advanced Maryland Automatic Network Disk Archiver"
    url="http://www.amanda.org/"
    license=('BSD')
    depends=("glibc")
    #If you need amplot and/or samba support (for backing up windows clients) delete the line above and uncomment the line below this line
    #depends=("glibc" "samba" "gnuplot")
    install=(amanda.install)
    arch=('x86_64' 'i686')
    source=(
    http://downloads.sourceforge.net/amanda/amanda-2.6.0p1.tar.gz
    md5sums=('afadad80e0a27963a24b510755470983')
    build() {
    cd $startdir/src/amanda-2.6.0p1
    # These config options are documented at:
    # http://wiki.zmanda.com/index.php/Installation/Installing_Amanda_Source
    ./configure CFLAGS="-03 -Wall" \
    --with-user=amanda \
    --with-group=backup \
    --prefix=$startdir/pkg/usr/local \
    --with-amperldir=$startdir/pkg/usr/local/share/perl5/site_perl/5.10.0
    make || return 1
    make install prefix=$startdir/pkg/usr/local
    I would really appreciate some help (this is my first pkg)
    Also remember; this will not finish building without creating a user and a group
    #groupadd backup
    #useradd -g backup amanda
    Last edited by timetrap (2008-06-19 19:08:09)

    I didn't take it any farther than the first post. I became frustrated with the chicken/egg relationship with account/makepkg.
    The package works (as long as the user accounts are created first) if you can figure out a way around this issue feel free to update the pkg (then upload it to AUR).
    The nobody/nobody idea didn't work for me, I cannot remember the reason why. It had something to do with permissions. Let me know if you need any help.
    Last edited by timetrap (2009-01-01 03:12:17)

  • Create User Programmatically Bug

    Does anyone know the reason Portal occassionally crashes when a
    user is created programmatically? My application will email a
    new user with a link that calls a PLSQL procedure that uses the
    APIs to create a user and assign them to a group. It then
    attempts to throw a public portal page for the user to login.
    What happens is the user is created correctly, but before
    opening the Portal page multiple error messages are displayed on
    the browser. To successfully access Portal after this occurs,
    all browsers must be closed, and a new then reopened. I saw
    this as an open TAR on Metalink, but I was wondering if anyone
    knows of a solution to this mess?
    Thanks!

    Hi Matthew,
    I believe this may have something to do with the login cookies
    that the Portal sets when the login page is served. If this
    cookie is not established at the outset you may encounter some
    errors. Not knowing the specific errors makes diagnosing this
    somewhat tricky. I hope this helps.
    Dave Ziegler
    Rosenbluth International

  • Loading metadata and creating users in FDM

    hi friends ,
    1) I am using HFM and FDM9.3.1 Can we load HFM metadata using FDM.If yes pls tell me how?
    2)Pls tell me the steps to configure shared services with FDM.Can we configure only msad and ldap with FDM?
    Is there any role of vb authentication scripts for shared services user or is it only forusers created in user management in FDM?

    Hello,
    Currently FDM can not load metadata to HFM. You would need something like MDM/DRM as that is their job.
    FDM 9.3.1.x only integrates with MSAD/LDAP/NTML providers. While SharedServices leverages the OpenLDAP software, it may be possible. I would recommend creating a Support SR to obtain the process.
    Fusion Edition (11.1.1.x) directly integrates with SharedServices.
    Thank you.

  • Delete and create user

    hi,
    i deleted a user and if i wanna create a user with same name i doesn't work..
    why?
    Thx,
    skydriver

    If the original account's home folder is still present in /Users/, move it to the /Users/Shared/ folder and try creating the account again; in some circumstances, the existence of a former account's home folder in /Users/ will interfere with the creation of a new account with the same short name. One situation which will cause it is if you are rebuilding the NetInfo database and recreated your accounts in a different order from the one they were originally created in.
    (11539)

  • How can I log out and change user in Adobe Creative Cloud?

    seems to me it's impossible

    Hi there,
         Once you launch Creative Cloud Desktop Application, select the Gear icon which is located on the top right side of the CC Window and choose 'Preferences'. Under 'Preferences' click on 'Account' tab where you will see 'Sign out' button. Once you click on this button, it Signs out from all the Creative Cloud applications.
    The other simple solution is: Once you launch any Adobe Creative Cloud application like Photoshop or Indesign, choose "Help" > Signout. Even this step will deactivates all the other CC applications.
    Later, when you launch any application, it would say that it is running in trial version and will prompt you to enter your credentials.
    Regards,
    Jairaj

  • Need to authenticate a user and create session thru a procedure.

    I am doing loadtest on portal and I need to authenticate a user and create user session to simulate user logging thru the web and I want to see a record is created in the wwctx_sso_session$ table.
    can we do this from stored procedure ?
    thanks.

    Hi,
    I guess the message is pretty clear !! you lack privilege.
    SQL> conn imx/imx
    Connected.
    SQL>
    SQL> create user testproc identified by testproc;
    create user testproc identified by testproc
    ERROR at line 1:
    ORA-01031: insufficient privileges
    SQL> create or replace procedure sp_createsuser(username varchar2)
      2  as
      3  begin
      4  execute immediate 'create user ' || username || ' identified by ' || username;
      5  end;
      6  /
    Procedure created.
    SQL> exec sp_createsuser('testproc');
    BEGIN sp_createsuser('testproc'); END;
    ERROR at line 1:
    ORA-01031: insufficient privileges
    ORA-06512: at "IMX.SP_CREATESUSER", line 4
    ORA-06512: at line 1
    SQL> conn sys/******* as sysdba
    Connected.
    SQL> grant create user to imx;
    Grant succeeded.
    SQL> conn imx/imx
    Connected.
    SQL> exec sp_createsuser('testproc');
    PL/SQL procedure successfully completed.
    SQL> conn sys/syssys as sysdba
    Connected.
    SQL> select username from dba_users where username like 'TESTP%';
    USERNAME
    TESTPROC
    SQL>Regards

  • How to create SR Queue and Custom User Role for technician only see which SR assigned Him/Her and Resolve

    Hi 
    I have created workitem SR advance and Criteria with ID [Assigned To ME] and created user role in Advance operators.
    But in technician Console showing which SR he/she created not service desk assigned to him/her.
    Please suggest...
    Regards
    Sheetla Maurya

    I have find out Solution .......Create Queue with Service Request Advance and we not need to create any criteria option, After that create custom User role on Advance
    operators with View "Assigned To ME"
    Regards
    Sheetla Maurya

  • Way to programmatically drop-and-create-tables?

    Hi all,
    I have a persistence unit which exists to provide lookup information to my application. It is populated by data that is available at runtime. It takes a long time to parse this data, and therefore my intention is to only parse it once at the deployment target. To do this, I have created a main method that does all the parsing, and I do not set the toplink.ddl-generation property in persistence.xml. This causes the application to fail if the database is not created.
    However, this means that during the population stage, I must drop and create any existing tables. I had thought it would be possible to do this by obtaining an EntityManagerFactory which has a property map sent to it, containing the property toplink.ddl-generation set to drop-and-create-tables. But this does not work... the tables are not dropped (if they exist) and are not created (if the database is empty).
    Is it possible to do the drop-and-create-tables programmatically using the JPA?
    I may have another EntityManagerFactory open at the same time, which has been opened with the default options... would this be conflicting?

    I don't think there is any easy way to generate the default tables once your have created the EntityManagerFactory. You could use the EclipseLink/TopLink schemaframework or TableCreator to create tables using a EclipseLink/TopLink DatabaseSession.
    There is a DefaultTableGenerator in org.eclipse.persistence.tools.schemaframework, which may give you what you are looking for.
    -- James : http://www.eclipselink.org

  • Re-provisioning to RTC for re-created users

    Seems that there's a problem with RTC provisioning when re-creating a user with the same name in OID. The only workaround I've found so far is to restart the RTC component with opmnctl. Doing this, there was another problem - restart fails:
    [oracle@pluto ~]$ /home/oracle/product/10.1.2/ocs_1/apps/opmn/bin/opmnctl restartproc ias-component=RTC
    opmnctl: restarting opmn managed processes...
    ================================================================================
    opmn id=pluto.krnap.cz:6201
    0 of 1 processes restarted.
    ias-instance id=ocsapps.pluto.krnap.cz
    ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
    ias-component/process-type/process-set:
    RTC/rtcpm/rtcpm
    Error
    --> Process (pid=17350)
    process crashed during restart
    Log:
    /home/oracle/product/10.1.2/ocs_1/apps/opmn/logs/RTC~rtcpm~1
    I have to use this sequence to sucessfully restart RTC:
    [oracle@pluto ~]$ /home/oracle/product/10.1.2/ocs_1/apps/opmn/bin/opmnctl stopproc ias-component=RTC
    opmnctl: stopping opmn managed processes...
    [oracle@pluto ~]$ /home/oracle/product/10.1.2/ocs_1/apps/opmn/bin/opmnctl startproc ias-component=RTC
    opmnctl: starting opmn managed processes...
    Anybody dealing with this or similar issues?
    Thanks a lot.
    Zdenek

    Hello there,
    This is what I took as remedy steps:
    Created a new versin of the OID form. Checked the prepop adapters are attached properly or not - everything looks good there.
    Then I tried doing direct provisioning the OID resource to a user unchecking the auto save on the process defn. Saw and checked the process form values. All the values are prepop'ed perfectly. As soon as you click the last 'Continue' button - the user gets provisioned. If you click 'OID User', it'll only show 2 tasks 'System Validation' and 'Create User' as 'Completed'.
    Activated the Access policy on OID User.
    Now again tried to create a single user.So now if you click 'OID User', it'll show 2 tasks 'System Validation' as 'Completed' and 'Create User'
    as 'Rejected' with the response as 'User Creation Failed' and description as 'Could not create user'.
    The logs still show the same error.
    I don't know what's exactly wrong with this 'Auto-Save' option? or may be it has to do with the Access policy process form - any info needs to be provided at the time of creating the access policy when we click 'Next' on OID process form?
    Thanks,
    - oidm.

  • Can't create user

    My computer shut down for no apparent reason. When I switched it on again, it didn't recognise my password. Luckily, I had another user and could log into that. The main user folder is in the home directory too with everything intact. The user has disappeared altogether from the Accounts pane in System Prefs. I logged in as root administrator to create a user with the same name as the folder. It all went smoothly and asked if I want to use the existing folder with that name as the home folder. I clicked OK but then nothing. No new user was created. I tried it several times. I even tried with a different name. It created a folder but no user. Can anyone shed some light?

    user13333117 wrote:
    Dear friends,
    I have a little problem while i running my Oracle BI 11g. After I install it into my computer Win7 32bit, I tried to create the Analysis , Dash Board and Reports. I have found a problem after i create my testing reports , the problem is " I can't find the User Creation in Admin Tab ". What should I do ? Do I need patch to apply for it?
    or Do i need the license for it too?
    I hope you can help me....
    Thank,
    DorangYou don't create user's in the front end. You will need to login into web logic's console and create user's there. Only thing you can create in the analytic's administration page as far as security goes is catalog groups.
    Refer to this link to learn how to create users and groups using WLST. ( http://middlewaremagic.com/weblogic/?p=4981 )
    It would be easier to use WLST if you were to create a bulk of users, as it would be time consuming to create one by one via front end.
    Please mark if helps.
    Thanks,
    -A.Y

  • Adding users programmatically to WLS 10

    I've blogged a little about it [url http://internna.blogspot.com/2007/04/create-users-programmatically-in.html]here. Hope it helps!

    Hi ,
    Dont add the weblogic.jar file in your application explicitly then check the error you get,and also dont specify the location of the class in your application.
    Let me know if you face any errors after the above suggestions.
    Regards,
    Rohit Jaiswal

Maybe you are looking for

  • My iphone won't charge and it cant recognize by my computer

    My phone died so i tried to charge it but after 20 minutes nothing happened. but when i hold either the home button or sleep button the apple logo appears and disappears in more than 10 seconds. i tried to reset it but it wont work neither the apple

  • Table field more than 255 characters long

    Dear Experts, I want to create a table field more than 255 chars long It will be possible through LCHR or LRAW but incase it field contists of data less 255 chars it will result in loss of data. Plz help

  • How to open .exe files

    I want to run a .exe extension file which is in a folder on my disc. How to launch it from LabVIEW.? Solved! Go to Solution.

  • Problem when opening a message

    hey i bought nokia 130 today in asia  problem is that when i open my inbox .......it show wait time bar ......for  2 to 3 sec ...then  wehn i open any sms , it again shows wait time bar for 2 or 3 seconds  and when i close sms to came back to my inbo

  • My internet is extremely slow

    I recently just bought a new wireless modem and since then my internet has been really slow. Ive tried deleting all data, emptying cache, clearing history, and resetting Safari but nothing has worked. Any suggestions? Is it just a problem with my mod