Authenticate for SPO from javascript, specifically WinJS

I'm tinkering with SPO in a WinJS app.
I'm having a couple of issues with authentication.  I've seen... this http://pholpar.wordpress.com/2013/05/11/accessing-office-365-sharepoint-sites-using-rest-from-a-local-html-javascript-host/
Which seems to do it, I've tested and for the most part it does.  However...
1.  It only works with the root site collection.  With mysite.sharepoint.com/sites/foo it doesn't work.  I need to use the root url to authenticate, then use the full URL (/sites/foo) to query the REST API.  However, what happens if I
have a user that has permission on /sites/foo, but not in the root site collection?
2.  Is this really the best/only way?  It seems ever so clunky, receiving a huge responses just to authenticate.  I've used
this before in C# from Wictor Wilen, but this is of course a C# solution that depends on the .net framework, so I would need to host a local or Azure WCF service.  Something I'd rather avoid.
3. What would be ideal is to somehow use the standard MS Auth screen and simply get back the token from that?? Is that possible?
Thx
Steve

Hi Khiem,
It seems that you want to host the WinJS project in WebView control, is that right? If not, feel free to let me know.
Based on my knowledge, you cannot do this. WinJS project and C# store app project are different. WinJS project works on Windows Library for JavaScript 2.0, but there is no option to add this reference in C# windows store app project.
Webview control is not a general- purpose browser, it’s not recommend to render this kind of content in it. Matt has a blog about the control.
http://blogs.msdn.com/b/wsdevsol/archive/2012/10/18/nine-things-you-need-to-know-about-webview.aspx.
Please post more information about your scenario on why you need host WinJS in WebView control.
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.

Similar Messages

  • Query UCCX database for calls from a specific Caller ID

    Hi,
    I did some searching and could not find this answer specifically.
    I have a request from the call center supervisor to provide a report of all calls coming into the CSQ's showing all of the important data (date, time, answered, not answered, length of call, disposition, etc.) for calls from a specific caller ID for a specific date range.
    The caller ID starts with 9XX-XXX-XXXX, so of course UCCX Historical Reports will not display this number as a parameter in the Detailed Call by Call CCDR report because I am limited to the first 32,765 rows. I tried modifying the XML file but have not been successful.
    I tried doing a query through the CLI but not sure if I have the query right.
    Any insight?
    Thank you very much.

    I tried modifying the XML file for the Detailed Call CSQ Agent report
    ICD_Detailed_Call_CSQ_Agent_en_us.xml with the following:
    BEFORE:
    SELECT distinct callednumber FROM contactcalldetail
    AFTER:
    SELECT SKIP 10000 FIRST distinct 20000 callednumber FROM contactcalldetail
    Unfortunately, there are no changes in the available parameters shown:
    The number starts with a '9', so I need to skip the numbers that start with 408. Any help?

  • Sound for messages from a specific email address

    I get a couple of hundred email messages a day. I have Mail checking every five minutes for messages. I obviously don't want Mail to bong me every five minutes that it's got new messages, but I would really like if it could make a sound when I get mail from a specific email address. Is this possible?
    Thanks.
    All the best,
    Tom

    You may be able to do what you want through "Rules" which is in Mail/Preferences/Rules. Click on the _"Add Rules"_ button. From that window, you will be able to select specific email addresses that you want to add a specific sound to *(Perform the following actions)*.
    Under the General tab, I gather you need to have "New Messages Sound" set to "None."
    *"Play sounds for other mail actions"* should be checked.

  • Genrating unique tagIds with in a repeater for acessing from javascript

    Hello BEA experts,
    I am trying to generate unique tagids for elements with in a repeater so as to be able to access them using javascript to do some validations , I tried using scriptlets like <%=i%> and also tried using the {container.index} property by appending it to the tagId ,but they are not being generated uniquely ..
    Can anyone point me out in the right direction has anyone done this before..Any hints?
    Thanks in advance
    -Bob

    Hi Bob
    Here is a sample to generate unique id's and access them in java script.
    I basically had the tagid generated using expressions to be unique like below
    <netui:checkBox tagId="<%=checkBox+(j++)%>"
    dataSource="{container.item.chkBox}" />
    Thanks
    Vimala
    Here is the full jsp source:
    <netui:html>
    <head>
    <title>
    Web Application Page
    </title>
    <script language="JavaScript" type="text/JavaScript">
    function printValues()
    for (i=0;i<3;i++) {
    alert (document[getNetuiTagName("myform")][getNetuiTagName("String"+i)].value)
    alert (document[getNetuiTagName("myform")][getNetuiTagName("Check"+i)].checked)
    alert (document[getNetuiTagName("myform")][getNetuiTagName("Radio"+i)].checked)
    </script>
    </head>
    <body>
    <netui:form tagId="myform" action="displayChoice">
    <%!int i=0; String str="String"; String checkBox="Check";int j=0; String radio="Radio";int k=0;String textBox="Text";int l=0;%>
    <netui-data:repeater dataSource="{actionForm.formList}">
    <netui-data:repeaterHeader>
    <table class="tablebody" border="1">
    <tr class="tablehead" valign="top">
    <th>ChkBox</th>
    <th>Str</th>
    </tr>
    </netui-data:repeaterHeader>
    <netui-data:repeaterItem>
    <tr valign="top">
    <td> <netui:hidden tagId="<%=str+(i++)%>" dataSource="{container.item.str}" /> </td>
    <td> <netui:checkBox tagId="<%=checkBox+(j++)%>" dataSource="{container.item.chkBox}" /> </td>
    <td> <netui:radioButtonGroup dataSource="{actionForm.radioStr}">
    <netui:radioButtonOption value="Good{container.index}"> </netui:radioButtonOption>
    </netui:radioButtonGroup>
    </td>
    <td> <netui:select defaultValue="{pageFlow.defaultValues}" dataSource="{container.item.selectStr}" size="5"> </netui:select></td>
    <td> <netui:textBox dataSource="{container.item.strText}" /> </td>
    </tr>
    </netui-data:repeaterItem>
    <netui-data:repeaterFooter></table></netui-data:repeaterFooter>
    </netui-data:repeater>
    <netui:button value="displayChoice" type="submit" onClick=""/>
    </netui:form>
    <table>
    </body>
    </netui:html>

  • How to get values from a table(in jsp) for validation using javascript.

    hi,
    this is praveen,pls tell me the procedure to get values from a table(in jsp) for validation using javascript.
    thank you in advance.

    Yes i did try the same ..
    BEGIN
    select PROD_tYPE into :P185_OFF_CITY from
    magcrm_setup where atype = 'CITY' ;
    :p185_OFF_CITY := 'XXX';
    insert into mtest values ('inside foolter');
    END;
    When i checked the mtest table it shos me the row inserted...
    inside foolter .. Now this means everything did get execute properly
    But still the vallue of off_city is null or emtpy...
    i check the filed and still its empty..
    while mtest had those records..seems like some process is cleaining the values...but cant see such process...
    a bit confused..here..I tried on Load after footer...
    tried chaning the squence number of process ..but still it doesnt help
    some how the session variables gets changed...and it is changed to empty
    Edited by: pauljohny on Jan 3, 2012 2:01 AM
    Edited by: pauljohny on Jan 3, 2012 2:03 AM

  • Invoking Applet methods from Javascript for Netscape 6

    Hi,
    I am trying to invoke an applet method from javascript, but it is failing with Netscape 6 browser:
    I am doing it the following way-
    function test(form)
    var i = document.myapplet.getname();
    where myapplet is the name of the applet and getname is a method within the applet. This is
    working with Ie but not with netscape 6.
    I would appreciate it if someone could tell me how should I invoke the applet method for netscape browsers.
    Thanks.
    Jay Srin.

    Not working with NS 6 - and will not i guess till they upgrade to Mozilla Version 1.0 - Live Connect is not implemented 100% correct yet - if you want you can download the 7.0 Pre Release Netscape - since its using mozilla 1.0 it should work , see :
    http://forum.java.sun.com/thread.jsp?forum=30&thread=272975

  • View ADSI properties for an AD object from a specific DC

    Hello all,
    What I'm wanting to do is to view the ADSI properties of an active directory object by querying a SPECIFIC DC. My plan is to use this information to check whether adprep has replicated to all DC's in the domain.
    For example, the following command gets me the ADSI information for an AD object from some DC for Domain1:
    [adsi]'LDAP://CN=ActiveDirectoryUpdate,CN=ForestUpdates,CN=Configuration,DC=Domain1,DC=net'
    However, I would like to get this information from a SPECIFIC DC, not just from any DC. I have also been tampering around with get-adrootdse, but am unable to determine how to drill down under a specific "naming context" object (like to return
    the "cn=activedirectoryupdate,cn=forestupdates" object under the configuration naming context object like the command above):
    Foreach($namingcontext in (Get-ADRootDSE -server DC1.Domain1.net).namingcontexts){
    get-adobject $namingcontext -Properties *
    Anyone have any ideas how I can use the [ADSI] adapter or get-adrootdse to return specific AD objects from a specific domain controller?

    Nevermind, I believe I found my answer:
    http://blogs.technet.com/b/heyscriptingguy/archive/2005/05/17/how-can-i-access-active-directory-on-a-specific-domain-controller.aspx

  • Report for - All Status Messages from a Specific System

    
    I would like a report that is based on the console query “All Status Messages from a Specific System”. I have tried to take the SQL Query from the smsprovider.log but with no luck. So there is where my SQL knowledge ends. Do any of you maybe already have this
    report or could help me create one?

    You could use v_StatMsgWithInsStrings as an alternative. 
    Torsten Meringer | http://www.mssccmfaq.de

  • Define Alert for mail from specific sender on E5-0...

    Hi All
    I'm supposed to receive pager on my E5-00 overnight so I wanted to define a alert (ringtone) when a mail from a specific user is received is that possible?
    Regards 

    You would have to set up a server-side filter which moves everything which isn't from this sender to another folder which you'd have to look at in the morning, enable it every night and disable it every morning.

  • Is there Any Way for calling servlet inside from javascript ?

    i have to call servlet from javascript .
    is it possible?

    is it possible?I don't know what excactly you are trying to do, but yes it's possible.
    You need to send a request to the server.
    Keep in mind that JavaScript is executed on the client whereas the Servlet is executed on the server.

  • Calling1.4.1 signed applet from Javascript causes keyboard/focus problems

    Pretty sure there's a JRE bug here, but I'm posting to forums before I open one in case I'm missing something obvious :-)
    This issue may be specific to IE, I haven't tested elsewhere yet. Our web application is centered around a signed applet that is initialized with XML data via Javascript. We first noticed the problem when our users started upgrading from the 1.3.x plug-in to the 1.4.x plug-in. The major symptom was that shortcut keys stopped working. I debugged the problem off and on for about a month before I boiled it down to a very simple program that demonstrates the issue (included below). Basically, the program has a function that adds a JButton to a JPanel and registers a keyboard listener (using the new DefaultKeyboardFocusManager class) that prints a message to the console. This function is called by the applet's init() method, as well as by a public method that can be called from Javascript (called callMeFromJavascript()). I also included a very simple HTML file that provides a button that calls the callMeFromJavascript() method. You can test this out yourself: To recreate, compile the class below, JAR it up, sign the JAR, and put in the same dir with the HTML file. Load the HTML file in IE 5.0 or greater, and bring the console up in a window right next to it. Now click the button that says init--you should see the small box appear inside the button that indicates it has the focus. Now press some keys on your keyboard. You should see "KEY PRESSED!!!" appearing in the console. This is proper behavior. Now click the Init Applet from Javascript button. It has removed the button called init, and added one called "javascript". Press this button. Notice there is no focus occurring. Now press your keyboard. No keyboard events are registered.
    Where is gets interesting is that if you go back and make this an unsigned applet, and try it again, everything works fine. This bug only occurs if the applet is signed.
    Furthermore, if you try it in 1.3, signed or unsigned, it also works. So this is almost certainly a 1.4 bug.
    Anyone disagree? Better yet, anyone have a workaround? I've tried everything I could think of, including launching a thread from the init() method that sets up the components, and then just waits for the data to be set by Javascript. But it seems that ANY communication between the method called by Javascript and the code originating in init() corrupts something and we don't get keyboard events. This bug is killing my users who are very reliant on their shortcut keys for productivity, and we have a somewhat unique user interface that relies on Javascript for initialization. Any help or suggestions are appreciated.
    ================================================================
    Java Applet (Put it in a signed JAR called mainapplet.jar)
    ================================================================
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.*;
    public class MainApplet extends JApplet implements KeyEventDispatcher
        JPanel test;
        public void init()
            System.out.println("init called");
            setUp("init");
        public void callMeFromJavascript()
            System.out.println("callMeFromJavascript called");
            setUp("javascript");
        private void setUp(String label)
            getContentPane().removeAll();
            test = new JPanel();
            getContentPane().add( test );
            JButton button = new JButton(label);
            test.add( button );
            test.updateUI();
            DefaultKeyboardFocusManager.getCurrentKeyboardFocusManager().addKeyEventDispatcher(this);
        public boolean dispatchKeyEvent(KeyEvent e)
            System.out.println("== KEY PRESSED!!! ==");
            return false;
    }================================================================
    HTML
    ================================================================
    <form>
    <APPLET code="MainApplet" archive="mainapplet.jar" align="baseline" id="blah"
         width="200" height="400">
         No Java 2 SDK, Standard Edition v 1.4.1 support for APPLET!!
    </APPLET>
    <p>
    <input type="button" onClick="document.blah.callMeFromJavascript();" value="Init Applet via Javascript">
    </form>

    I tried adding the requestFocus() line you suggested... Same behavior.
    A good thought, but as I mention in my description, the applet has no trouble gaining the focus initially (when init() is called). From what I have seen, it is only when the call stack has been touched by Javascript that I see problems. This is strange though: Your post gave me the idea of popping the whole panel into a JFrame... I tried it, and the keyboard/focus problem went away! It seems to happen only when the component hierarchy is descended from the JApplet's content pane. So that adds yet another variable: JRE 1.4 + Signed + Javascript + components descended from JApplet content pane.
    And yes, signed or unsigned DOES seem to make a difference. Don't ask me to explain why, but I have run this little applet through quite a few single variable tests (change one variable and see what happens). The same JAR that can't receive keyboard events when signed, works just fine unsigned. Trust me, I'm just as baffled as you are.

  • Access PL/SQL Objects from JavaScript

    I have following Problem:
    I want to have access to a pl/sql object from javascript.
    for example:
    i have a procedure with a parameter called test from Type Test.
    PROCEDURE toTest (
    test Test)
    IS
    BEGIN
    htp.script('here i want the value of test', 'javascript');
    would be really great if somebody can help me fast.
    thanks a lot
    holger

    I think it might have something to do with htmldb_Get
    Hope that clue gets you somewhere. I would love to see a working example of this for 4.02 if anyone actually has one.
    Regarding dynamic actions there's a severe limit on the number of them I believe.29? Which is one reason I avoid them and
    just do things in javascript. Personally I think javascript is actually easier to understand because one does not have to
    divide an actiivity up into several pieces. But that might just be specific to my brain, I don't know.

  • How to read items with REST from a specific folder.

    I have a sharepoint list stored over 5,000 items divided into multiple folders.
    Using JSOM, I could read items by accessing a specific folder using CAML like
        context = new SP.ClientContext('SiteURL');
        list = context.get_web().get_lists().getByTitle('ListName');
        camlQuery = new SP.CamlQuery();
        caml = '[xml for caml]';
        camlQuery.set_viewXml(caml);  
        camlQuery.set_folderServerRelativeUrl('FolderPath');
        context.load(list);
        context.executeQueryAsync(Function.createDelegate(this,function(){} ),Function.createDelegate(this,function(){}));
    But I don't know how to do the same thing with the REST.
    (Filtering by OData query operations couldn't solve SPQueryThrottledException.)
    Please give me advice.

    Thank you for the advice.
    I saw the contents, but it does
    not work
    well.
    Now I use REST from javascript file deploied on Style Library with jQuery.
    function getFolder () {
    $.ajax({
    url:"[SiteCollectionURL]/_api/web/GetFolderByServerRelativeUrl('[SiteCollectionPath]/libraries/[LibraryName]')/Folders",
    method:"GET",
    headers:{
    "accept":"application/json;odata=verbose",
    //"accept":"application/atom+xml",
    async:false,
    success: function (data){
    console.log("success");
    error: function (err){
    console.log("failure");
    When I set url path until "GetFolderByServerRelativeUrl~", response data include library's name, etc. Looks like good.
    But when I write until "/Files" as above, response data has only prototype objects and not has data.body property.
    The same result occurred
    either in
    list or library.
    Please point out
    if there is misunderstanding.

  • Dispatching event from Javascript

    Can I dispatch events from javascript to flash player? I am trying to do so by calling dispatchEvent() on flash player dom object but the event is not passing inside flash player. Any links or clue?

    To be specific ... I can catch a right click and supress it. But I want to send it to flash (lets say) as a left click. Problem is when i do that, javascript listner for dom element will get fired for left click but there wont be any events in flash.
    SO the question is can i fire events on flash from outseide or is it outside the public APIs?

  • Error while accessing a public method of applet from javascript.

    Hi,
    I am getting "Object doesn't support this property or method" error
    when accessing a public method of applet from javascript in IE 6 using
    document.applets[0].myMethod();
    The same is working in IE 7.
    Thanks in advance.
    Regards,
    Phanikanth

    I don't know why it happens, but this works for me in both versions:
    <applet ..... name="MyApplet">
    </applet>and in javascript use
    document.MyApplet.myMethod()

Maybe you are looking for