.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

Ho to force ClaimProvider recalculates the claims for current user?

Posted By:      Posted Date: September 18, 2010    Points: 0   Category :SharePoint
Hi I create a custom claim provider, it works fine. I need to add claim when user enter a key in specific page, I flag it in my user profile database, but the problem is how to make ClaimProvider recalculate the claim for current user?

View Complete Post

More Related Resource Links

Creating Sites/Lists/List Items under Current User Context in SharePoint By Using SPUserToken

Usually we do this by performing the action under RunWithElevatedPrivileges method and updating the listitem using SPListItem.SystemUpdate() method (see here). but this approach has its own flaws like (RunWithElevatedPrivileges will run under system account, we cannot use SystemUpdate for SPSite,SPWeb,SPList, since it runs under system we will "CreatedBy" by as SystemAccount).

Knowing the event occured in user control in current page




      My web application has user control which uses third party controls called Devexpress controls. The user control is a menu  and is part of the Master page. It is placed there because this needs to be available in all the pages. My user controls raises a even on item clicked. Now, My question is that Is there any way to know that the event has occurred in page_load of the current page in which I am in?

create current user filter in sharepoint designer or wss3

hi, how can i create a current user filter in sharepoint designer?

The name 'User' does not exist in the current context.


Hey guys,

I've got a literal control to display the username of the user logged into our companies intranet system, originally I had a LoginName control but couldn't get strip to remove the domain from the username (as the format is domainname\username) so I'm trying it this way.

    protected void Page_Load(object sender, System.EventArgs e)
        string[] Parts = User.Identity.Name.Split("\\");

        if (Parts.Length == 2)
            loginName.Text = Parts[1];
            loginName.Text = User.Identity.Name;


    protected void Page_Load(object sender, System.EventArgs e)
        string[] Parts = User.Identity.Name.Split("\\");

How to determine if current SQL User is admin or owner?

I wish to determine, from my C# application, if the current user has admin or owner rights to the database they are connected to. I beleive I have all the information required: Servername Database name Windows/Database auth username (If database auth) password (if database auth) I'm trying to find a way that using the smo objects (smo.user), but as of yet I cant quite work it out: - How to get the appropriate user - How to determine if that user is an admin/owner. Any tips would be appreciated. If I have posted to the wrong forum, let me know - I couldnt find one that was obviously more appropriate. Thanks.

How to get current logged user name using javascript ?

HelloI am using moss with FBA. I got following javascript to get current user login name. It is displaying curent username properly if user is belong to owner group. But whne I logged with another username who is part of member group(Contribute role), it is not displaying name. Please let me know what I am missing?In following javascript I alerted userId, it is coming in both the case <script type="text/javascript" src="/_layouts/JSAPI/SPAPI_Core.js"></script> <script type="text/javascript" src="/_layouts/JSAPI/SPAPI_Lists.js"></script> <script type="text/javascript" src="/_layouts/JSAPI/SPAPI_UserGroup.js"></script> <script type="text/javascript" src="/_layouts/JSAPI/SPAPI_UserProfile.js"></script> <script language="JavaScript"> var curTitle = null; alert(_spUserId); function getCurrentUserName() { var curUserName = null; var lists = new SPAPI_Lists('') var items = lists.getListItems( 'User Information List', '', '<Query><Where><Eq><FieldRef Name="ID"/><Value Type="Counter">' + _spUserId + '</Value></Eq></Where></Query>', // query '<


I am using Forms  Authentication. I set the cookie when user logs in. Welcome text =  HttpContext.Current.User.Identity.Name Logout = Session.Abandon and Session.Clear() Now when I logon using different user name i still see my previous login name when I do" HttpContext.Current.User.Identity.Name  

Get current logon user id with SPContext.Current.Web.CurrentUser.LoginName

Hi all,I've been trying to search for the method to display the currently logon user id. So far, most sites I've visited used SPContext.Current.Web.CurrentUser.LoginName.I've tried this in my SharePoint custom application page. Everything works great.I have a test account, when logged in, was displayed as xxx\testacc.For some reasons, I changed the id in AD to xxx\test and did a full import to MOSS.I logged in to the custom application with the changed id, i.e. xxx\test, BUT the value of SPContext.Current.Web.CurrentUser.LoginName still displayed as xxx\testacc!How do I get the latest id? Has anyone encountered this before?Thank you.Kelvin

Is it possible to display the friendly name or email address of LiveID User Using Claims Authenticat

We have finally gotten LiveID authentication to work.  However when we specify a user to add to a sharepoint group, we need to do it via the unique id that live uses.   The user does login using their usual email address and password, but on the sharepoint side they see the PUID@live.com as the logged in user, and when we want to specify the user to have access to the a particular site or library, we have to do it by the same PUID@live.com.  This display makes it difficult to manager users on the sharepoint side.   Is there something I missed on setting up of the authentication provider, or is there something I can do to get sharepoint to retrieve the other information so that we can view the user through the email or full name that live provides?   Steve Paplanus

How to pass current user's login name as parameter to a RDL . (SSRS integration with sharepoint)

I have a webmethod which has two parameters. One is for year and another is for Currently logged in user. I call this method in RDL file. From RDL File how can we pass Currently logged in user's login name? I tried  with USER!UserID. It is passing the USERID but i need to pass the login name(SPWEB.currentuser.loginname)  

current user identity in custom security trimmer

The crux of my problem is that I want to impersonate  a user’s NTLM credentials in the context of a SharePoint custom security trimmer to execute HttpWebRequests to check user access to URLs.  When accessing WindowsIdentity.GetCurent() in the security trimmer, the System.Security.Principal.WindowsIdentity object returns the identity of the application pool running the search query service, NOT the currently logged in user.   When accessing System.Threading.Thread.CurrentPrinciple.Identity in the security trimmer, the Microsoft.IdentityModel.Claims.ClaimsIdentity object of the current logged in user is returned.  However, there is a catch.  …   If I execute the following code in a .NET web application, the cast of the ClaimsIdentity to a WindowsIdentity succeeds because the identity has the authentication type of NTLM.    WindowsIdentity winId = (WindowsIdentity)System.Threading.Thread.CurrentPrincipal.Identity; WindowsImpersonationContext wic = winId.Impersonate(); request.Credentials = CredentialCache.DefaultCredentials; //access means a response comes back when a request is made to the url using (HttpWebResponse response = (HttpWebResponse)request.GetResponse()) { returnStatus = true; } wic.Undo(); However, when I execute the same code in the context of the SharePoint security trimmer (the search query service li

AutoLogin for authenticated user via LiveID in Sharepoint 2010 (Claims Based Authentication)

Hi,     Im working in integrating LiveID authentication in my Sharepoint site. Live id gives back a token of the user with which i created a dummy profile using MembershipProvider.CreateUser. Now i have to auto login the user with the profile i created, i mean i have to force login to my sharepoint site using the created dummy user details without asking the user to give username n password.Any suggestion will be a great help for me to proceed.   Thanks Saravanan Michael

How to create a list filter like: get all list elements from the current user and all employees from

Hello, is it possible to filter elements by the condition mentioned in the title? Tobias

httpcontext.current.user.identity.isauthenticated always false

Dear, please help me, I create two pages, the first one is the login page with user name and password textboxes - (not asp login control) , when clicking login button I check the login authentication, if it is true redirect to default page. in the default page if !IsCallBack then i check httpcontext.current.user.identity.isauthenticated if it is false i redirect the user to the login page. but my problem is that the httpcontext.current.user.identity.isauthenticated is always false. Below the section of authentication in web config < <authentication mode="Forms">forms loginUrl ="FrmUserLogin.aspx"  protection ="All"  timeout ="1"  name ="LoginRedirectCallback"  path ="/LoginRedirectCallback"  requireSSL ="false"  slidingExpiration ="true"  defaultUrl ="FrmDBLoginConfigaspx.aspx"  cookieless ="UseDeviceProfile"   < < </   </ </enableCrossAppRedirects ="false">credentials passwordFormat="Clear">user name ="admin" password ="admin"/>credentials>forms>authentication> thank you for any help.   Best Regards,

how to get current logged in user in sharepoint

hi im trying to get current logged in user from sharepoint site. All im getting is domain/administrator. I tried following. SPUser and delegation with elevated privilege. they are also not working for me. following is the code im working. spsite site = new spsite("some site")  spweb web = site.openweb() then im using spuser object to get the user. i went to the following link but it seems that guy was also not able to do this.... http://social.msdn.microsoft.com/Forums/en-US/sharepointdevelopment/thread/4101e616-db5d-4504-ad16-169ff62269fb/   any idea... thanks Aqi

Get the current user without writing code

i have a question regarding the "Get the current user without writing code" tutorial. http://blogs.microsoft.co.il/blogs/itaysk/archive/2007/04/05/InfoPath-_2D00_-Get-the-current-user-without-writing-code.aspx?from=ClayCobb the url that i have to enter in the web service details is not working for me. do i have to use the same url for wss 3 also? maybe i have to ask this: can this be used for sharepoint services 3.0? i have enter: http://servername:portnumber/_vti_bin/UserProfileService.asmx  when i open it in a browser it gives me the sharepoint error page and when i insert the url in infopath it gives me this error: the file is not a valid XML file. The form contains XML that cannot be parsed: a string literal was expected, but no opening quote character was found. Line 19,position 38 <TABLE class="ms-main" CELLPADDING=0 CELLSPACING=0 BORDER=0 WIDTH="100%" HEIGHT="100%">

OPENQUERY Error when calling usp - object has no columns or the current user does not have permissio

Hi Guys, I need to get data using a usp, but getting error: Cannot process the object "EXEC BKS..uspPayments @paymentTypeCode1 = '1', @paymentTypeCode2 = '2', @paymentTypeCode3 = '3';". The OLE DB provider "SQLNCLI" for linked server "SERVER" indicates that either the object has no columns or the current user does not have permissions on that object. I am trying the script below: use myDB; select * from OPENQUERY([SERVER], 'EXEC myDB..uspPayments @paymentTypeCode1 = ''1'', @paymentTypeCode2 = ''2'', @paymentTypeCode3 = ''3''; ') Thanks in advance for any help. Everything is possible, impossible just takes longer
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend