Get Items from limited list by providing username and password - C#

I'm using the code at the following link in order to get items from SharePoint list,
http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.client.list.getitems.aspx
I have a SharePoint list that limited to certain users.
How can I provide by this code (or else) a username and password and log in as a different user who has access to this SharePoint list and get its items?
Thanks!

Sorry, previous post didn't see you were using client object model.
Service.Credentials = (create new credentials passing username and password)
ICredentials credentials = new NetworkCredential("Joe",SecurelyStoredPassword,"mydomain");
            math.Credentials = credentials
Thanks!
Actually, my full question already posted here:
http:  //sharepoint.stackexchange.com/questions/84917/c-why-impersonation-is-expired-while-clientcontext-executequery-is-performe
but I was unable to post it here as a new user (images, links, lenght ...) even the link above I was need to insert spaces after "http:" to be able to post it.
Anyway, I don't know "client object model." am I using it?
You mentioned "Service.Credentials", What do you mean "Service"?

Similar Messages

  • I just purchased a new iMac, and can't get into my Wordpress blog. The username and password work on my old Macbook, iPhone4, etc, and all my other password-restricted sites are accessible...just not Wordpress. Ideas? New to all this...

    I just purchased a new iMac, and can't get into my Wordpress blog. The username and password work on my old Macbook, iPhone4, etc, and all my other password-restricted sites are accessible...just not Wordpress. Ideas? New to all this...Thanks! JP

    Try holding down the Shift key in Windows when opening iTunes. In the resulting dialogue you will get the option to create a new library or navigate to an existing one. The default location for your iTunes library is in C:\Documents and Settings\Username\My Documents\My Music\iTunes\ (or C:\Username\Music\iTunes\ in Vista). Look in there and see if you have more than one library file (they have the extension .itl) If you have more than one try opening them in turn, you may find your original library is still intact: How to open an alternate iTunes Library file

  • How to get items from a list that has more items than the List View Threshold?

    I'm using SharePoints object model and I'm trying to get all or a subset of the items from a SharePoint 2010 list which has many more items than the list view threshold (20,000+) using the SPList.GetItems() method. However no matter what I do the SPQueryThrottledException
    always seems to be thrown and I get no items back.
    I'm sorting based on the ID field, so it is indexed. I've tried setting the RowLimit property on the SPQuery object(had no effect). I tried specifying the RowLimit in the SPQuerys ViewXml property, but that still throws a throttle exception. I tried using the
    ContentIterator as defined here:http://msdn.microsoft.com/en-us/library/microsoft.office.server.utilities.contentiterator.aspx,
    but that still throws the query throttle exception. I tried specifying the RowLimit parameter in the ProcessListItems functions, as suggested by the first comment here:http://tomvangaever.be/blogv2/2011/05/contentiterator-very-large-lists/,
    but it still throws the query throttle exception. I tried using GetDataTable instead, still throws query throttle exception. I can't run this as admin, I can't raise the threshold limit, I can't raise the threshold limit temporarily, I can't override the lists
    throttling(i.e. list.EnableThrottling = false;), and I can't override the SPQuery(query.QueryThrottleMode = SPQueryThrottleOption.Override;). Does anyone know how to get items back in this situation or has anyone succesfully beaten the query throttle exception?
    Thanks.
    My Query:
    <OrderBy>
        <FieldRef Name='ID' Ascending='TRUE' />
    </OrderBy>
    <Where>
        <Geq><FieldRef Name='ID' /><Value Type='Counter'>0</Value></Geq>
    </Where>
    My ViewXml:
    <View>
        <Query>
            <OrderBy><FieldRef Name='ID' Ascending='TRUE' /></OrderBy>
            <Where>
                <Geq><FieldRef Name='ID' /><Value Type='Counter'>0</Value></Geq>
            </Where>
        </Query>
        <RowLimit>2000</RowLimit>
    </View>
    Thanks again.

    I was using code below to work with 700000+ items in the list.
    SPWeb oWebsite = SPContext.Current.Web;
    SPList oList = oWebsite.Lists["MyList"];
    SPQuery oQuery = new SPQuery();
    oQuery.RowLimit = 2000;
    int intIndex = 1;
    do
    SPListItemCollection collListItems = oList.GetItems(oQuery);
    foreach (SPListItem oListItem in collListItems)
    //do something oListItem["Title"].ToString()
    oQuery.ListItemCollectionPosition = collListItems.ListItemCollectionPosition;
    intIndex++;
    } while (oQuery.ListItemCollectionPosition != null);
    Oleg
    Hi Oleg, thanks for replying.
    The problem with the code you have is that your SPQuery object's QueryThrottleMode is set to default. If you run that code as a local admin no throttle limits will be applied, but if you're not admin you will still have the normal throttle limits. In my
    situation it won't be run as a local admin so the code you provided won't work. You can simulate my dilemma by setting the QuerryThrottleMode  property to SPQueryThrottleOption.Strict, and I'm sure you'll start to get SPQueryThrottledException's
    as well on that list of 700000+ items.
    Thanks anyway though

  • Obtaining a Subjects username and password from a servlet

    Ok probably an easy one for people out there. I don't even know if it is
    possible.
    I have a servlet that has BASIC authentication going on (lets say it's using
    WebLogic 7.0 default security realm). From the servlet I need to explicitly
    obtain the user's username AND password. I have no problem retrieving the
    principal it's the password I can't get a hold of. I've tried all sorts of
    things like:
    javax.security.auth.Subject subject =
    weblogic.security.Security.getCurrentSubject(); and then trying to get the
    private credentials. No luck though.
    Any ideas? Is it possible?
    Mich

    Thanks for the response Neil.
    I need the password because my servlet is accessing a secure Web service.
    When connecting to the Web service I need to provide the username and
    password of the user (these are passed in String format) and I don't want to
    have the user provide username and password again when accessing the
    external Web service. So really I need to access the WLS security realm
    (where my servlet is executing) to obtain the current user's username and
    password. Will the default credential mapper in WLS give me the username
    and password in text format...from the limited documentation I have read it
    doesn't appear to. Is this correct?
    Mich
    "Neil Smithline" <[email protected]> wrote in message
    news:[email protected]..
    The password is not stored in the Subject. We do this to reduce the
    risk of the password being snooped from WLS's memory. If you wish you
    could write a LoginModule that puts the password in the private
    credentials and then creates an authentication provider that uses that
    LoginModule and make it part of the current realm.
    In general there is no way to get the password from within WLS. The
    passwords are stored in a salted one-way hashed format that is not
    reverse decryptable except via exhaustive search.
    Why do you need the password? If it is for a remote access can you use
    the credential mapper?
    - Neil
    Michel Crichton wrote:
    Ok probably an easy one for people out there. I don't even know if it
    is
    possible.
    I have a servlet that has BASIC authentication going on (lets say it'susing
    WebLogic 7.0 default security realm). From the servlet I need toexplicitly
    obtain the user's username AND password. I have no problem retrievingthe
    principal it's the password I can't get a hold of. I've tried all sortsof
    things like:
    javax.security.auth.Subject subject =
    weblogic.security.Security.getCurrentSubject(); and then trying to getthe
    private credentials. No luck though.
    Any ideas? Is it possible?
    Mich

  • How to access to SSO username and password from JPDK

    Hello
    Does anybody know how to access, from Java PDK, to SSO username
    and password of user, currently connected to portal.
    Thank's,
    Tomaz Podbersic

    The portal user's password is one way hash algorithm (MD5) that
    cannot be reversed.
    What you'll have to do is setup a "External Application" and
    save an alternate username/password profile in that area. It
    requires the user to first enter that data (but only 1 time) the
    first time into that application.
    ===========================================
    <HELP NOTE>
    If anyone knows of an API to populate those tables when seeding
    or creating the user names to also seed or create the "external
    applications" user /pass this would be helpful.
    ============================================
    JSP java code:
    ====================
    PortletRenderRequest portletRequest = (PortletRenderRequest)
    request.getAttribute (HttpProvider.PORTLET_RENDER_REQUEST);
    ProviderUser myUser=(ProviderUser) portletRequest.getUser();
    =====================
    From this object instance you can get the user's name, and other
    Portal session info. NOT password.
    The External Application username & password is a bit more
    tricky to get.
    see:
    SQL Login Problems

  • I cant getmy new IPAD to connect to the wifi at my apartment.  how do i get a prompt to enter a username and password?

    I just purchased a new IPAD (16GB + 4G cell)  I am trying to get it to connect to the wifi hotspot at the apartment where I live.  The wifi signal requires a username and password.  How do I get the IPAD to prompt for the username and password?  Any help is appreciated

    Settings>General>Reset>Reset Network Settings

  • Username and Password authentication

    Hi,
    I am new to both JDBC and MSSQL. I've been connecting to msSQL server without providing username and password (DriverManager.getConnection(String url)). I am wondering how to enforce the username and password authentication so that username and password have to be verified before a connection is made. Thanks in advance.

    but where can I get the username & password? I can get
    the connection even with any username & password, why?Hi WeiHang,
    This is regarding the options you have set in the SQL Server. You have to choose from Windows NT authentication and SQL Server Authentication. If you give SQL Server authentication you have mentioned the username and password and you can connect to database simple using DSN(if you are using JDBC-ODBC). However if you choose WindowsNT authentication you donot specify the user name and password there and you have to enter the same at runtime.
    Hope this can help you

  • How can I pass username and password in a client bean to call a webservice?

    Hi,
    I have created a Client Java Bean for a web service (an automatically created Service from a Bapi) that requires username and password. How can I pass username and password in the code?
    Thank you!
    Julia
    This is my code:
    public Z_FlightGetlist port;
    Business Method.
    public String test1234() {
    try{
    BAPI_FLIGHT_GETLIST list = new BAPI_FLIGHT_GETLIST();
    list.setAIRLINE("KLM");
    port.BAPI_FLIGHT_GETLIST(list);
    return "ok";
    catch(Throwable e){
    return "error"+e;
    public void ejbCreate() throws CreateException {
    try{
    InitialContext ic = new InitialContext();
    Z_FlightGetlistService s = (Z_FlightGetlistService)ic.lookup ("java:comp/env/FlightProxy");
    Z_FlightGetlist vi = (Z_FlightGetlist)s.getLogicalPort(Z_FlightGetlist.class);
    this.port = vi;
    catch(Throwable e)

    Hello Julia,
    Check this document
    http://help.sap.com/saphelp_nw04/helpdata/en/50/a5d13f83a14d21e10000000a1550b0/frameset.htm
    Best regards, Maksim Rashchynski.

  • What to do in iPhoto, error when sending pics email, username and password not recognized

    I have imported photos from my camera to iphotos, cool it works great.
    But why when I want to email the pics, I get an error message that states
    my username and password arent recognized??

    In the iPhoto preferences ==> accounts delete the account and renter it
    Or better yet IMHO set Apple mail as your email client in the iPhoto preferences rather than iPhoto
    LN

  • Why asking for username and password once entered

    Hi!
    While configuring a new account in Outlook 2010 from Internet it asks for username and password one more time even after entering it once at the beginning of the account setup.
    Can anybody provide some details. Can't the automatic setup take the entered credentials once for all?
    Exchange 2010 and 2013
    Thanks.

    Hi,
    Based on my experience, the credential issue can be caused by the connectivity issue.
    Thus, let’s check if Outlook Anywhere connection is well by using ExRCA:
    https://testconnectivity.microsoft.com/
    Thanks,
    Angela Shi
    TechNet Community Support

  • What is the username and password for login to apex? please help

    Dear Friends
    I'm new with oracle Apex.
    I read the installation guid i i succeed in installing it and configuring DAD's file also.
    Now i log on the url:
    http://laptop:8080/pls/apex
    the logon dialog appeared but i do not know the username and the password to log on
    will any one tell me what is the default username or password
    or how to get them?
    by the way : the release i installed is Release 3.1
    thanks in advance
    Message was edited by:
    [email protected]

    THANKS FOR YOUR REPLAY
    I belive i had not enter username or password during installation.
    Do you think i have to reinstall it again.
    Or is there any way to provide username and password after installation.
    By the way, I used the installation guid provided with Apex.

  • Ical "authentication failed. your username and password were rejected by the server"

    i've a pretty busy server, fully configured with correct DNS.
    running 10.6.8, uptodate. i've stopped the ical service, and removed it from the server settings.
    then i created a folder on my RAID /volumes/raid/ical, set its ownership to _calendar:_calendar (uid 93), rwx,rx,-
    then added the iCal service back, and set the data store to this new folder.
    authentication is set to digest (to reduce potential kerberos errors), with SSL on.
    i then started the service
    an existing user CANNOT connect to the caldav server. i get the error: ical "authentication failed. your username and password were rejected by the server".
    if i create a NEW user, that user can correctly connect to the Caldav server. On first joining, an entry is created in the __uids__ folder and the calender works.
    SO. WHAT IS GOING ON?
    this is 10.6, so i do not have an option in WGM to 'enable calendering'. i've used the inspector to check for differences, but i can't see any.
    help. please. and no comments about DNS. the fact i can get  a new user to function means that is excluded. no comments about SSL. ditto. no comments about kerberos, its turned off. thanks.

    I often think of things in terms of time it takes to figure out the solution to the problem vs time it takes to nuke and pave.
    Dare I ask...  How many users would you have to remake? 
    150 users would probably take 2 hours to recreate?
    ...Have you spent 2 hours on this problem yet?  How about 4 or 6?
    Perhaps you could have typed up 450 remade users so far!
    I have a great idea as to how to change ownership of home folders to users after they're created.
    Thoughts on the problem... (but don't spend too much time on it!)
    What about crypt vs open directory password?
    In WGM, select the user, click the advanced tab, and ensure that your users have OD based passwords? 
    ...sometimes that pull-down menu displays OD, but it's not really.  Try selecting OD, retype the password there, and save.
    See if it works.
    What about in server admin....  Select the server in question, click the access button at the top.
    Ensure that your services are allowed for all users to use the iCal service.
    In the iCal service in Server Admin...
    Host name setting?  It's a stretch as new users seem to work.  Ensure it's correct?
    For the sake of argument...  Change authentication type to Any Method...  If you're running OD on the server, Kerberos is running.  I know that certain services require it even though you have the option.  Perhaps iCal is being finiky without it?
    I apologize if you've tried all these, but as a user forum, you'll typically get users that don't believe that you've tried the basics.  It's honestly the best place to start.  Seeing as we don't know what you've done, it's the best advice you'll get.
    HTH
    -Graham

  • How can I copy my saved usernames and passwords?

    I would like to be able to copy a list of saved usernames and passwords from the security section of options, to another folder on my computer. Is there a way to do this? Or is there a way to print out this list?

    See also:
    * http://kb.mozillazine.org/Password_Manager#Backing_up_and_restoring_passwords
    * http://kb.mozillazine.org/Password_Manager#Printing_passwords

  • Username and password: OLAP???

    To export metadata "BRIDGE" from OWB to OLAP required username and password, these are the sys, system? or for OLAP_DBA Role? so my usrer OLAPSYS are looked? what I have to make to export data? now still doen't export just ask to make shure that I make a correct thing.
    Thanks

    thanks for answer.server is running. Analyzer and spreadsheet add_in can connectted to the server correctly.I installed the EAS not as as a Windows service,and i cann't even login to the EAS console,and check the EAS log i remember there is some wrong with connect the Mysql services.yesterday i installed the EAS as as a Windows service,and have connect to the server correctly mannually.I don't know why I can't install the EAS not as as a Windows service now.

  • I'm being asked for a password with the following statement: The proxy moz-proxy://192.168.30.5:800 is requesting a username and password. The site says: "moz-proxy://192.168.30.5:800"

    Here's an example of what happens when I cancel the username and password request:
    ERROR: Cache Access Denied
    Sorry, you are not currently allowed to request:
    http://cben.net/?
    from this cache because your username and password are incorrect or your user group does not have permission to web browse. Please check your username and password. They are case sensitive so make sure Caps Lock is not on.
    This happens 100% of the time.

    I have the same problem. It ask for all elements that proxt detects ("NetworkError: 407 Proxy Authentication Required").
    Solution "No proxy" not works because i aslo require internet.
    I have version 10.0.2 on windwos XP, and this happens to me since I update it. On chrome and ie works without prompt.
    I upload and example, this page calls facebooks elements (i can't acces facebook) and others, for each element prompt proxy is shown.

Maybe you are looking for

  • Upgrading 1st generation iPod to install apps

    I want to upgrade my 1st generation iPod touch from 1.1.5 so that I can install apps. I purchased and tried downloading 3.1.1 but ran into this 8288 error that other people seem to be getting: https://discussions.apple.com/thread/3373167?start=0&tsta

  • CD cover art gone when exporting mp3

    Hi. My girlfriend's home computer doesn't have an internet connection so I used my iMac to import several of her CDs to iTunes, placing all the songs on a special playlist. Then I went ahead and burned an mp3 CD. When I import the mp3 files to her iT

  • Resposibility not showing in list

    We are runing into an issue in the apps where a resposibility that is assigned to your profile does not show up in the switch reposibility drop down list. This happens even if you change the start date on the existing record entry in your profile. Ha

  • Which RFC destination is missing?

    On MEREP_SBUILDER, I try to do a "BAPI Wrapper interface checks" for a SyncBO. I get the error: RFC communication failure: Error when opening an RFC connection". I look into SM59 and see a lot of RFC (type=3) defined. So which is missing? Thanks!

  • Safari browser stuck today was fine yesterday how can i sort it?

    Today I am unable to get the internet browser safari to work the page opens on ipad 2 but when I press go nothing happens. I did delete my history today is that the problem or the software download that says is downloaded but maybe is not. Any sugges