This discussion is archived
12 Replies Latest reply: Oct 24, 2013 1:19 AM by Hari_639 RSS

apex_util.prepare_url with translated applications

MiroMas Newbie
Currently Being Moderated

I have two questions about using apex_util.prepare_url with translated applications:

  1. Why is checksum in translated application different from checksum in original application?
  2. Is there any way to control which checksum apex_url.prepare_url function will calculate?

I have application in two languages English (en) and Slovene (sl). Link with English checksum would work if I set Application primary language to English and link with Slovene checksum would work if I set Application primary language to Slovene. Application language is derived from Application primary language.

The real problem for me is sometimes I get “English” version of checksum when apex_url.prepare_url is called from “Slovene” version of application.  As I mentioned before “English checksum” doesn’t work if Application primary language is set to Slovene.

I reproduced this behavior (with exception of issue described in previous paragraph) on http://apex.oracle.com/pls/apex/f?p=15120. The same app demonstrates another unanswered question/bug related to translated app: https://forums.oracle.com/message/11229437#11229437

Is this Oracle APEX Bug? Can someone provide any hint or workaround?

  • 1. Re: apex_util.prepare_url with translated applications
    Hari_639 Guru
    Currently Being Moderated

    Hi,

    1. Why is checksum in translated application different from checksum in original application?
    2. Is there any way to control which checksum apex_url.prepare_url function will calculate?

     

    Have you enabled SSP at page level or only to specific item? If it's for item, can you let me know which type you have applied for it? See APEX_UTIL

     

    When you translate application, each translated application will have it's own application number. So if you use any SSP type which uses application number, then checksum calculated for English version might not be same as that of Slovene.

     

    Also see APEX_UTIL

     

    Regards,

    Hari

  • 2. Re: apex_util.prepare_url with translated applications
    MiroMas Newbie
    Currently Being Moderated

    Have you enabled SSP at page level or only to specific item? If it's for item, can you let me know which type you have applied for it? See APEX_UTIL

     

    When you translate application, each translated application will have it's own application number. So if you use any SSP type which uses application number, then checksum calculated for English version might not be same as that of Slovene.

     

    Also see APEX_UTIL

     

    Regards,

    Hari

    Hari, thanks for quick response.

    I enabled SSP on application level so Page Access Protection for page 1 is "Arguments Must Have Checksum".  Session State Protection atribute is "Cheksum Required - Application Level" for page item in URL. Link with checksum is calculated as:

    'http://apex.oracle.com/pls/apex/'||apex_util.prepare_url('f?p='||V('APP_ID')||':1:::::P1_ITEM:'||V('P1_ITEM'),p_checksum_type => 1)

     

    I need PUBLIC_BOOKMARK (or 1) as p_checksum_type parameter value.  It' s seems that no mater which SSP level I choose, cheksum is always different for translated application. Checksum won't be calculated if you use translated application ID in URL.

    Which SSP type doesn't use app number? Using app alias doesn't help either.

  • 3. Re: apex_util.prepare_url with translated applications
    Hari_639 Guru
    Currently Being Moderated

    Hi,

     

    So if you use any SSP type which uses application number

     

    Sorry, it looks like APEX always considers application number while calculating check-sum. So you always get different check-sum value for different translated applications.

     

    Is your application PUBLIC or requires username and password to log-in? What value you have set for "Application Language Derived From"?

     

    Regards,

    Hari

  • 4. Re: apex_util.prepare_url with translated applications
    MiroMas Newbie
    Currently Being Moderated

    Yes, I always get different checksum. Application is not PUBLIC. It requires username and password to log-in.

    Application language is derived from Application primary language.

    My  real problem is sometimes I get “English” version of checksum when apex_url.prepare_url is called from “Slovene” version of application.  As I mentioned before “English checksum” doesn’t work if Application primary language is set to Slovene.

     

    I reproduced some of this behavior on http://apex.oracle.com/pls/apex/f?p=15120 You can clearly see that checksum is changed every time when language is changed. Application language is derived from Application item in the sample.

     

    Regards,

    Miro

  • 5. Re: apex_util.prepare_url with translated applications
    Hari_639 Guru
    Currently Being Moderated

    My  real problem is sometimes I get “English” version of checksum when apex_url.prepare_url is called from “Slovene” version of application.  As I mentioned before “English checksum” doesn’t work if Application primary language is set to Slovene.

    No, it's calculating check-sum correctly. I just checked your application. I copied URL with "en" version check-sum into another browser window and it works fine. So check-sum is calculating fine. However if you copy "Slovene" check-sum URL into another window, after login, default primary language will be "en". So it will throw error.

     

    I'm not getting any work around for this issue. Ideally APEX should always consider "Primary Language" application id for calculating check-sum. So I would say it's a BUG

     

    If your users always use same application language, then you can SAVE their language preference once they change it or you can ask them to chose their preferred language. (By default you can set preferred language as "Application Primary Language"). Now you can write some code in post-login section of authentication scheme to set language from user preferences. This way, you can reduce probability of getting SSP violated error.

     

    And finally, you can guide users to bookmark URLS only from their preferred language.

     

    To save & retrieve user preferences, see Managing Session State and User Preferences

     

    Regards,

    Hari

  • 6. Re: apex_util.prepare_url with translated applications
    MiroMas Newbie
    Currently Being Moderated

    Hari,

    check-sums in sample application on apex.oracle.com are calculating correctly. Unfortunately this is not true for my real production application. Language is always Slovene in production app and sometimes I get "English" version of check-sum. I couldn't reproduce this strange behavior on sample app. The real problem is I can't control which version of check-sum prepare_url calculates in production app.

     

    Regards,

    Miro

  • 7. Re: apex_util.prepare_url with translated applications
    Hari_639 Guru
    Currently Being Moderated

    Strange! Then I suggest you to contact Oracle Support.

     

    Regards,

    Hari

  • 8. Re: apex_util.prepare_url with translated applications
    Christian Neumueller Expert
    Currently Being Moderated

    Hi,

     

    the bookmarkable checksums (app- or user-level checksums) depend on a salt value that is stored in the application. If the salt is null, there is a fallback to the application alias. If you update the salt by clicking "Expire Bookmarks" on Application > Security Attributes and re-publish the application, the salt should be synchronized between the apps. The checksums should be the same, then.

     

    Regards,

    Christian

  • 9. Re: apex_util.prepare_url with translated applications
    MiroMas Newbie
    Currently Being Moderated

    Christian

    Thanks. It works.

     

    Regards

    Miro

  • 10. Re: apex_util.prepare_url with translated applications
    Hari_639 Guru
    Currently Being Moderated

    Hi Christian,

     

    Thank you for useful info.

     

    the bookmarkable checksums (app- or user-level checksums) depend on a salt value that is stored in the application.

    Does this mean, by default, there will be different salt value for each translated application? Is the salt value randomly generated by APEX?

    If the salt is null, there is a fallback to the application alias. If you update the salt by clicking "Expire Bookmarks" on Application > Security Attributes and re-publish the application, the salt should be synchronized between the apps.

    Does this mean when we "Expire Bookmarks", salt value will be set as NULL which will enforce APEX to use Application Alias as Salt value?

     

    Regards,

    Hari

  • 11. Re: apex_util.prepare_url with translated applications
    Christian Neumueller Expert
    Currently Being Moderated

    Hi Hari,

     

    the salt is based on a random value, but null by default. It gets a value when you click "Expire Bookmarks" and publishing copies the same value to the translated application. The fallback for a salt that is null is the application alias. Each translated application gets a new alias. Therefore, the actual value that is used for salting is by default different between primary and translated application. Setting a salt with "Expire Bookmarks" is good for 2 reasons. First, translated apps use the same salt, second, the checksum is more secure.

     

    Regards,

    Christian

  • 12. Re: apex_util.prepare_url with translated applications
    Hari_639 Guru
    Currently Being Moderated

    Thank you. It's clear now!

     

    Regards,

    Hari

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points