JDeveloper 12 c how to block created the user.

Hello, this is my first post. I have a question regarding my request - I use JDeveloper 12 c. In my application, I have implemented the user file, which has all the users who can connect to my request. For each user, I have an option called 'user locked '. I want to do that if the user is locked, it cannot log in to my application. Someone has an idea how I can do?

It is a code for my .java login:

public class LoginBean {}

private String _username;

private String _password;

public LoginBean() {}

LogEvents.addSyslog ("OPEN", "Connection...", null, null, null);

}

{} public void setUsername (String _username)

This ._username = _username;

}

public String getUsername() {}

return _username;

}

{} public void setPassword (String _password)

This ._password = _password;

}

public String getPassword() {}

return _password;

}

public String doLogin() {}

String _username =;

Byte [] pw = _password.getBytes ();

FacesContext ctx = FacesContext.getCurrentInstance ();

HttpServletRequest request = ctx.getExternalContext () .getRequest () (HttpServletRequest);

try {}

CallbackHandler Manager = new URLCallbackHandler (UN, pw);

MySubj subject = weblogic.security.services.Authentication.login (handler);

weblogic.servlet.security.ServletAuthentication.runAs (mySubj, request);

ServletAuthentication.generateNewSessionID (request);

String loginUrl = ' faces/welcome. '

LogEvents.addSyslog ("LOGIN. TRUE', 'Connected' - + this ._username, null, null, this ._username);

sendForward (loginUrl);

} catch (FailedLoginException fle) {}

ResourceBundle resourceBundle = BundleFactory.getBundle ("abc.view.ViewControllerBundle");

String msgTxt = null;

If (resourceBundle! = null) msgTxt = ("LOGIN resourceBundle.getString. NOT VALID");

If (msgTxt == null) msgTxt = "a bad user name or password was specified";

LogEvents.addSyslog ("LOGIN. (FALSE', 'Error while recording -' + this ._username, null, msgTxt, this ._username);

FacesMessage msg is new FacesMessage (FacesMessage.SEVERITY_ERROR, "Incorrect Username or Password", msgTxt);.

ctx.addMessage (null, msg);

setPassword (null);

} catch {} (the LoginException)

reportUnexpectedLoginError ("LoginException", the);

}

Returns a null value.

}

{} private void sendForward (String forwardUrl)

FacesContext ctx = FacesContext.getCurrentInstance ();

try {}

ctx.getExternalContext (.redirect (forwardUrl));

} catch (IOException ie) {}

reportUnexpectedLoginError ("IOException", IE);

}

ctx.responseComplete ();

}

' e private void reportUnexpectedLoginError (String errType, Exception) {}

ResourceBundle resourceBundle = BundleFactory.getBundle ("abc.view.ViewControllerBundle");

String msgTxt = null;

If (resourceBundle! = null) msgTxt = ("LOGIN resourceBundle.getString. OTHER') .concat ("(") .concat (errType) .concat ("") ");

If (msgTxt == null) msgTxt = "an unexpected error during the connection (".concat (errType).concat("), see the logs for details");

FacesMessage msg = new FacesMessage (FacesMessage.SEVERITY_ERROR, "Unexpected error during connection", msgTxt);

FacesContext.getCurrentInstance () .addMessage (null, msg);

FacesContext.getCurrentInstance () .renderResponse ();

}

}

Kind regards

WK

Hello

for that, you or the other

1 - write your own authentication provider in WLS that authenticates users, but also looks at the flag of "lock".

2 use the SQL authentication provider and modify the SQL query to include indicator

3 - in your code, check the user file before performing the authentication. At this point, you already have the user name. Just make sure that you don't tell people that their account is locked before you checked the authentication can be processed successfully. Otherwise - if you let them know right after comparing the lock check - your app can be used to exploit your underlying identity management system.

Frank

Tags: Java

Similar Questions

  • How to create the user account using the command?

    How to create the user account using the command?

    Open cmd as administrator, and then type the following commands one after the other

    NET user / add program mypassword
    net localgroup administrators program / add
    net share concfg * C:------/ grant: program, complete
    This will create a user account with the name "Program" and the password "MonMotpasse".

    You can create the user name and password of your choice.
  • How to block a standered user to remove & copy the file

    Hello Sir

    How to block a standard user to delete and copy the file to the disc.
    I just let it open & watch... (do not copy & delete any file)

    Thank you
    with warm
    Vikash

    It's very difficult to do on a stand-alone computer.  You can use folder/file permissions (NTFS) rights to deny the ability of the user to remove.  Prevent copying is a more serious problem.

  • How do I create the file zxp of the aip, generation after generation of the solution file.

    How do I create the file zxp file aip, generation after generation of the solution (program code)

    I build example file from CC (given with the sdk) 2015 Sdk for the creation of the aip file, so I want to create file zxp that generate PID file

    How do I do that please help me

    Thanks and greetings

    Kundan

    Yes, you must rebuild your plugin using the SDK CC headers. I thought that you had already done, but looking back through the thread you started saying the problem was with the DrawArt sample in the SDK of CC and then move to your plugin.

  • How to find the owner of the user or who created the user?

    Hi all

    I want to know owner of user or users who created?

    example:
    system created the test user.
    test has created the user xyz.

    So I want to know who created xyz?

    Thanks in advance,
    Sandeep.

    You can not find who created the user unless you enable the audit of the database or write a trigger (CREATE ddl event-based) that will track the session information of the user who executes a command from the user to CREATE.

  • What should I use to create the user interface of a CEAP plugin on mac

    Hey there,

    I'm new to the development of a plugin, but I did development of script for quite a long time however. I'm tring to develop an ECAP plugin. I go to the sample project of "Panelator" (from AE CC SDK), but I don't know how to create ui for the control panel plugin stuff.

    The sample project is not an example of code to do this on a mac computer, I found the code examle for windows however.

    So, can someone generously tell me how? I had to do with cocoa? But as I understand it, I can only use Objective-C to write cocoa ui.

    Thank you very much!!!

    Hi Li Zhiqing,

    We have just announced in the next major update to AE CC signs HTML5 is supported:

    http://blogs.Adobe.com/AfterEffects/2014/04/new-changed-after-effects-CC-2014.html

    This will allow to create the user interface using HTML5 and use your scripts for the conduct of AE.  It is quite a bit easier than the use of cocoa for the construction of the UI panel.  Thoughts?

  • How can I see the user on a target disk library?

    Migration Manager does not work to move a user to a new iMac. We can slide on the user a little at a time, but how do you make the user visible on the disk library I target disk mode? (The old laptop will start is no longer)

    Open your home folder on this drive, choose go to folder from the Finder menu and provide the library as the path.

    (137598)

  • I want to create the user in the direct areas but I found thi message: the requested account name is already in use.

    Over the period of re - use the account in the domains.live

    I want to create the user in the direct areas but I found thi message

    The requested account name is already in use or has been used in the past and has not been through the waiting period required of re - use.

    Can you help me

    Hi, Ahmed.

    It seems that the domain name you have selected is not available (or has already been used and it is found that the previous owner of the domain has used the same user name as an account).  In any case we can not help you here.  You need help from domain.live.

    Please go to http://help.live.com/help.aspx?project=domains&market=en-us&querytype=keyword&query=SNIAMODTUOBA&tmt=&domain=domains.live.com&format=b1 and down, click on support and follow the prompts to get help.  Although it is technically to the implementation of the field, I'm sure that your application will be either still answered or they will direct you to the proper location for assistance.

    In addition, you can try http://windowslivehelp.com/product.aspx?productid=25 for help Windows Live Administration.  If you can not find help with solutions validated or by performing a search, try posting in the forums.  I suggest the following for the problem that you specified: http://windowslivehelp.com/forums.aspx?forumid=7e6f04c0-6a48-4719-98f4-a9729d34c76e.

    I hope this helps.

    Good luck!

  • How can I remove the user name and the image of Windows XP new Start Menu

    Two questions:

    1. How can I delete the user name and the image of Windows XP new start; and

    2. my computer keeps asking me to press the F1 key to start Windows.  How to skip this part?

    Thank you.

    Hello

    The image of user account can be removed by disabling the Welcome screen. Or, by opting for the classic Windows theme. Follow the method described in this article, if you want to remove the user name and the picture in the Start Menu, without disabling the Welcome screen and Windows XP theme.

    For those who want to delete the user name and the image of user account from the Start Menu, in order to have a blue white Panel at the top, try this:

    Registry warning
    Important: This section, method, or task contains steps that tell you how to modify the registry. However, serious problems can occur if you modify the registry incorrectly. Therefore, make sure that you proceed with caution. For added protection, back up the registry before you edit it. Then you can restore the registry if a problem occurs. For more information about how to back up and restore the registry, click on the number below to view the article in the Microsoft Knowledge Base:

    How to back up and restore the registry in Windows
    http://support.Microsoft.com/kb/322756/

    Step 1:

    a. start Windows Explorer and go to this folder:
     
    C:\Documents and Settings\All Users\Application Data\Microsoft account images

    b. in this folder, rename the BMP file that corresponds to your user account.
     
    (For example, if your user name is Robert, rename Robert.bmp to old_Robert.bmp)

    c. then rename the following folder:

    C:\Documents and Settings\All Users\Application Data\Microsoft account Pictures\Default pictures
     
    to something else, for example,.
     
    C:\Documents and Settings\All Users\Application Data\Microsoft account Pictures\No_Default images.

    Step 2:
     
    To remove the user name, follow these steps

    a. Click Start, click "RUN" and type "regedit.exe" and navigate to this key:
     
    HKEY_CURRENT_USER-Software-Windows Microsoft\------CurrentVersion-policies-Explorer

    b. in the right pane, the value NoUserNameInStartMenu-value data 1.

    c. close Regedit.exe and restart Windows.

    You'll find yourself with a blue area at the top of the Start Menu.

    Regarding the pressing 'F1' to start Windows, you have made no changes or was there a system crash after which the problem started?

    You may need to change the boot sequence in the BIOS to the default settings. I recommend you contact your PC vendor for this.

    Warning of the BIOS:
    BIOS change / semiconductor (CMOS) to complementary metal oxide settings can cause serious problems that may prevent your computer from starting properly. Microsoft cannot guarantee that problems resulting from the configuration of the BIOS/CMOS settings can be solved. Changes to settings are at your own risk.

  • How can I change the user of "My Documents" by default? »

    I'm changing the user to 'My Documents' which has initially set up a laptop from the MFG.  while I can use it to another employee. I changed the name of the computer, but how do I change the user of "My Documents" by default? »

    Hi W30330,

    Please see the thread with a similar problem and fix possible:

    http://answers.Microsoft.com/en-us/Windows/Forum/Windows_7-system/deleting-old-user-accounts-and/08419300-ef7c-42e5-9027-f123128ebcf8

    I hope this helps!

  • T60 - Vista: How can I fix the user profile? Is there a book explaining the steps?

    T60 - Vista: How can I fix the user profile?

    On startup, I get the message "the user profile service has no logon. User profile cannot be loaded. »

    To the boot, safe mode, I get the message "your user profile was not loaded correctly. You have been logged on with the default profile. Check the event log or contact your administrator.

    Since I don't have an administrator:

    • How can I get to the event log?
    • How can I fix the user profile?
    • Maybe you can point me to a book that might guide me in the process.  I'd rather learn to have to repair it by someone else.

    Thank you for your response.

    Zuma Balou

    Go through this link

    http://support.Microsoft.com/kb/947215

  • When I go to a favorite websight how can I get the user id and the password to open the view without having to put in me? Barry was soon

    When I go to a favorite websight how can I get the user id and the password to open the view without having to put in me? Barry was soon

    Hi Barry,.

    Please contact Microsoft Community.

    It would be great if you can answer the following question:

    What browser you use on the computer?

    If you are using Internet explorer, I suggest you to follow these steps to turn on the AutoComplete feature and check if it helps:

    (a) open Internet Explorer.

    (b) click on the Tools button and then click on Internet Options.

    (c) click on the content tab.

    (d) under AutoComplete , click settings.

    (e) check the address bar, Forms, usernames and passwords on formsand ask me before saving passwords check boxes.

    (f) click OKand then click OK again.

    Let us know if this can help, and if you need further assistance.

  • How can I change the user backup POS?

    Hi guys,.

    Wondering if or how I can change the user to backup of POS on my POS device. Is it possible to change the user after the installation is complete?

    Or I need to reinstall POS to do properly?

    thx for the advice

    Flo

    You can change the user in https://ip-adress/vdp-configure under Configuration.

    'Klick to change the configuration of vCenter' enter the PW the POS and you can change the user name of vCenter.

    A reboot is required after the change, and an integrity check will be performed during the restart.

    If the change will take some time...

    Paul

  • Create the user by using the API OIM11g R2 with custom attributes

    Friends,

    I am trying to create a user using API in OIM 11 g 2 with a custom attribute.

    < String, Object > HashMap createUserMap = new HashMap < String, Object > ();
    createUserMap.put (UserManagerConstants.AttributeName.FIRSTNAME.getId (), "Test);
    createUserMap.put (UserManagerConstants.AttributeName.LASTNAME.getId (), "tester);
    createUserMap.put (UserManagerConstants.AttributeName.USER_LOGIN.getId (), "tester1");
    createUserMap.put (UserManagerConstants.AttributeName.USERTYPE.getId (), "End user");
    createUserMap.put (UserManagerConstants.AttributeName.EMPTYPE.getId (), "EMP");
    createUserMap.put (UserManagerConstants.AttributeName.PASSWORD.getId (), "Welcome1);
    createUserMap.put (UserManagerConstants.AttributeName.EMAIL.getId (), "[email protected]");
    createUserMap.put ("act_key", new Long("1"));
    createUserMap.put ("USR_UDF_DEPTNO", "10");

    Try
    {
    UserManager userService = oimClient.getService (UserManager.class);

    User user = new User (userLogin, createUserMap);
    Result = userService.create (user) UserManagerResult;
    System.out.println ("State of creation: '" + result.getStatus ());
    }
    catch (System.Exception e)
    {
    e.printStackTrace ();
    }

    But it fails with the error below.
    Create a user application cannot set or change the USR_UDF_DEPTNO attribute, since it is not defined in the corresponding dataset. : create user: USR_UDF_DEPTNO. *

    But this attribute exists in the IOM and I was able to create the user using the user interface with this custom attribute.

    Please let me know what I am doing wrong.

    You must pass a long time don't value not int. It should be that way.

    Long deptno = 1234;
    createUserMap.put ("deptno", deptno);

  • Assignment of roles to the user when creating the user

    Hi all

    I gave a roll deposited (< dsp:input bean = "ProfileFormHandler.value.roles.role" maxsize = "30" size = "30" type = "text" / > on the registration page.) After registration, each field in db except role (table dps_role).
    Pls let me know what I am doing wrong.

    Thank you

    You should not assign roles to the user as 'ProfileFormHandler.value.roles.role' of 's profile. You can link formhandler property to which you can pass the name or id of the role that you want to assign role assignment must always route through safety ATG API in order to properly update the mappings of Homeland Security. Because of these dependencies, you should not try the role of simply call profile.setPropertyValue ('roles',...) The code cannot fail this way, but if you assign the role in this way then it may not work as expected when checking for role based privileges. Here's one possible way to do it:

    1. in your file properties formhandler declare a dependency on the directory of the default user, which by default points to the profile database:

    userDirectory = / atg/userprofiling/ProfileUserDirectory

    So, in the form Manager, you declare corresponding setUserDirectory() and getUserDirectory().

    2 then in the formhandler, get the DirectoryPrincipal objects associated with the user profile and the role you want to assign and then assign the role to the user:

    import atg.userdirectory.UserDirectory;
    import atg.userdirectory.DirectoryPrincipal;
    import atg.userdirectory.User;
    import atg.userdirectory.Role;
    import atg.userdirectory.DirectoryModificationException;
    
    import java.util.Collection;
    import java.util.Iterator;
    
    ..
    ..
    
    private boolean assignRoleToUser(String roleName, String userId) {
    
      UserDirectory userDirectory = getUserDirectory();
      DirectoryPrincipal userPrincipal = userDirectory.findUserByPrimaryKey(userId);
      DirectoryPrincipal rolePrincipal = userDirectory.getRoleByPath(roleName);
    
      User user = (User)userPrincipal;
    
      Collection collection = userDirectory.getRoles();
    
      boolean status = false;
    
      Iterator iter = collection.iterator();
      while(iter.hasNext())
      {
        Object obj = iter.next();
        if(obj instanceof Role) {
          Role role = (Role)obj;
          if(roleName.equals( role.getName() ) && user!=null) {
            try {
              status = user.assignRole(role);    //will return true if the role was added otherwise false
            }
            catch (DirectoryModificationException e) {
           //handle exception
            }
            break;
          }
        }
      }
      return status;
    }
    

    In the code above 'roleName' parameter is the name of the role to be assigned to the profile with the id as "userId". If you want to do the role assignment when creating the user, then you can do the things above in postCreateUser() so that you can get the Principal associated with the profile. For more information about the interfaces and classes used here, you can refer to the documentation of the API of the ATG.

    http://docs.Oracle.com/CD/E26180_01/platform.94/APIDoc/ATG/userDirectory/package-summary.html

Maybe you are looking for