How can i implement "my own" security in ADF 11g

Hi everybody,
I have a problem and hope anyone could help me...
Currently i am developing a ADF application, and i want to implement the security... the problem i have (and i read a lot of posts in the forum and other blogs and i don't found anything that help me) is that the "validation" of the user of password is with a webservice..... and the "roles" of the application are given to me with another web service.
I read a lot and in the Fusion's Developer Guide in chapter 30 (Enabling ADF Security in a Fusion Web Application) explains very good how to implement the security in the application, but, that example really doesn't work for my problem.
I wan't to know any way to in the "doLogin" action of my "Login button in my login page" to implement my own logic.
public String doLogin() {
2 String un = _username;
3 byte[] pw = _password.getBytes();
4 FacesContext ctx = FacesContext.getCurrentInstance();
5 HttpServletRequest request =
6 (HttpServletRequest)ctx.getExternalContext().getRequest();
7 CallbackHandler handler = new SimpleCallbackHandler(un, pw);
8 try {
9 Subject mySubject = Authentication.login(handler); <<----------------------------- Here i wan't to invoke the WS that validate the user and pwd.
10 ServletAuthentication.runAs(mySubject, request);
11 String loginUrl = "/adfAuthentication?success_url=/faces" +
12 ctx.getViewRoot().getViewId();
13 HttpServletResponse response =
14 (HttpServletResponse)ctx.getExternalContext().getResponse();
15 sendForward(request, response, loginUrl);
16 } catch (FailedLoginException fle) {
17 FacesMessage msg = new FacesMessage(FacesMessage.SEVERITY_ERROR,
18 "Incorrect Username or Password",
19 "An incorrect Username or Password" +
20 " was specified");
21 ctx.addMessage(null, msg);
22 } catch (LoginException le) {
23 reportUnexpectedLoginError("LoginException", le);
24 }
25 return null;
26 }
And i wan't to know if i can save some other user information in some kind of session (like company, mail and other stuff).....
And when i can login validating usr and pwd from the WS... how could i manage my roles ?
Welll i hope anyone can help me.
Regards from Mexico.

Hi,
to do this, you create a JAAS Login Module to authenticate against the Web Service. This then you wrap in an authentication provider that you configure with WLS. ADF Security does not perform any authentication itself and instead leaves it for the container.
http://download.oracle.com/docs/cd/E17904_01/web.1111/e13718/atn.htm#i1154044
Frank

Similar Messages

  • [ExtermlyUrgent]How can we implement our own caching scheme in servlets???

    Hi all,
    anyone, give me any idea about implementing our own cahing sechme in servelts. Please guide me with your knowledge i also need a running sample source code to understand this concept. It is extrememly urgent please help me .
    Regards.

    try to use
    http://cvs.apache.org/viewcvs/jakarta-commons-sandbox/cache/
    or
    http://jakarta.apache.org/turbine/jcs/
    if u are looking for a simple caching.. do it programatically.
    regards,
    Arun
    http://www.javageekz.com/

  • How can I implement Authentication in LDAP

    How can I implement Authentication in LDAP.

    Hi,
    If ur using JAAS, then use NTLoginModule in ur conf file and your own defined CallbackHandler for validating and obtaining the Subject (user connected to your domain).
    Remember the user is the one which the code obtains when u login to your Domain based machine.
    Apart from this, Apache Http Server also provides you with a popup window asking for the user's credentials when u set the SSPIDomain in the httpd.conf file.
    httpd.conf
    ========
    <Location /Seet/servlet/ >
    SSPIAuth On
    AllowOverride None
    Order allow,deny
    Allow from all
    AuthName "seet190 auth"
    AuthType SSPI
    SSPIAuth On
    SSPIAuthoritative On
    require valid-user
    SSPIDomain seet190
    </Location>
    seet190 is the domain name
    Actually so far in the Security Forum, u might refer to some of the replies posted for more help but actual LDAP authentication can be done by passing the user's info too.
    HTH,
    Seetesh

  • How can i implement 'Distribute Qty' function in BAPI_GOODSMVT_CREATE

    Hi all,
    Using MIGO For GR. if more than one Batch or Production Date or Vendor Batch for same Purchase Order Line Item and Deliv date, need to hit ‘Distribute Qty’ button to split the entry line into multiple lines before enter Production Date and Vendor Batch.
    So I want use bapi BAPI_GOODSMVT_CREATE  implement MIGO function for a interface. Anyone have some suggestion how can i implement the 'Distribute Qty' function in the bapi.
    My email address: [email protected]

    Hello,
    1. Use structure BAPIPAREX for passing custom fields. (There are several blogs/posts on how to make use of this).
    2. In the BAPI i noticed there is a BAdI to populate these fields into your business tables.
    Call BAdI MB_BAPI_GOODSMVT_CREATE to fill own fields
        TRY.
            get badi lo_mb_bapi_GOODSMVT_CREATE.
          CATCH cx_badi_not_implemented.                    "#EC NO_HANDLER
        ENDTRY.
        TRY.
            call badi lo_mb_bapi_goodsmvt_create->extensionin_to_matdoc
              EXPORTING
                EXTENSION_IN = EXTENSIONIN[]
              CHANGING
                CS_IMKPF     = S_IMKPF
                CT_IMSEG     = T_IMSEG[]
                CT_RETURN    = return.
          CATCH cx_badi_initial_reference.                  "#EC NO_HANDLER
        ENDTRY.

  • How can I implement the connection pool in my java stored procedure

    my java stored procedures (in database 'B') have to connect to another oracle database ,let's say 'A'. And how can I implement the behavior like the so-called connection pool in my java stored procedure in 'B', as below.
    1. database B, has 2 java stored procedures sp1 and sp2
    2. both sp1 and sp2 connects to databse 'A'
    whatever I call the sp1 and sp2 and the database 'A' always only one connected session from sp1 and sp2 in database 'B'.
    THANKS A LOTS...

    my problem is I have a lots of java stored procedures need to cnnect to the remote oracle db, and I hope the remote db can only have a connected session from my java stored procedures in my local db. I try as below
    class sp{
    static Connection conn=null; //the remote db connection,
    public static void sp1(){...}//procedure 1, using conn
    public static void sp2(){...}//procedure 2, using conn,too
    I can 'see' the 'conn' variable if I invoke the sp1() and sp2() from the same client application(maybe sqlplus). But if I invoke the sp1() from client 'A' and invoke sp2() from client 'B' then the sp1() and sp2() can not see the 'conn' variable for each other. I think it's because the two clients cause oracle to create two instances of the class 'sp' and the sp1() and sp2() located in different instance seperately. Thus the sp1() and sp2() can not see 'conn' for each other. They can only see its own 'conn'.
    To connect to the remote db from the java stored procedure is easy but is it possible to connect to the remote db via database link from the java stored procedure at my local db ? If so, then I also archive my goal .
    BTW , thanks a lots...
    andrew :-)

  • How can I implement this database?

    Okay, so if you are working with a company who owns more than 10 apartment complexes and they have asked you to build a database.
    So if I want to implement this database.
    What database software package should I use (SQL Enterprise or SQL Data Center) (do not know the difference between the two) or is there any other SQL version that can be used/considered
    Also what else would I have to build or buy? What combination of things do I need?
    What hardware is needed at each apartment complex?
    I was told that something off the shelf will not give me everything I need.

    Please do not duplicate posts. You already posted it here
    https://social.msdn.microsoft.com/Forums/sqlserver/en-US/5dfc3897-3ffb-490b-8e60-e775b43d3303/how-can-i-implement-this-database?forum=sqlgetstarted
    Andy Tauber
    Data Architect
    The Vancouver Clinic
    Website | LinkedIn
    This posting is provided "AS IS" with no warranties, and confers no rights. Please remember to click
    "Mark as Answer" and
    "Vote as Helpful" on posts that help you. This can be beneficial to other community members reading the thread.

  • How can we implement SSO in SP2013

    Hi,
    How can we implement SSO from other applications to SP2013 web app.
    Please suggest with an example.
    Thanks,
    Krishna
    Krishnasandeep

    Basically  it is used to store credentials in a safe way. My article at
    http://sharepointdragons.com/2012/02/13/creating-a-bcs-net-assembly-connector/ discusses an example where it is leveraged within other SharePoint technology (BCS) but you can also use the object model to retrieve credentials and get login pages etc. for
    free provided by the Secure Store Service framework.
    Kind regards,
    Margriet Bruggeman
    Lois & Clark IT Services
    web site: http://www.loisandclark.eu
    blog: http://www.sharepointdragons.com

  • How can I implement GCM push notifications in AIR?

    How can I implement GCM push notifications in AIR? How can I implement GCM in Android using flex?

    You have 2 ways, first is buy the ane, are alot such as: http://myappsnippet.com/gcm/ or review the open in: https://github.com/freshplanet/ANE-Push-Notification or http://afterisk.wordpress.com/2012/09/22/the-only-free-and-fully-functional-android-gcm-na tive-extension-for-adobe-air/ , that for client side, for server side you can buy in http://urbanairship.com/ or enter in the world of build your own pisblisher server, in this case you need to read android and ios and blackberry notification, each one has different methods.
    Also, here you have more information: http://forums.adobe.com/message/4626292
    looks good.

  • HOW CAN I USE MY OWN EMAIL FOR IMESSAGE IF I DONT HAVE MY OWN ACCOUNT

    HOW CAN I USE MY OWN EMAIL FOR IMESSAGE IF I DONT HAVE MY OWN ACCOUNT

    You have to achieve at least 500 points before you are able to do that.
    Award points, level up, and earn new privileges

  • How can I change my original security questions? After changing my AppleID and password, I am not given an opportunity to change my security questions, which I cannot remember the answers to, so I cannot purchase any music.

    How can I change my original security questions? After changing my AppleID and password, I am not given an opportunity to change my security questions, which I cannot remember the answers to, so I cannot purchase any music.

    See my User Tip for some help: Some Solutions for Resetting Forgotten Security Questions: Apple Support Communities.
    Send Apple an email request for help at: Apple - Support - iTunes Store - Contact Us
    Call Apple Support in your country: Customer Service: Contacting Apple for support and service

  • How can i change a forgotten security question and answer in my apple id ?, how can i change a forgotten security question and answer in my apple id ?

    how can i change a forgotten security question and answer in my apple id ?, how can i change a forgotten security question and answer in my apple id ?

    SECURITY QUESTIONS
    Read this note for information on how to reset the security questions http://support.apple.com/kb/HT5312
    This user tip may also help you http://discussions.apple.com/docs/DOC-4551

  • How can I implement a comfirmation window when closing javafx application?

    hi,guys
    I'd like to add a confirmation window when user is closing my javafx application,if user click yes, I will close the application,if no ,I wouldn't close it ,how can I implement this function?
    primaryStage.setOnCloseRequest(new EventHandler<WindowEvent>(){
                   @Override
                   public void handle(WindowEvent arg0) {
                        try
                             //todo
                        catch(Exception ex)
                             System.out.print(ex.getMessage()+"\r\n");
            });

    Hi. Here is an example:
    import javafx.event.ActionEvent;
    import javafx.event.EventHandler;
    import javafx.geometry.Pos;
    import javafx.stage.*;
    import javafx.scene.*;
    import javafx.scene.paint.Color;
    import javafx.scene.layout.*;
    import javafx.scene.control.*;
    public class ModalDialog {
        public ModalDialog(final Stage stg) {
         final Stage stage = new Stage();          
            //Initialize the Stage with type of modal
            stage.initModality(Modality.APPLICATION_MODAL);
            //Set the owner of the Stage
            stage.initOwner(stg);
            Group group =  new Group();
            HBox hb = new HBox();
             hb.setSpacing(20);
            hb.setAlignment(Pos.CENTER);
            Label label = new Label("You are about to close \n your application: ");
            Button no  = new Button("No");
            no.setOnAction(new EventHandler<ActionEvent>() {
                public void handle(ActionEvent event) {
                       stage.hide();
            Button yes  = new Button("Yes");
            yes.setOnAction(new EventHandler<ActionEvent>() {
                public void handle(ActionEvent event) {
                       stg.close();
             hb.getChildren().addAll(yes, no);
             VBox vb =  new VBox();
             vb.setSpacing(20);
             vb.setAlignment(Pos.CENTER);
             vb.getChildren().addAll(label,hb);
            stage.setTitle("Closing ...");
            stage.setScene(new Scene( vb, 260, 110, Color.LIGHTCYAN));       
            stage.show();
    }Test:
       import javafx.application.Application;
    import javafx.event.ActionEvent;
    import javafx.event.EventHandler;
    import javafx.scene.Group;
    import javafx.scene.Scene;
    import javafx.scene.control.Button;
    import javafx.scene.paint.Color;
    import javafx.stage.Stage;
    import javafx.stage.*;
    * @author Shakir
    public class ModalTest extends Application {
         * @param args the command line arguments
        public static void main(String[] args) {
            Application.launch(ModalTest.class, args);
        @Override
        public void start(final Stage primaryStage) {
            primaryStage.setTitle("Hello World");
            Group root = new Group();
            Scene scene = new Scene(root, 300, 250, Color.LIGHTGREEN);
           primaryStage.setOnCloseRequest(new EventHandler<WindowEvent>(){
                   @Override
                   public void handle(WindowEvent arg0) {
                                    arg0.consume();
                        try
                         ModalDialog md = new ModalDialog(primaryStage);
                        catch(Exception ex)
                             System.out.print(ex.getMessage()+"\r\n");
            primaryStage.setScene(scene);
            primaryStage.show();
    }

  • How can I implement a real time datawarehouse

    Hi, I'm a little lost here but I want to know how can I implement a real time datawarehouse in sql server, I don't know if it is only to make the extraction process the shortest time possible.
    Thank you

    Hi Mega15, 
    I agree with everything Seif and Louw said, but I'd like to add that if you are using SQL Server 2012 or 2014 and you want to use DirectQuery or ROLAP mode (depending on what SSAS mode are you using, tabular or multidimensional) you may be interested on
    using columnar indexes on your base tables. 
    Analytical and aggregated queries will take GREAT advantage from these indexes, they will perform much better than with traditional B-Tree indexes in most of your scenarios. 
    Regards. 
    Pau.

  • How can I implement a Digital I/O counter with a maximum source frequency of 80 MHz (like 6602 board) using CompactRIO?

    How can I implement a Digital I/O counter with a maximum source frequency of 80 MHz (like 6602 board) using CompactRIO? It appears as if the Digital I/O modules for CompactRIO are much slower than this.
    Thank you,
    --Ray

    Hi Ray,
    The highest frequency input we offer for C Series modules is 20 MHz if you are doing LVTTL and 10 MHz for 5 V TTL.  These modules are the 9402 and 9401, respectively.  Unfortunately, there is no 80 MHz input on this form-factor.
    Regards,
    Chris E.
    Applications Engineer
    National Instruments
    http://www.ni.com/support

  • How Can I create the new security answers?

    How Can I create the new security answers?

    Read this about how to change the security questions: http://support.apple.com/kb/HT5312
    If you can't use these procedures contact Apple. See http://support.apple.com/kb/HT5699

Maybe you are looking for