Using DBMS_LDAP in Apex

Hi there
I have the following problem. I have a simple function which uses DBMS_LDAP package. For testing purposes, when I call the function from sql*plus or sqldeveloper, it works fine and I can authenticate the user in AD. However, when using the same function call in Apex, the screen 'freezes' for about a minute and returns 'IE cannot display page' message. It looks like getting time out. Is this a network/firewall issue? Is Apex using some kind of proxy and cannot establiss LDAP session? Your help is really appresiated much.
thanks, Ed

Joel
thank you for clarification. Really appreciate your help. I was able to get the list. Here is the procedure. The line that fails is highlighed. Basically it can't initialize the session on AD server...
declare
     p_username          varchar2(25):='test';
     p_password          varchar2(25):='test';
     l_user               varchar2(256);
     l_ldap_server     varchar2(256)     := 'AD host';
     l_domain          varchar2(256)     := 'domain';
     l_ldap_port          number               := 389;
     l_retval          pls_integer;
     l_session          dbms_ldap.session;
     l_cnt               number;
begin
--     l_retval := dbms_ldap.unbind_s( l_session );
     l_user               := p_username||'@'||l_domain;
*     l_session          := dbms_ldap.init( l_ldap_server, l_ldap_port ); -- start session*     
l_retval          := dbms_ldap.simple_bind_s( l_session, l_user, p_password ); -- auth as user
     l_retval          := dbms_ldap.unbind_s( l_session ); -- unbind
     dbms_output.put_line( 'yes');
exception when others then
dbms_output.put_line( 'no');
raise_application_error(-20101, 'invalid user');
     end;
thanks, Ed

Similar Messages

  • Please help with assigning user to a group in AD using dbms_ldap

    Dear gurus of Apex and LDAP!
    Please help me a bit.
    I managed to create any user in AD from Apex using dbms_ldap package and set many of his attributes. But I cannot set that my user belongs to specific group, let's say MY_GROUP. I guess the name of attribute for group is 'member' or 'memberOf', so I tried them both in the same way as I've done for other attributes:
    v_vals(1) := 'MY_GROUP';
    DBMS_LDAP.populate_mod_array(v_array, DBMS_LDAP.MOD_ADD, 'member', v_vals);
    I've got LDAP client/server error: CONSTRAINT violation. 000020B5: AtrErr: DSID-031516FC, #1: 0: 000020B5:
    DSID-031516FC, problem 1005 (CONSTRAINT_ATT_TYPE), DATA 0, Att 1f (MEMBER)
    v_vals(1) := 'MY_GROUP';
    DBMS_LDAP.populate_mod_array(v_array, DBMS_LDAP.MOD_ADD, 'memberOf', v_vals);
    I've got LDAP client/server error: DSA IS unwilling TO perform. 0000209A: SvcErr: DSID-031A0929, problem 5003 (WILL_NOT_PERFORM), DATA 0
    After that I've tried to extend group name to string, which is shown in LDAP browser for attribute 'memberOf' (when I've added it manualy):
    v_vals(1) := 'CN=MY_GROUP,OU=GROUPS,OU=Allianz,DC=allianz,DC=com';
    DBMS_LDAP.populate_mod_array(v_array, DBMS_LDAP.MOD_ADD, 'member', v_vals);
    I've got LDAP client/server error: OBJECT CLASS violation. 0000207D: UpdErr: DSID-03150913, problem 6002 (OBJ_CLASS_VIOLATION), DATA 0
    v_vals(1) := 'CN=MY_GROUP,OU=GROUPS,OU=Allianz,DC=allianz,DC=com';
    DBMS_LDAP.populate_mod_array(v_array, DBMS_LDAP.MOD_ADD, 'memberOf', v_vals);
    LDAP client/server error: DSA IS unwilling TO perform. 0000209A: SvcErr: DSID-031A0929, problem 5003 (WILL_NOT_PERFORM), DATA 0
    I've also tried some other variants (without 'CN=' and without 'OU=GROUPS,OU=Allianz'), but still no success.
    Search of this forum and even google didn't help either :(
    Please, help me to find the correct syntax for it or tell me if it's not possible.
    Thanx in advance,
    Vladimir

    Vladimir ,
    firstly the attributes member and memberOf are special attributes in AD having a set of predefined values. Hence an error will be thrown if you try to assign them values like 'MY_GROUP'. There are two basic solutions to this problem : Either you define an OU in your AD which will act as your 'MY_GROUP'. This is a quick fix solution and is not robust at all. The other solution is to add your own property in the tree , something like 'roleCode', you can then assign it any value you want.
    But the problem now is, AD does not allow addition of new attributes in the structure. You have to use ADAM in for this and you can specify a common linking mechanism between AD and ADAM now such as email address can act as the link between both the directories.
    Hope this helps
    Shantanu

  • Using DBMS_LDAP to retrieve the DN based on a UID

    Hello there,
    I have a users ID (UID) and I want to determine the DN using dbms_ldap.
    is this possible ?
    currently I am using
    l_retval := DBMS_LDAP.search_s(ld => l_session,
    base => ldap_base,
    scope => DBMS_LDAP.SCOPE_SUBTREE,
    filter => 'uid=gerard.rogers',
    attrs => '*',
    attronly => 0,
    res => l_message);
    however this only returns folloiwing attributes
    orclobjectguid
    orclsamaccountname
    krbprincipalname
    sn
    displayname
    mail
    uid
    cn
    objectclass
    orclobjectsid
    orcluserprincipalname
    I was expecting the DN to be returned.
    any ideas ?
    thanks for your help.
    Darragh.

    thank you, that worked a treat..
    I dont understand though why it is different to get the RDN from active directory.
    the pricinciple is the same but the atrribute values differ.
    thanks again solves my issue for the moment.
    Darragh

  • Using arrays in apex

    hi i want to know if some can guide me how to use array in apex.
    i have a tabuler report with 4 columns.
    i need to write a validation in the tabuler report for that i need to used array.
    can I directly access the colums as i have shown below? or do i need to decleare this arrays some were in apex?
    e.g
    FOR i IN 1 .. ow_app.g_f01.COUNT
    loop.........................
    LOGIC
    end loop;
    from what i understand i can access each column as ow_app.g_f01,ow_app.g_f02,ow_app.g_f03,ow_app.g_f04 does this make sense?
    thanks a lot.

    Hi user591315 (please tell us your name - we're a friendly group!),
    In answer to this and your previous related post, there is an excellent example of what you're looking to accomplish provided by Denes Kubicek available at http://apex.oracle.com/pls/otn/f?p=31517:41
    Hope this helps,
    John
    If you find this information useful, please remember to mark the post "helpful" or "correct" so that others may benefit as well.

  • Using JQuery with Apex

    Hello, I have a question for those of you who are using JQuery with Apex:
    This is my HTML header:
    <script type="text/javascript" src="&WORKSPACE_IMAGES.jsapi.js"></script>
    <script type="text/javascript">
    google.load("jquery", "1.3.2");
    </script>
    The problem is that JQuery still loads from Google and since the Company Intranet has the cookies blocked the privacy icon appars in IE. I am sure somebody will one day notice this and it's gonna be a "big" problem.
    I suspect that something must be changed below to make the privacy icon dissapear,
    if (!window['google']) {
    window['google'] = {};
    if (!window['google']['loader']) {
    window['google']['loader'] = {};
    google.loader.ServiceBase = 'http://www.google.com/uds';
    google.loader.GoogleApisBase = 'http://ajax.googleapis.com/ajax';
    google.loader.ApiKey = 'notsupplied';
    google.loader.KeyVerified = true;
    google.loader.LoadFailure = false;
    google.loader.Secure = false;
    google.loader.GoogleLocale = 'www.google.com';
    Any ideas how to change this code and if this is going to work?
    George

    Hi,
    If you do not like use jQuery from Google, discard your code
    <script type="text/javascript" src="&WORKSPACE_IMAGES.jsapi.js"></script>
    <script type="text/javascript">
    google.load("jquery", "1.3.2");
    </script>and use e.g. this guide to integrate jQuery to your Apex apps
    http://www.oracleapplicationexpress.com/tutorials/66-integrating-jquery-into-apex
    Br,Jari

  • Can and How to Use JQuary In APex 3.2

    Hi,
    Can we use JQuary in Apex 3.2 .If please send me any link or demo application with code.
    I am New With JQUARY .i don't have any idea about JQuary .
    How to use it in Apex 3.2.
    I am working on Apex 3.2
    Thanks

    Hi,
    JQuery sample is in htmldbQuery_sample.zip.
    File apex_developer_tool_bar.user.js is Greasemonkey script.
    Go to Greasemonkey site and check document how import user scripts.
    http://userscripts.org/about/installing
    Read about htmltooltip.js from
    http://dbswh.webhop.net/apex/f?p=BLOG:READ:0::::ARTICLE:3000
    Read about other files
    http://dbswh.webhop.net/apex/f?p=BLOG:READCAT:0::::CATEGORY:11100346066619
    Regards,
    Jari
    Edited by: jarola on Dec 7, 2010 9:40 AM

  • Can i use css3 in apex 4.

    I am new to apex .. I myself dont know css well .. But trying to know..
    Can I use css3 in apex 4...database 11g xe

    941005 wrote:
    I am new to apex ..Welcome to the forum: please read the FAQ and forum sticky threads (if you haven't done so already), and ensure you have updated with your profile with a real handle instead of "941005".
    You'll get a faster, more effective response to your questions by including as much relevant information as possible upfront. This should include:
    <li>APEX version
    <li>DB version and edition
    <li>Web server architecture (EPG, OHS or APEX listener)
    <li>Browser(s) used
    <li>Theme
    <li>Templates
    <li>Region type
    I myself dont know css well .. But trying to know..
    Can I use css3 in apex 4...database 11g xeIn APEX all presentational aspects of an application (including font size) are controlled using a combination of (X)HTML and CSS via themes and templates. You need to have an understanding of these web technologies to make best use of APEX. If you're not familiar with them you're advised to get at least a basic understanding by spending some time on the tutorials here: start with HTML, then XHTML, CSS, Javascript and the HTML DOM.
    CSS3 features can certainly be used in your APEX themes and applications. Any problems are not likely to arise there, but in whether these features are supported by the browsers/versions used when running them. These sites may be useful in determining whether it's worthwhile for you to use CSS3 to implement a particular feature:
    http://www.impressivewebs.com/css3-browser-support/
    http://caniuse.com/
    Using progressive enhancement techniques will allow you to introduce CSS3 features for browsers that do support them while still making applications accessible in those that don't.

  • Publish a plsql code as webservice without using JDEVELOPER or APEX

    Hi All,
    I am looking into how can we publish a PLSQL code as web-service without using JDEV OR APEX.
    When I google for this one I can see only by using JDEV or APEX we can publish Code as a web-service.
    Is there any way in oracle, just by using simple PLSQL packages we can publish code as a webservice.
    Appreciate your response.
    Thanks,
    MK.

    Apex does not publish PL/SQL code as web services. It is a web run-time and development framework. Something totally different.
    To turn a PL/SQL function into a web service is simple. You use the orawsv servlet in XDB - without making a single code change to the function. It will not even know it is called as a web service.
    To use orawsv, two basic steps. Configure and enable the servlet (raw HTTP/HTTPS connections will be handled by the Listener). This also entails enabling shared server in the database, if not already enabled. The 2nd step is to allow the function to be executed (via a HTTP call) as a web service, via granting specific roles.
    orawsv handles the HTTP call. It provides the WSDL. It parses SOAP envelopes as input. It makes the call (as a standard PL/SQL call), to the function being used as a web service. It returns the results of the PL/SQL function call, as a SOAP envelope output.
    See Support Notes:
    How to Setup Native Oracle XML DB Web Services [Article ID 444191.1]
    Sample Framework for testing Native Oracle XML DB Web Services [Article ID 803794.1]
    How to Browse Native Oracle XML DB Web Services Example [Article ID 1324235.1]

  • Using wwv_flow_load_excel_data and apex collections

    Hi!
    I have a question regarding very popular subject: parsing csv files.
    I made one application, which takes csv file, parses it using Vicas's code, presents validation report to the user, and finally allows to submit data into the datatable.
    Everything works fine, but I don't like this solution. CSV can cause problems when quotation mark is used inside, when numbers have 1000 separators and so on.
    Besides that, I have to add some code to validate column types. Lot of mess.
    The solution incorporated into apex tool, called "Data Load/Unload" looks much better. It would be nice to use that inside apex application adding some business validations, and hardcoding table and columns names.
    I have seen wwv_flow_load_excel_data package and I'm wondering if it is possible to use load_excel_data procedure to perform that task?
    Is there any documentation to that package?
    Somebody heard about using that with apex collections (to avoid a need of temporary table)?
    Regards,
    Arek

    And if somebody else is looking for "ApEx" forum:
    Oracle Application Express (APEX)

  • Can I use PERL in APEX

    Hi All
    can i use PERL language in APEX? is it gud practice to use PERL in APEX?
    Thanxs

    You can use PERL, in so much that you can forward on the user to a PERL application and have that PERL application take in the session + cookie and check it for validity in Oracle, but as far as interactivity between PERL and APEX, it would be either on the level of Web Services style access (one calling the other through web services type Http calls) or possibly running PERL code at system level with something like dbms_scheduler, were it to be for a background database task of some sort.
    My question would be what exactly do you need to do in PERL w/ APEX?
    -Richard

  • Using javascript in apex

    I am using javascript in apex, specifically the funtion popupURL. It is doing exactly what I want it to do except I don't want a new window, I want to stay in the same window.
    What is the javascript function that will do the same as popupURL - except it stays in the current window?
    Thanks!
    Stan Collins

    I think sb92075 was suggesting that you might have better luck finding someone with the answer Oracle Application Express (APEX)

  • When we can use FSP_AFTER_LOGIN_URL in apex

    Hi guy, How can we use FSP_AFTER_LOGIN_URL in apex for security purposes.
    Thanks
    sunny
    Edited by: 886894 on Sep 22, 2011 7:57 AM

    Sergio - You're right, that doesn't work but why bother protecting that item? It's sort of an indirect link and the real protection you need is on the other items that might be set in the link. So I would just keep that item Unrestricted and move on.
    Scott

  • Use of the Apex API in pl/sql procedures.

    Hi,
    I have a page with a form region with fields working as filter for an interactive report. This report is conditionally showed when the user clicks on the filter button. It was working with the field :REQUEST, but in this way IR functions like download, filter, format... doesn't work, I've seen that it's a bug. A workaround is using a field instead :REQUEST to conditionally show the IR region. I want to create and manage this field with a proccess, here is the code.
    DECLARE
      L_INPUT BOOLEAN;
      L_VAL   VARCHAR2(32);
      L_NAME  VARCHAR2(32);
    BEGIN
      IF :REQUEST = 'FILTER' THEN
        L_VAL := 'FILTER';
      ELSE
        L_VAL := '';
      END IF;
      L_NAME  := :APP_PAGE_ID || '_PROCESS';
      L_INPUT := APEX_CUSTOM_AUTH.APPLICATION_PAGE_ITEM_EXISTS(L_NAME);
      IF L_VAL = 'FILTER' THEN
        IF L_INPUT THEN
          APEX_UTIL.SET_SESSION_STATE(L_NAME, L_VAL);
        ELSE
          APEX_ITEM.HIDDEN(1, L_VAL, 'readonly', L_NAME);
        END IF;   
      ELSE
        IF L_INPUT THEN
          APEX_UTIL.SET_SESSION_STATE(L_NAME, L_VAL);
        ELSE
          APEX_ITEM.HIDDEN(1, L_VAL, 'readonly', L_NAME);
        END IF;
      END IF;
    END;But this code produces the following error:
    ORA-06550: line 20, column 7: PLS-00221: 'HIDDEN' is not a procedure or is undefined ORA-06550: line 20, column 7: PL/SQL: Statement ignored ORA-06550: line 26, column 7: PLS-00221: 'HIDDEN' is not a procedure or is undefined ORA-06550: line 26, column 7: PL/SQL: Statement ignored
    I'm using Apex 4.1.2. What it's wrong? I can't use APEX_ITEM package in this way?
    Regards,

    RideTheStorm wrote:
    Hi,
    I have a page with a form region with fields working as filter for an interactive report. This report is conditionally showed when the user clicks on the filter button. It was working with the field :REQUEST, but in this way IR functions like download, filter, format... doesn't work, I've seen that it's a bug. A workaround is using a field instead :REQUEST to conditionally show the IR region. I want to create and manage this field with a proccess, here is the code.What field?? if you want to set a page item as conditional then edit the item and set a condition.
    DECLARE
    L_INPUT BOOLEAN;
    L_VAL   VARCHAR2(32);
    L_NAME  VARCHAR2(32);
    BEGIN
    IF :REQUEST = 'FILTER' THEN
    L_VAL := 'FILTER';
    ELSE
    L_VAL := '';
    END IF;
    L_NAME  := :APP_PAGE_ID || '_PROCESS';
    L_INPUT := APEX_CUSTOM_AUTH.APPLICATION_PAGE_ITEM_EXISTS(L_NAME);
    IF L_VAL = 'FILTER' THEN
    IF L_INPUT THEN
    APEX_UTIL.SET_SESSION_STATE(L_NAME, L_VAL);
    ELSE
    APEX_ITEM.HIDDEN(1, L_VAL, 'readonly', L_NAME);
    END IF;   
    ELSE
    IF L_INPUT THEN
    APEX_UTIL.SET_SESSION_STATE(L_NAME, L_VAL);
    ELSE
    APEX_ITEM.HIDDEN(1, L_VAL, 'readonly', L_NAME);
    END IF;
    END IF;
    END;But this code produces the following error:
    ORA-06550: line 20, column 7: PLS-00221: 'HIDDEN' is not a procedure or is undefined ORA-06550: line 20, column 7: PL/SQL: Statement ignored ORA-06550: line 26, column 7: PLS-00221: 'HIDDEN' is not a procedure or is undefined ORA-06550: line 26, column 7: PL/SQL: Statement ignored
    I'm using Apex 4.1.2. What it's wrong? I can't use APEX_ITEM package in this way?
    Regards,
    What are you trying to do?? I guess you have to use APEX_IR http://docs.oracle.com/cd/E37097_01/doc/doc.42/e35127/apex_ir.htm
    APEX_ITEM.HIDDEN is not a procedure and is a function that returns HTML for hidden item.

  • Values having html tags not getting populated while using AJAX in APEX

    Hi,
    I am using AJAX to populate certain values in a tabular report.
    I have a java script of this form (I have taken this example from Denes's example http://apex.oracle.com/pls/otn/f?p=31517:241:1400877312570049)
    <script language="JavaScript" type="text/javascript">
    function f_set_multi_items_tabular(pValue, pRow){
    var get = new htmldb_Get(null,html_GetElement('pFlowId').value,
    'APPLICATION_PROCESS=Set_Multi_Items_Tabular',0);
    if(pValue){
    get.add('TEMPORARY_APPLICATION_ITEM',pValue)
    get.add('T_ROWNUM',pRow)
    }else{
    get.add('TEMPORARY_APPLICATION_ITEM','null')
    gReturn = get.get('XML');
    if(gReturn){
    var l_Count = gReturn.getElementsByTagName("item").length;
    for(var i = 0;i<l_Count;i++){
    var l_Opt_Xml = gReturn.getElementsByTagName("item");
    var l_ID = l_Opt_Xml.getAttribute('id');
    var l_El = html_GetElement(l_ID);
    if(l_Opt_Xml.firstChild){
    var l_Value = l_Opt_Xml.firstChild.nodeValue;
    }else{
    var l_Value = '';
    if(l_El){
    if(l_El.tagName == 'INPUT'){
    l_El.value = l_Value;
    }else if(l_El.tagName == 'SPAN' && l_El.className == 'grabber'){
    l_El.parentNode.innerHTML = l_Value;
    l_El.parentNode.id = l_ID;
    }else{
    l_El.innerHTML = l_Value;
    get = null;
    </script>
    And I have the application process as follows
    BEGIN
    OWA_UTIL.mime_header ('text/xml', FALSE);
    HTP.p ('Cache-Control: no-cache');
    HTP.p ('Pragma: no-cache');
    OWA_UTIL.http_header_close;
    HTP.prn ('<body>');
    HTP.prn ('<desc>this xml genericly sets multiple items</desc>');
    HTP.prn ('<item id="f05_000' || :T_ROWNUM || '">' || :TEMPORARY_APPLICATION_ITEM || '</item>');
    HTP.prn ('</body>');
    END;
    If I have :TEMPORARY_APPLICATION_ITEM as 'Vikas' it gets displayed properly but if I have '&lt;b&gt;Vikas&lt;b&gt;' it shows null. if it has any HTML tags function l_Opt_Xml.firstChild.nodeValue is not working properly .Please tell me what modiifcation can I use in function l_Opt_Xml.firstChild.nodeValue to get Values with HTML tags also to get displayed.
    Thanks,
    Vikas

    Vikas,
    Try escaping special characters: htf.escape_sc(:TEMPORARY_APPLICATION_ITEM)Regards,
    Dan

  • Is theme.css Use Different in ApEx 3.1.2 from HTML-DB 1.6

    Great! What happened to the text I just spent the last 45 minutes composing??????????????
    Edited by: Canis Polaris on Apr 9, 2009 2:18 PM

    >
    EarlL,
    Thank you very much for your thoughtful and timely replies.
    "Virtually the same" simply means that the only changes that may have taken place between the time I exported from 1.6 / imported into 3.1.2 and now wouldn't have any impact on this situation. They're changes such as a temporary change on the 1.6 version to a temporary reports server while we rebuild the current reports server. I haven't made any changes to the imported app yet.Except that you jumped about 8 releases between export and import. I would hope that theme 10 wasn't change significantly between then and now.
    I'll look into the web developer toolbar for Firefox. Thanks for that tip.
    I am using whatever css files were installed with the new Oracle DB and ApEx install/patchset/upgrade. I'm guessing that the "t10ContentBody" selector is still the one being referenced by the pages. I suppose the web developer toolbar would help me confirm this.So you edited the CSS file from the new installation to try to accomplish this change? I'm wondering if you might not have edited the wrong file.
    You can see what CSS selector is going to attempt to be used by looking at the class names in the HTML elements. In the CSS file they will be preceded with a dot, e.g. .t10ContentBody or whatever the case may be. While the developer toolbar allows you to zoom in to inspect the corresponding elements quickly you can also look at the HTML source to see what's going on under the hood.
    Earl

Maybe you are looking for