How to implement OData based BASIC Authentication using HTML, JavaScript for Mobile Apps using Apache Cordova/PhoneGap and datajs-1.1.1.js library

Hello,
I have an issue with OData based BASIC authentication for iOS App created using HTML, JavaScript, SAP UI5, OData and Apache Cordova/PhoneGap.
Please check the post here http://scn.sap.com/thread/3527245
Request you to kindly reply on the above given link.
Thanks and Regards,
Suraj Kumar

Hello Prathik,
The code which I am using for OData based BASIC Authentication, for my Mobile App is as below.
   var onSuccess = function(data) {
   alert("We are Through"); //Just to check that the OData request was sucessful
   var onError = function(err) {
   switch(err.response.statusCode) {  
   case 403 : {
   window.alert("Error Code - 403, Service unreachable ");
   break;
   case 401 : {
   window.alert("The credentials are incorrect or missing!");
   break;  
// dataUserName and dataPassword are the two variables, in which I am storing my Username and Password, respectively.
   var connectionRequest = {
   requestUri: "ODATA SERVICE URL GOES HERE/",
   headers: { Authorization : 'Basic ' + Base64.encode(dataUsername + ":" + dataPassword) },
   method: "POST"
   OData.request( connectionRequest, onSuccess, onError);

Similar Messages

  • How to Implement Condition-Based Tax Calculation in R/3 for Mexico

    Is there a manual, or some type of guide to implementing condition-based tax calculation in R/3 for Mexico?
    Kind regards,
    Mark Walker

    Hey Mark,
    Check the following link for mexico taxes, may be helpful to you..
    http://help.sap.com/printdocu/core/Print46c/EN/data/pdf/CAINTMX/CAINTMX.pdf
    Thanks
    Prasada

  • Button with transparent for Mobile apps using flex

    Hi,
    I am new to adobe flash builder 4.5 and flex 4.5 sdk. I have created a viewbased mobile application for Iphone and Android. What I tried to do is, I  placed a button in my first view and attached an image into it (.png file).
    I went to Buttons Property sheet - Appearance tab - I changed the Chrome color to white to change the background color of the button to white. Now my image is seen properly. But my image looks too small. And more thing is, I see the black border.
    What I basically need is, I just want to create a transparent button so that my image is clearly seen.
    Can anyone help me in this?

    I think you need to look at the button skin
    this might help
    http://help.adobe.com/en_US/flex/using/WSA95C9644-B650-4783-B5C0-D2C7F95A23E3.html

  • How to configure RSA Based User Authentication on XR?

    Hello,
    I have been reading Cisco docs about how to configure RSA Based User Authentication on a ASR9K.
    http://www.cisco.com/c/en/us/td/docs/routers/asr9000/software/asr9k_r4-2/security/configuration/guide/b_syssec_cg42asr9k/b_syssec_cg42asr9k_chapter_0110.pdf
    I have problems importing the public key to the router. No matter how i try i always get this output: 
    RP/0/RSP1/CPU0:XXX#crypto key import authentication rsa  tftp://10.232.201.180/id_rsa.pub
    Wed Jul 16 14:00:15.558
    Cannot execute the command : Invalid argument
    I have tried copying the file to Disk0: and using this path but get the same error.
    Could anyone help me explaining step by step how to configure RSA Based User Authentication.
    Thanks

    Hi
    1. Generate a key on your station
     ssh-keygen -t rsa -b 1024
    2. Remove the key type and host, leaving only key and decrypt it using base64:
     cut -f2 -d\  id_rsa.pub | base64 -d > id_rsa2.pub
    3. Import the key to the deivce
     (admin)#crypto key import authentication rsa username USERTEST ftp://xxxr/ak/id_rsa2.pub
    4. Create a username on the device matching the imported key
    username USERTEST
     group root-system
    Regards,
    /A

  • Purchased Itunes card..Have balance on my itunes account but trying to use the balance for an APP game...how do i transfer the funds ?

    I had a itunes card purchased for me...I redeemed it on my iphone in the Itunes APP...shows it was redeemed succesfully.Want to use the balance for an APP game i have....SImpsons Tapped out...hoe do i transfer it to it . it keeps using my credit card for purchasing premium items...how do i fix this to the itunes balance...thanks

    So then put any sim card in and restore it.  this isn't rocket science

  • The wifi at my school isn't very good. And I can't send iMessages through it. It works for some apps like score center and my radar app, but doesn't work for other apps like clash of clans and iMessage. How can I get it to work on that  wifi network

    The wifi at my school isn't very good. And I can't send iMessages through it. It works for some apps like score center and my radar app, but doesn't work for other apps like clash of clans and iMessage. How can I get it to work on my school wifi. I have an iPhone 4S on AT&T and iOS 7.04

    In a roaming network, your "main" router is the device that would require port mapping/forwarding to be configured in order to access the IP camera from the Internet. This router is also the one that would be provide the private IP address for the camera which you will want to be a static one.
    So as you described your network, the IP cameras should be getting an IP address or you assigned it a static one and this is the address that you would enter in the Private IP address (or equivalent depending on the router used) field when setting up port mapping.
    If you are not able to access this camera from the local network, then this should be troubleshot first.

  • Can I use macbook air for ios app development?

    I would like to know if i can use macbook air for ios app development or macbook pro is only option?

    Just to reinforce what shldr2thewheel says - be very sure what size memory you want if you get a Macbook Air. There is *no* way to change after purchase. My advice is to go for the 4GB option - especially if you want to do app development.
    The internal storage (solid state drive) of the Air can be upgraded if required but it will probably be an expensive option. If you don't think the storage will be enough then maybe using a USB connected drive to hold non-essential files is an option.
    As to deciding between the Air and Pro you are basically making a decision between portability (Air) and expandability/bigger screens (Pro). What is more important to you?
    Mark

  • ITunes U: how do I turn off the 50 MB download limit for mobile data connections?

    Since I rarely have access to Wi-Fi networks I do actually want to download iTunes U content using mobile data. Videos (and even some slide decks) exceed the 50 MB limit that iTunes U will allow you to download over mobile data connections. How do I turn off the 50 MB download limit for mobile data connections?

    You can't unless the phone is jailbroken (which in turn voids your warranty)

  • I currently have 2 Apps for each App.  ie: Photoshop CC and Photoshop CC (2014).  How can I delete the Older versions from my List ?

    I currently have 2 Apps for each App.  ie: Photoshop CC and Photoshop CC (2014).  How can I delete the Older versions from my List ?

    CC 2014 uses NEW plugins https://forums.adobe.com/thread/1499663
    -so do not uninstall the older CC programs if you use plugins in your programs
    http://helpx.adobe.com/creative-cloud/help/install-apps.html to install or uninstall

  • After downloading new version of Firefox 4 I am unable to use touch pad for scrolling. I have tried installing and uninstalling the new version but this problem has always been occuring.

    after downloading new version of Firefox 4 I am unable to use touch pad for scrolling. I have tried installing and uninstalling the new version but this problem has always been occuring. I do not know how to fix this problem so I always return to the old version.

    If you have problems with updating or with the permissions then easiest is to download the full version and trash the currently installed version to do a clean install of the new version.
    Download a new copy of the Firefox program and save the DMG file to the desktop
    * Firefox 5.0.x: http://www.mozilla.com/en-US/firefox/all.html
    * Trash the current Firefox application to do a clean (re-)install
    * Install the new version that you have downloaded
    Your profile data is stored elsewhere in the Firefox Profile Folder, so you won't lose your bookmarks and other personal data.
    * http://kb.mozillazine.org/Profile_folder_-_Firefox

  • Hi i am using iphone 4. for free apps download i am being charged in my bank account

    hi i am using iphone 4. for free apps download i am being charged in my bank account. how to come out of it.

    If you've just setup your account, you're not actually being charged. This is a hold to insure your account details are valid, & will be reversed in a day or two.

  • How to manage source for mobile app build by android studio,Git or team explorer?

    Hi,We use TFS 2013 for source control ,now we want to start mobile app using "android studio",
    How could control source of that project,How we can have features of "tfs source control" on that type of project such a mobile app that uses "android studio".
    I know we can integrate git or using command in team explorer but what is the differences and how to decide each one is better?
    thanks
    Thanks. Bahar Ghadami Web Developer And Technical expert

    Hi Bahar,
    As far as I know, you cannot have your code under source contorl of TFS when work on the mobile app that uses "Android studio". You cannot use Android Studio to connect to TFS hence it's unavailable for your requirement.
    If your use Ecliplse, you might integrate with Team Explorer Everywhere and connect to your on-premise TFS.
    Best regards,
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Troubleshooting Address Book issues using Palm Desktop for Mac (v. 4.2.1) and a T3?

    Can someone please make suggestions which would correct the following issues?
    1) When printing an Address Book from my Mac, the information in the "title" field prints twice. (I have checked my Preferences settings & reviewed how I have entered the information, etc. and everything is in order; also, an Address CARD DOES print correctly --- and --- after syncing to my T3 and then to my husband's PC, an Address Book prints correctly from the PC.)
    2) After I have synced the Address Book from my Mac to my T3, the "zip code" entries appear BEFORE the "city" entries on the T3. (The zip codes appear correctly on my Mac and print out correctly.)
    3) After I have synced the Address Book from my Mac to my T3, the "contacts" all appear in BLACK on my T3. Is there any way to show the different "contact categories" in COLOR on the T3 as they were originally entered in my Palm Desktop for Mac?
    Post relates to: Tungsten T3

    I Use Windows And Cant Help Sorry
    -------------- Original message --------------
    Answer Request
    Dear joeweather45,
    HAR asked a question that matches your expertise. Please respond to this question by directly replying to this email or by clicking the link below.
    Question Subject: Troubleshooting Address Book issues using Palm Desktop for Mac (v. 4.2.1) and a T3?
    Question Details: Can someone please make suggestions which would correct the following issues?
    1) When printing an Address Book from my Mac, the information in the 'title' field prints twice. (I have checked my Preferences settings & reviewed how I have entered the information, etc. and everything is in order; also, an Address CARD DOES print correctly --- and --- after syncing to my T3 and then to my husband's PC, an Address Book prints correctly from the PC.)
    2) After I have synced the Address Book from my Mac to my T3, the 'zip code' entries appear BEFORE the 'city' entries on the T3. (The zip codes appear correctly on my Mac and print out correctly.)
    3) After I have synced the Address Book from my Mac to my T3, the 'contacts' all appear in BLACK on my T3. Is there any way to show the different 'contact categories' in COLOR on the T3 as they were originally entered in my Palm Desktop for Mac?
    Device Name: Tungsten T3
    Desktop Computer Operating System: Mac OS 10.3.x
    Desktop computer brand and model number: Mac PowerBook G4
    Desktop Personal Information Manager: Palm Desktop 4.2.1 Mac
    How is your device connected to your computer: USB
    Type of help question: Troubleshooting
    Your expertise is valued. Thanks in advance for your response!
    Need more information before responding to this question? Send a Request for Clarification to the question asker, entering any necessary details in the body of the email.
    Unable to answer this question? Click one of the links below and enter any necessary details in the body of the email. The reason and details you enter will be sent to the question asker.
    Busy | Inappropriate | Answered | Other
    Thank you for taking the time to send this notification. Your participation is valued and we look forward to your continued involvement.
    Sincerely,
    The palmOne Help Forums Team

  • How can I empty my sandbox on my ipad air for several apps?

    how can I empty my sandbox on my ipad air for several apps?

    I'm not sure what you mean by "sandbox". I presume you're talking about getting extra room on your "hard drive" (it's not a hard drive, but a flash drive, I suppose ... ).
    If so, then just go to Settings --> General --> Usage ... and you have three sections on that page ... "Battery", "Storage", "iCloud" ... look at the second section where it says "Storage" and go to "Manage Storage" ... and you can start deleting apps that you're not using or are too big for your available space.
    Later on (soon), you'll be able to clear off some photos from your flash drive on your iPad and that will help clear off some space, but that's not up and running just yet. It's the "iCloud Photo Storage" service that Apple has announced. It will be coming very soon.

  • TS1702 We use one ID for  the Apps store for 2 iPhones. In the second profile on the Macit is impossible to update apps there is a mistake. What is the decision?

    We use one ID for  the Apps store for 2 iPhones. In the second profile on the Macit is impossible to update apps there is a mistake. What is the decision?

    This happens when you both use the same Apple ID for iMessage.  To fix this you have two choices:
    On one of the phones go to Settings>Messages>Send & Receive, tap the ID, sign out, then sign back in with a different ID.  Note: you can still share the same ID for purchasing in Settings>iTunes & App Stores; or
    On both phones go to Settings>Messages>Send & Receive and uncheck the email address(es) shown under "You can be reached by iMessage at".  Also uncheck the other phone's phone number, if present.

Maybe you are looking for