How to make a login method for SAP Netweaver in java

Hi
Can anyone help me out to make a login() method that can be used to login to the SAP Netweaver server using a simple java code..........
Hope a helpfull answers from u all....
THANKS in ADV.
Rupesh Khemka

Hi Everyone
I have made the login() method but i am facing the problem while making the resource context...Because in Resource Context it takes IUser of package
com.sapportals.portal.security.usermanagement.IUser but I have got IUser of package com.sap.security.api.IUser ...while type Casting it with below code it is giving ClassCAstException.......
public class NewSimpleServlet extends HttpServlet {
     protected void doGet(
          HttpServletRequest request,
          HttpServletResponse response)
          throws ServletException, IOException {
          StringBuffer s = new StringBuffer();
          try {String j_user="epuser";
                    String j_password="Abcd1234";
                    request.setAttribute("j_user", j_user);
                    request.setAttribute("j_password", j_password);
                    javax.security.auth.Subject subject;
Set principals = UMFactory.getLogonAuthenticator().logon(request, response, "uidpwdlogon").getPrincipals();
i have problem with getting IUser object from set of principals. In javadoc is written: "In order to get an IUser object from this subject, call Subject.getPrincipals() and iterate through the returned Set of principals." so i tried to iterate but i was not able to get that IUser with any casting. Do u know how it should be?
IUser serviceUser = (IUser)subject.getPrincipals().iterator().next();
Now in resource Context
ResourceContext c = new ResourceContext(User);
Here resource context need IUser type object as parameter...
I also tried st like this
loggedUser = UMFactory.getAuthenticator().getLoggedInUser(request, response);
but loggedUser is not authenticated.
Can Anyone Help me Out...
Thanks
Rupesh Khemka

Similar Messages

  • How to apply sap license for Sap Netweaver AS Java

    Hello guys,
    May i know how to apply sap license for SAP Netweaver AS Java?  Appreciate the reply, thank you
    regards,
    wei how

    Hi Lee,
    check below link:
    http://help.sap.com/saphelp_nwce10/helpdata/en/9f/5e533e5ff4d064e10000000a114084/content.htm
    Thanks
    sunny

  • How to make cross Tab report for SAP B1

    Hello and Hi
    i trying to make cross tab report for SAP B1 but test column not appera in
    File >>New >>Cross Tab Report  start cross tab report creation wizard select database name and table
    but only numeric columns appear in available column fields , how will appearall fields including test fields..

    i got solution
    thanks google
    memo type field will not apper in list .use bellow  statment to convert in interger or char type
    convert(int,U_Dist_Sr_No) AS Dist_Sr,            CAST(U_Dist_Name AS varchar(250)) AS Dist_Name,

  • How to deploy BI  on EHP1 for SAP NetWeaver Composition Environment 7.1

    Hello Gurus,
    i have installed SAP NetWeaver 7.01 SR1 SP3 ABAP Trial Version  at home on vista 32 bits.
    it's running well...
    next i have installed EHP1 for SAP NetWeaver Composition Environment 7.1 - Preview Version
    and follow this guide :
    https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/b057d7e3-b89e-2b10-1e9e-c426e967f8e1
    the portal is running well....coooool.. ( http//:localhost:50100/irj/portal)
    after i follow this documentation to create some cubes on BI abap trail (client 001).
    https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/4096b8fc-6be7-2a10-618e-b02a5e5e798f
    i create my report with the query designer,
    and i see my bi report with transaction RSRT and ABAP WEB tab ( http://localhost:80000)
    it's running well....whaooouuu !!!!
    Now i'm lost, i would like to deploy my bi report on the portal, but i don't know what i must do.
    ( and when i try with the query designer or rsrt + java web i have a error message )
    - perhaps create an user communication  between portal/bi abap  where ?
    - how to deploy bi java on portal (EHP1 for SAP NetWeaver Composition Environment 7.1)
    by the way, i can't find the bi post install template in the configuration wizard on the the portal...
    thank's for your help.
    Florent,
    Edited by: Florent BUTTY on Mar 24, 2009 1:43 PM

    Hi,
    Can you please tell me what is the diff between 7.01 & 7.1? if you can share any docs, is highly appreciated.
    Thanks,
    Kiran

  • Login method for swing

    Let say i got a simple login swing interface now with JPasswordField. Any ideas on how to write the login method for my interface..like if i got different users..i want them each to redirect to another interface.

    Hi ken305,
    I suppose you have your users stored in a database?!? Connected to each user you should have some kind of user-level variabel that you can check, and from that variable you redirect the user to the proper interface.
    Regards.
    / David

  • How to import Support Package 13(SAPKW70013) for SAP NetWeaver 2004s BI

    Hi,
    How to import Support Package 13 for SAP NetWeaver 2004s BI (BI Patch 13 or SAPKW70013)
    Note no for that is : 1019055.
    Thanks in Adavance,
    Dushyant.

    Hi,
    RTC for BI 7.0 SAP_BW SP 13 is scheduled in CW 21, that is coming week, after that you should be able to download it from service market place.
    @others: Dont get confused about SPS release with SP release. BI has intermediate release which is SP release, SPS is SP-Stack release (which is NetWeaver release).
    SP 12 correspond to SPS 12 which is sceduled CW 21.
    Hope this helps.
    Best Regards,
    Rajani

  • Where/What are the roots of SAP (Netweaver) in Java... ???

    Where is the STARTING point for SAP (NetWeaver) in Java... ? How and where from can I get some of the most basic/elementary stuff for this paradigm... Java-to-SAP (esp. NetWeaver/ XI/ etc...)

    Hi Sudhakar,
    For SAPUI5 you can go ahead with Portal 7.3 and ECC 6.0 EHP3.
    Refer SAP note 1747308 - Installation Guide UI development toolkit for HTML5 (SAPUI5)
    for installation pre-requisites and steps.
    Now for external facing portal & transaction iView can you please elaborate the requirement
    Hope this helps.
    Regards,
    Deepak Kori

  • How to make a portlet unvisible for another(not Owners) Users?

    Hi all,
    I (Site-Owner) have create a little Portal-Site with any portlets.
    I want to make one or two portlets(Admin-Area) unvisible for other users. But when I create a portlet as Site-Owner, then all another users can they see.
    How to make a portlet unvisible for another users?
    Regards
    Leonid Pavlov

    You can hide and show portlets of Web providers (OmniPortlet, Web Clipping, and Java portlets) on portal pages dynamically. This functionality is controlled by security managers. The PDK provides a number of security managers. For example:
    o Group security manager: The group security manager makes the portlet appear to users who are members of a specified group, while hides the portlet for those who are not members.
    o Authentication level security manager: You can use the authentication level security manager to control access to the portlets based on the user’s authentication level. For example you may hide the portlet from public users, but display it to authenticated users.
    In addition to the security managers provided by the PDK, you can build your own security managers.
    Although OmniPortlet and Web Clipping do not expose security managers through the user interface, you can apply them by editing their XML provider definition file.
    For PL/SQL portlets you can use the is_runnable method to control whether the portlet is hidden or shown.
    Peter

  • How to use the index method for pathpoints object in illustrator through javascripts

    hii...
    am using Illustrator CS2 using javascripts...
    how to use the index method for pathpoints object in illustrator through javascripts..

    Hi, what are you trying to do with path points?
    CarlosCanto

  • How to make a good referencing for my web site

    hi. i start with muse and would like to know how to make a good referencing for my web site; thanks for your answers...

    Google and search the forum for: SEO or Search Engine Optimisation

  • How to make saved IR available for all users

    Hi,
    I've created IR and saved it to several tabs based on search conditions.
    But they're only visible for developers.
    How to make these tabs available for all end-users ?
    Does version 4.0 support this option ?
    Thank you!

    Hi
    At present this feature is not included, although I believe it may be in 4.0. Many people have provided workarounds for this. None of which I have tried. I cannot find the original thread but here is a solution from a chap called Ruud
    >
    One way to share your saved reports with others is to 'Publish' your report settings to a few intermediate tables in your application and have other users 'Import' your settings from there. The reason for using intermediate tables is so that not all your saved reports need to be 'visible' to other users (only those that you've chosen to publish).
    Basically you have available the following views and package calls that any APEX user can access:-
    - flows_030100.apex_application_pages (all application pages)
    - flows_030100.apex_application_page_ir_rpt (all saved reports - inclusing defaults and all user saved reports)
    - flows_030100.apex_application_page_ir_cond (the associated conditions/filters for above saved reports)
    - wwv_flow_api.create_worksheet_rpt (package procedure that creates a new saved report)
    - wwv_flow_api.create_worksheet_condition (package procedure that creates a condition/filter for above saved report)
    The way I've done it is that I've created 2 tables in my application schema that are straightforward clones of the 2 above views.
    CREATE TABLE user_report_settings AS SELECT * FROM flows_030100.apex_application_page_ir_rpt;
    CREATE TABLE user_report_conditions AS SELECT * FROM flows_030100.apex_application_page_ir_cond;
    ( NB. I deleted any contents that may have come across to make sure we start with a clean slate. )
    These two tables will act as my 'repository'.
    To simplify matters I've also created 2 views that look at the same APEX views.
    CREATE OR REPLACE VIEW v_report_settings AS
    SELECT r.*
    p.page_name
    FROM flows_030100.apex_application_page_ir_rpt r,
    flows_030100.apex_application_pages p
    WHERE UPPER ( r.application_name ) = <Your App Name>
    AND r.application_user 'APXWS_DEFAULT'
    AND r.session_id IS NULL
    AND p.application_id = r.application_id
    AND p.page_id = r.page_id;
    CREATE OR REPLACE VIEW v_report_conditions AS
    SELECT r.*
    p.page_name
    FROM flows_030100.apex_application_page_ir_cond r,
    flows_030100.apex_application_pages p
    WHERE UPPER ( r.application_name ) = <Your App Name>
    AND r.application_user 'APXWS_DEFAULT'
    AND p.application_id = r.application_id
    AND p.page_id = r.page_id;
    I then built 2 screens:-
    1) Publish Report Settings
    This shows 2 report regions:-
    - Region 1 - Shows a list of all your saved reports from V_REPORT_SETTINGS (filtered to only show yours)
    SELECT apex_item.checkbox ( 1, report_id ) " ",
    page_name,
    report_name
    FROM v_report_settings
    WHERE application_user = :APP_USER
    AND ( page_id = :P27_REPORT OR :P27_REPORT = 0 )
    ORDER BY page_name,
    report_name
    Each row has a checkbox to select the required settings to publish.
    The region has a button called PUBLISH (with associated process) that when pressed will copy the settings from
    V_REPORT_SETTINGS (and V_REPORT_CONDITIONS) into USER_REPORT_SETTINGS (and USER_REPORT_CONDITIONS).
    - Region 2 - Shows a list of already published reports in table USER_REPORT_SETTINGS (again filtered for your user)
    SELECT apex_item.checkbox ( 10, s.report_id ) " ",
    m.label,
    s.report_name
    FROM user_report_settings s,
    menu m
    WHERE m.page_no = s.page_id
    AND s.application_user = :APP_USER
    AND ( s.page_id = :P27_REPORT OR :P27_REPORT = 0 )
    ORDER BY m.label,
    s.report_name
    Each row has a checkbox to select a setting that you would like to delete from the repository.
    The region has a button called DELETE (with associated process) that when pressed will remove the selected
    rows from USER_REPORT_SETTINGS (and USER_REPORT_CONDITIONS).
    NB: P27_REPORT is a "Select List With Submit" to filter the required report page first.
    Table MENU is my application menu table where I store my menu/pages info.
    2) Import Report Settings
    This again shows 2 report regions:-
    - Region 1 - Shows a list of all published reports in table USER_REPORT_SETTINGS (filtered to show only other users saved reports)
    SELECT apex_item.checkbox ( 1, s.report_id ) " ",
    m.label,
    s.report_name,
    s.application_user
    FROM user_report_settings s,
    menu m
    WHERE m.page_no = s.page_id
    AND s.application_user :APP_USER
    AND ( s.page_id = :P28_REPORT OR :P28_REPORT = 0 )
    ORDER BY m.label,
    s.report_name,
    s.application_user
    Each row has a checkbox to select the setting(s) that you would like to import from the repository.
    The region has one button called IMPORT that when pressed will import the selected settings.
    It does this by using the 2 above mentioned package procedure to create a new saved report for you
    with the information form the repository. Be careful to match the right column with the right procedure
    parameter and to 'reverse' any DECODEs that the view has.
    - Region 2 - Shows a list of all your saved reports from V_REPORT_SETTINGS (filtered to only show yours)
    SELECT page_name,
    report_name
    FROM v_report_settings
    WHERE application_user = :APP_USER
    AND ( page_id = :P28_REPORT OR :P28_REPORT = 0 )
    ORDER BY page_name,
    report_name
    This is only needed to give you some feedback as to whether the import succeeded.
    A few proviso's:-
    a) I'm sure there's a better way to do all this but this works for me :-)
    b) This does not work for Computations! I have not found an API call to create computations.
    They will simply not come across into the repository.
    c) If you import the same settings twice I've made it so that the name is suffixed with (2), (3) etc.
    I did not find a way to update existing report settings. You can only create new ones.
    d) Make sure you refer to your saved reports by name, not ID, when matching APEX stored reports and the
    reports in your repository as the ID numbers may change if you re-import an application or if you
    auto-generate your screens/reports (as I do).
    Ruud
    >
    To me this is a bit too much of a hack and I personally wouldn't implement it - it's just an example to show it can be done.
    Also if you look here in the help in APEX Home > Adding Application Components > Creating Reports > Editing Interactive Reports
    ...and go to the last paragraph, you can embed predicates in the URL.
    Cheers
    Ben
    http://www.munkyben.wordpress.com
    Don't forget to mark replies helpful or correct ;)
    Edited by: Munky on Jul 30, 2009 8:03 AM

  • How to make warehouse field inactive for all users in all documents autom.

    Hi All,
    Can anyone pls tell me "**how to make warehouse field inactive for all users in all documents without having to do it through form setting** "for each and every user. It should be visible but inactive
    Thanks & Regards,
    Mukesh Agrawal

    Hi,
    As a work around create a warehouse SelectWH and map the mandatory acoounts as a On hold account(in chart of accounts).So there will not be any posting on this account.
    And set this warehouse as default warehouse for all users.
    So without selecting the appropriate warehouse the user can not add the document.
    I think this might resolve you issue.

  • How to make jar files availabe for deployed EJBs

    Hi,
    I'm interested on how to make jar files availabe for deployed EJBs.
    My EJB is packed in an ear. It uses a util jar. I now just add the jar to the
    classpath, but I think that shouldn't be the way. Is there somthing in the admin
    console to make jars available or do I have to insert it in the ear file? And
    if so, where do I hve to place it?
    Thanks
    Claudia

    Put the util.jar in the ear with your ejb jars - at the same level (i.e. in
    the root) - but do not include them in the manifest.xml.
    Also each ejb jar that refers to util.jar must have util.jar on its internal
    classpath in the manifest.
    "Claudia" <[email protected]> wrote in message
    news:3d537db5$[email protected]..
    >
    Hi,
    I'm interested on how to make jar files availabe for deployed EJBs.
    My EJB is packed in an ear. It uses a util jar. I now just add the jar tothe
    classpath, but I think that shouldn't be the way. Is there somthing in theadmin
    console to make jars available or do I have to insert it in the ear file?And
    if so, where do I hve to place it?
    Thanks
    Claudia

  • How to make a group contacts for iphone 4s, How to make a group contacts for iphone 4s

    How to make a group contacts for iphone 4s

    Or there are apps
    https://www.google.co.uk/url?sa=t&source=web&cd=3&ved=0CEEQFjAC&url=https%3A%2F% 2Fitunes.apple.com%2Fgb%2Fapp%2Ftext-2-group-fast-sms-imessage%2Fid519077434%3Fm t%3D8&ei=WCkfUc6vE8THtQavlYCoBw&usg=AFQjCNHnoWUqJ9AMYWCadVceOkq-6Ed4Vg

  • How to make the logs captured for Z fields in ME21N/ ME22N

    Hi
    I have  devloped new tab(Screen) and added Z field in the PO header (ME21N) as per my requirement. But whenever I do changes to the perticular Z field, logs are not captured (ME21N->ENVIRONMENT-->HEADERLOG). How to make the logs captured for Z fields like standard fields. Is there any way?
    Regards
    Raj.

    HI Ranjitha
    For the data element of Z fields go to further caracteristics of tab and make change document checkbox ticked.

Maybe you are looking for

  • I cannot move my gadgets in iGoogle to make my homepage appear as it was previously. What happened?

    Sometime over this weekend, my homepage has been altered. I use iGoogle and now data does not load into the gadgets. Nor, can I move gadgets where I want them on my homepage.

  • Itunes not picking up ipod

    When I plug my ipod (ipod touch 5th gen, 4/5 months old) into my laptop windows recognizes it is there (the ipod/cable/laptop all work fine).  However, when it comes to itunes it just doesn't pick it up.  I have run the diagnostics and have been told

  • In Alchemy using xml  class?

    hello, how to call methods of XML CLASS? AS3_Val baClass = AS3_NSGetS(NULL, "XML"); AS3_Trace(baClass);                           //[class XML] AS3_Val Params = AS3_Array("StrType","<foo><p>hello</p></foo>"); AS3_Val ba = AS3_New(baClass, Params); AS

  • PDF files on a Touch???

    Hello, Can you view an electronic booklet, or other PDF file on a Touch with out using Safari? Is there an Adobe app? Cheers

  • What do i do now? The licensing subsystem has failed catastrophically

    I have cs3. When I try to open any of the programs I get error message that says " the licensing subsystem has failed catastrophically. You must reinstall or call customer support."    Customer support says there is no phone support for this product